Skip to content

Commit

Permalink
Merge pull request odpi#8374 from mandy-chessell/oak2024
Browse files Browse the repository at this point in the history
Add more simple queries to Classification Manager
  • Loading branch information
mandy-chessell authored Sep 5, 2024
2 parents 5b8ab96 + dc91f34 commit 6f3f59f
Show file tree
Hide file tree
Showing 8 changed files with 815 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,79 @@ List<RelatedMetadataElementSummary> getElementsSourceFrom(String userId,
PropertyServerException;


/**
* Retrieve the metadata element using its unique identifier.
*
* @param userId calling user
* @param elementGUID unique identifier for the metadata element
* @param forLineage the retrieved element is for lineage processing so include archived elements
* @param forDuplicateProcessing the retrieved element is for duplicate processing so do not combine results from known duplicates.
* @param effectiveTime only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
*
* @return metadata element properties
* @throws InvalidParameterException one of the parameters is invalid
* @throws UserNotAuthorizedException the user is not authorized to issue this request
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
*/
MetadataElementSummary getMetadataElementByGUID(String userId,
String elementGUID,
boolean forLineage,
boolean forDuplicateProcessing,
Date effectiveTime) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException;


/**
* Retrieve the metadata element using its unique name (typically the qualified name).
*
* @param userId calling user
* @param uniqueName unique name for the metadata element
* @param uniquePropertyName name of property name to test in the open metadata element - if null "qualifiedName" is used
* @param forLineage the retrieved element is for lineage processing so include archived elements
* @param forDuplicateProcessing the retrieved element is for duplicate processing so do not combine results from known duplicates.
* @param effectiveTime only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
*
* @return metadata element properties
* @throws InvalidParameterException one of the parameters is invalid
* @throws UserNotAuthorizedException the user is not authorized to issue this request
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
*/
MetadataElementSummary getMetadataElementByUniqueName(String userId,
String uniqueName,
String uniquePropertyName,
boolean forLineage,
boolean forDuplicateProcessing,
Date effectiveTime) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException;


/**
* Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name).
*
* @param userId calling user
* @param uniqueName unique name for the metadata element
* @param uniquePropertyName name of property name to test in the open metadata element - if null "qualifiedName" is used
* @param forLineage the retrieved element is for lineage processing so include archived elements
* @param forDuplicateProcessing the retrieved element is for duplicate processing so do not combine results from known duplicates.
* @param effectiveTime only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
*
* @return metadata element unique identifier (guid)
* @throws InvalidParameterException one of the parameters is invalid
* @throws UserNotAuthorizedException the user is not authorized to issue this request
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
*/
String getMetadataElementGUIDByUniqueName(String userId,
String uniqueName,
String uniquePropertyName,
boolean forLineage,
boolean forDuplicateProcessing,
Date effectiveTime) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException;


/**
* Retrieve elements of the requested type name and/or name.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,79 @@ List<RelatedMetadataElementSummary> getElementsSourceFrom(String userId,
PropertyServerException;


/**
* Retrieve the metadata element using its unique identifier.
*
* @param userId calling user
* @param elementGUID unique identifier for the metadata element
* @param forLineage the retrieved element is for lineage processing so include archived elements
* @param forDuplicateProcessing the retrieved element is for duplicate processing so do not combine results from known duplicates.
* @param effectiveTime only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
*
* @return metadata element properties
* @throws InvalidParameterException one of the parameters is invalid
* @throws UserNotAuthorizedException the user is not authorized to issue this request
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
*/
MetadataElementSummary getMetadataElementByGUID(String userId,
String elementGUID,
boolean forLineage,
boolean forDuplicateProcessing,
Date effectiveTime) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException;


/**
* Retrieve the metadata element using its unique name (typically the qualified name).
*
* @param userId calling user
* @param uniqueName unique name for the metadata element
* @param uniquePropertyName name of property name to test in the open metadata element - if null "qualifiedName" is used
* @param forLineage the retrieved element is for lineage processing so include archived elements
* @param forDuplicateProcessing the retrieved element is for duplicate processing so do not combine results from known duplicates.
* @param effectiveTime only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
*
* @return metadata element properties
* @throws InvalidParameterException one of the parameters is invalid
* @throws UserNotAuthorizedException the user is not authorized to issue this request
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
*/
MetadataElementSummary getMetadataElementByUniqueName(String userId,
String uniqueName,
String uniquePropertyName,
boolean forLineage,
boolean forDuplicateProcessing,
Date effectiveTime) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException;


/**
* Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name).
*
* @param userId calling user
* @param uniqueName unique name for the metadata element
* @param uniquePropertyName name of property name to test in the open metadata element - if null "qualifiedName" is used
* @param forLineage the retrieved element is for lineage processing so include archived elements
* @param forDuplicateProcessing the retrieved element is for duplicate processing so do not combine results from known duplicates.
* @param effectiveTime only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
*
* @return metadata element unique identifier (guid)
* @throws InvalidParameterException one of the parameters is invalid
* @throws UserNotAuthorizedException the user is not authorized to issue this request
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
*/
String getMetadataElementGUIDByUniqueName(String userId,
String uniqueName,
String uniquePropertyName,
boolean forLineage,
boolean forDuplicateProcessing,
Date effectiveTime) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException;


/**
* Retrieve elements of the requested type name and/or name.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.AssetElement;
import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GlossaryTermElement;
import org.odpi.openmetadata.accessservices.assetmanager.metadataelements.GovernanceDefinitionElement;
import org.odpi.openmetadata.commonservices.ffdc.rest.GUIDResponse;
import org.odpi.openmetadata.commonservices.ffdc.rest.MetadataElementSummaryResponse;
import org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataElement;
import org.odpi.openmetadata.frameworks.governanceaction.properties.OpenMetadataRelationship;
import org.odpi.openmetadata.frameworks.governanceaction.properties.RelatedMetadataElement;
Expand Down Expand Up @@ -2066,6 +2068,120 @@ public List<RelatedMetadataElementSummary> getElementsSourceFrom(String userId,
}



/**
* Retrieve the metadata element using its unique identifier.
*
* @param userId calling user
* @param elementGUID unique identifier for the metadata element
* @param forLineage the retrieved element is for lineage processing so include archived elements
* @param forDuplicateProcessing the retrieved element is for duplicate processing so do not combine results from known duplicates.
* @param effectiveTime only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
*
* @return metadata element properties
* @throws InvalidParameterException one of the parameters is invalid
* @throws UserNotAuthorizedException the user is not authorized to issue this request
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
*/
@Override
public MetadataElementSummary getMetadataElementByGUID(String userId,
String elementGUID,
boolean forLineage,
boolean forDuplicateProcessing,
Date effectiveTime) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException
{
final String methodName = "getMetadataElementByGUID";
final String elementGUIDParameterName = "elementGUID";

invalidParameterHandler.validateGUID(elementGUID, elementGUIDParameterName, methodName);

OpenMetadataElement openMetadataElement = openMetadataStoreClient.getMetadataElementByGUID(userId,
elementGUID,
forLineage,
forDuplicateProcessing,
effectiveTime);

return metadataElementSummaryConverter.getNewBean(MetadataElementSummary.class,
openMetadataElement,
methodName);
}


/**
* Retrieve the metadata element using its unique name (typically the qualified name).
*
* @param userId calling user
* @param uniqueName unique name for the metadata element
* @param uniquePropertyName name of property name to test in the open metadata element - if null "qualifiedName" is used
* @param forLineage the retrieved element is for lineage processing so include archived elements
* @param forDuplicateProcessing the retrieved element is for duplicate processing so do not combine results from known duplicates.
* @param effectiveTime only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
*
* @return metadata element properties
* @throws InvalidParameterException one of the parameters is invalid
* @throws UserNotAuthorizedException the user is not authorized to issue this request
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
*/
@Override
public MetadataElementSummary getMetadataElementByUniqueName(String userId,
String uniqueName,
String uniquePropertyName,
boolean forLineage,
boolean forDuplicateProcessing,
Date effectiveTime) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException
{
final String methodName = "getMetadataElementByUniqueName";
final String elementGUIDParameterName = "uniqueName";

invalidParameterHandler.validateName(uniqueName, elementGUIDParameterName, methodName);

OpenMetadataElement openMetadataElement = openMetadataStoreClient.getMetadataElementByUniqueName(userId,
uniqueName,
uniquePropertyName,
forLineage,
forDuplicateProcessing,
effectiveTime);

return metadataElementSummaryConverter.getNewBean(MetadataElementSummary.class,
openMetadataElement,
methodName);
}



/**
* Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name).
*
* @param userId calling user
* @param uniqueName unique name for the metadata element
* @param uniquePropertyName name of property name to test in the open metadata element - if null "qualifiedName" is used
* @param forLineage the retrieved element is for lineage processing so include archived elements
* @param forDuplicateProcessing the retrieved element is for duplicate processing so do not combine results from known duplicates.
* @param effectiveTime only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.
*
* @return metadata element unique identifier (guid)
* @throws InvalidParameterException one of the parameters is invalid
* @throws UserNotAuthorizedException the user is not authorized to issue this request
* @throws PropertyServerException there is a problem reported in the open metadata server(s)
*/
@Override
public String getMetadataElementGUIDByUniqueName(String userId,
String uniqueName,
String uniquePropertyName,
boolean forLineage,
boolean forDuplicateProcessing,
Date effectiveTime) throws InvalidParameterException,
UserNotAuthorizedException,
PropertyServerException
{
return openMetadataStoreClient.getMetadataElementGUIDByUniqueName(userId, uniqueName, uniquePropertyName, forLineage, forDuplicateProcessing, effectiveTime);
}


/**
* Retrieve elements of the requested type name.
*
Expand Down
Loading

0 comments on commit 6f3f59f

Please sign in to comment.