Class RepositoryGovernanceServiceContext
java.lang.Object
org.odpi.openmetadata.engineservices.repositorygovernance.connector.RepositoryGovernanceContext
org.odpi.openmetadata.engineservices.repositorygovernance.handlers.RepositoryGovernanceServiceContext
RepositoryGovernanceContext provides the archive service with access to information about
the archive request along with the open metadata repository interfaces.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.engineservices.repositorygovernance.connector.RepositoryGovernanceContext
requestParameters, requestType, userId
-
Constructor Summary
ConstructorDescriptionRepositoryGovernanceServiceContext
(String userId, String repositoryGovernanceServiceName, String requestType, Map<String, String> requestParameters, String requesterUserId, List<RequestSourceElement> requestSourceElements, List<ActionTargetElement> actionTargetElements, EnterpriseRepositoryServicesClient repositoryServicesClient) Constructor sets up the key parameters for processing the request to the repository governance service. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Disconnect from the topic connector - events will no longer be passed to the registered listeners.Returns all the AttributeTypeDefs for a specific category.findEntities
(String entityTypeGUID, List<String> entitySubtypeGUIDs, SearchProperties matchProperties, int fromEntityElement, List<InstanceStatus> limitResultsByStatus, SearchClassifications matchClassifications, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) Return a list of entities that match the supplied criteria.findEntitiesByClassification
(String entityTypeGUID, String classificationName, InstanceProperties matchClassificationProperties, MatchCriteria matchCriteria, int fromEntityElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) Return a list of entities that have the requested type of classifications attached.findEntitiesByProperty
(String entityTypeGUID, InstanceProperties matchProperties, MatchCriteria matchCriteria, int fromEntityElement, List<InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) Return a list of entities that match the supplied properties according to the match criteria.findEntitiesByPropertyValue
(String entityTypeGUID, String searchCriteria, int fromEntityElement, List<InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) Return a list of entities whose string based property values match the search criteria.findRelationships
(String relationshipTypeGUID, List<String> relationshipSubtypeGUIDs, SearchProperties matchProperties, int fromRelationshipElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) Return a list of relationships that match the requested conditions.findRelationshipsByProperty
(String relationshipTypeGUID, InstanceProperties matchProperties, MatchCriteria matchCriteria, int fromRelationshipElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) Return a list of relationships that match the requested properties by the matching criteria.findRelationshipsByPropertyValue
(String relationshipTypeGUID, String searchCriteria, int fromRelationshipElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) Return a list of relationships whose string based property values match the search criteria.findTypeDefsByCategory
(TypeDefCategory category) Returns all the TypeDefs for a specific category.findTypeDefsByProperty
(TypeDefProperties matchCriteria) Return the TypeDefs that have the properties matching the supplied match criteria.findTypesByExternalID
(String standard, String organization, String identifier) Return the types that are linked to the elements from the specified standard.findTypesByName
(String name) Returns a list of type definitions that have the specified name.Returns the list of different types of metadata organized into two groups.Return the AttributeTypeDef identified by the GUID.Return the AttributeTypeDef identified by the unique name.Return any completion status from the archive service.getEntityDetail
(String guid) Return the header, classifications and properties of a specific entity.getEntityDetail
(String guid, Date asOfTime) Return a historical version of an entity includes the header, classifications and properties of the entity.getEntityDetailHistory
(String guid, Date fromTime, Date toTime, int startFromElement, int pageSize, HistorySequencingOrder sequencingOrder) Return all historical versions of an entity within the bounds of the provided timestamps.getEntitySummary
(String guid) Return the header and classifications for a specific entity.Returns the identifier of the metadata repository.getRelationship
(String guid) Return a requested relationship.getRelationship
(String guid, Date asOfTime) Return a historical version of a relationship.getRelationshipHistory
(String guid, Date fromTime, Date toTime, int startFromElement, int pageSize, HistorySequencingOrder sequencingOrder) Return all historical versions of a relationship within the bounds of the provided timestamps.getRelationshipsForEntity
(String entityGUID, String relationshipTypeGUID, int fromRelationshipElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) Return the relationships for a specific entity.Return the userId of the original person, process, service that requested this action.getTypeDefByGUID
(String guid) Return the TypeDef identified by the GUID.getTypeDefByName
(String name) Return the TypeDef identified by the unique name.isEntityKnown
(String guid) Returns the entity if the entity is stored in the metadata collection, otherwise null.isRelationshipKnown
(String guid) Returns a boolean indicating if the relationship is stored in the metadata collection.void
recordCompletionStatus
(CompletionStatus status, List<String> outputGuards, Map<String, String> newRequestParameters, List<NewActionTarget> newActionTargets, String completionMessage) Declare that all the processing for the archive service is finished and the status of the work.void
Register a listener to receive events about changes to metadata elements in the open metadata repositories.searchForTypeDefs
(String searchCriteria) Return the TypeDefs that match the search criteria.void
setRepositoryGovernanceServiceHandler
(RepositoryGovernanceServiceHandler archiveServiceHandler) Set up the archive service handler.toString()
Standard toString method.Methods inherited from class org.odpi.openmetadata.engineservices.repositorygovernance.connector.RepositoryGovernanceContext
getActionTargetElements, getRequestParameters, getRequestSourceElements, getRequestType
-
Constructor Details
-
RepositoryGovernanceServiceContext
public RepositoryGovernanceServiceContext(String userId, String repositoryGovernanceServiceName, String requestType, Map<String, String> requestParameters, String requesterUserId, List<RequestSourceElement> requestSourceElements, List<ActionTargetElement> actionTargetElements, EnterpriseRepositoryServicesClient repositoryServicesClient) Constructor sets up the key parameters for processing the request to the repository governance service.- Parameters:
userId
- calling userrepositoryGovernanceServiceName
- name os service using this context - for error messages.requestType
- unique identifier of the asset that the annotations should be attached torequestParameters
- name-value properties to control the archive servicerequesterUserId
- original user requesting this governance servicerequestSourceElements
- metadata elements associated with the request to the archive serviceactionTargetElements
- metadata elements that need to be worked on by the archive servicerepositoryServicesClient
- client to the metadata store for use by the archive service
-
-
Method Details
-
getRequesterUserId
Return the userId of the original person, process, service that requested this action.- Returns:
- string userId
-
setRepositoryGovernanceServiceHandler
public void setRepositoryGovernanceServiceHandler(RepositoryGovernanceServiceHandler archiveServiceHandler) Set up the archive service handler.- Parameters:
archiveServiceHandler
- handler
-
registerListener
public void registerListener(OMRSTopicRepositoryEventListener listener) throws InvalidParameterException, UserNotAuthorizedException, RepositoryErrorException, ConnectionCheckedException, ConnectorCheckedException Register a listener to receive events about changes to metadata elements in the open metadata repositories.- Specified by:
registerListener
in classRepositoryGovernanceContext
- Parameters:
listener
- listener object to receive events- Throws:
InvalidParameterException
- one or more of the type names are unrecognizedUserNotAuthorizedException
- user is not authorized to register a listenerRepositoryErrorException
- the metadata server is not available or in errorConnectionCheckedException
- the connection to the event topic is in errorConnectorCheckedException
- the connector to the event topic is in error
-
disconnectFromEnterpriseTopic
Disconnect from the topic connector - events will no longer be passed to the registered listeners.- Specified by:
disconnectFromEnterpriseTopic
in classRepositoryGovernanceContext
- Throws:
ConnectorCheckedException
- problem with the topic connector
-
getMetadataCollectionId
Returns the identifier of the metadata repository. This is the identifier used to register the metadata repository with the metadata repository cohort. It is also the identifier used to identify the home repository of a metadata instance.- Specified by:
getMetadataCollectionId
in classRepositoryGovernanceContext
- Returns:
- String metadata collection id.
- Throws:
RepositoryErrorException
- there is a problem communicating with the metadata repository.
-
getAllTypes
public TypeDefGallery getAllTypes() throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedExceptionReturns the list of different types of metadata organized into two groups. The first are the attribute type definitions (AttributeTypeDefs). These provide types for properties in full type definitions. Full type definitions (TypeDefs) describe types for entities, relationships and classifications.- Specified by:
getAllTypes
in classRepositoryGovernanceContext
- Returns:
- TypeDefGallery List of different categories of type definitions.
- Throws:
InvalidParameterException
- the userId is nullRepositoryErrorException
- there is a problem communicating with the metadata repository.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findTypesByName
public TypeDefGallery findTypesByName(String name) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Returns a list of type definitions that have the specified name. Type names should be unique. This method allows wildcard character to be included in the name. These are * (asterisk) for an arbitrary string of characters and ampersand for an arbitrary character.- Specified by:
findTypesByName
in classRepositoryGovernanceContext
- Parameters:
name
- name of the TypeDefs to return (including wildcard characters).- Returns:
- TypeDefGallery list.
- Throws:
InvalidParameterException
- the name of the TypeDef is null.RepositoryErrorException
- there is a problem communicating with the metadata repository.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findTypeDefsByCategory
public List<TypeDef> findTypeDefsByCategory(TypeDefCategory category) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Returns all the TypeDefs for a specific category.- Specified by:
findTypeDefsByCategory
in classRepositoryGovernanceContext
- Parameters:
category
- enum value for the category of TypeDef to return.- Returns:
- TypeDefs list.
- Throws:
InvalidParameterException
- the TypeDefCategory is null.RepositoryErrorException
- there is a problem communicating with the metadata repository.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findAttributeTypeDefsByCategory
public List<AttributeTypeDef> findAttributeTypeDefsByCategory(AttributeTypeDefCategory category) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Returns all the AttributeTypeDefs for a specific category.- Specified by:
findAttributeTypeDefsByCategory
in classRepositoryGovernanceContext
- Parameters:
category
- enum value for the category of an AttributeTypeDef to return.- Returns:
- TypeDefs list.
- Throws:
InvalidParameterException
- the TypeDefCategory is null.RepositoryErrorException
- there is a problem communicating with the metadata repository.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findTypeDefsByProperty
public List<TypeDef> findTypeDefsByProperty(TypeDefProperties matchCriteria) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Return the TypeDefs that have the properties matching the supplied match criteria.- Specified by:
findTypeDefsByProperty
in classRepositoryGovernanceContext
- Parameters:
matchCriteria
- TypeDefProperties a list of property names.- Returns:
- TypeDefs list.
- Throws:
InvalidParameterException
- the matchCriteria is null.RepositoryErrorException
- there is a problem communicating with the metadata repository.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findTypesByExternalID
public List<TypeDef> findTypesByExternalID(String standard, String organization, String identifier) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Return the types that are linked to the elements from the specified standard.- Specified by:
findTypesByExternalID
in classRepositoryGovernanceContext
- Parameters:
standard
- name of the standard null means any.organization
- name of the organization null means any.identifier
- identifier of the element in the standard null means any.- Returns:
- TypeDefs list each entry in the list contains a typedef. This is is a structure describing the TypeDef's category and properties.
- Throws:
InvalidParameterException
- all attributes of the external id are null.RepositoryErrorException
- there is a problem communicating with the metadata repository.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
searchForTypeDefs
public List<TypeDef> searchForTypeDefs(String searchCriteria) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Return the TypeDefs that match the search criteria.- Specified by:
searchForTypeDefs
in classRepositoryGovernanceContext
- Parameters:
searchCriteria
- String search criteria.- Returns:
- TypeDefs list each entry in the list contains a typedef. This is is a structure describing the TypeDef's category and properties.
- Throws:
InvalidParameterException
- the searchCriteria is null.RepositoryErrorException
- there is a problem communicating with the metadata repository.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getTypeDefByGUID
public TypeDef getTypeDefByGUID(String guid) throws InvalidParameterException, RepositoryErrorException, TypeDefNotKnownException, UserNotAuthorizedException Return the TypeDef identified by the GUID.- Specified by:
getTypeDefByGUID
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique id of the TypeDef.- Returns:
- TypeDef structure describing its category and properties.
- Throws:
InvalidParameterException
- the guid is null.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.TypeDefNotKnownException
- The requested TypeDef is not known in the metadata collection.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getAttributeTypeDefByGUID
public AttributeTypeDef getAttributeTypeDefByGUID(String guid) throws InvalidParameterException, RepositoryErrorException, TypeDefNotKnownException, UserNotAuthorizedException Return the AttributeTypeDef identified by the GUID.- Specified by:
getAttributeTypeDefByGUID
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique id of the TypeDef- Returns:
- TypeDef structure describing its category and properties.
- Throws:
InvalidParameterException
- the guid is null.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.TypeDefNotKnownException
- The requested TypeDef is not known in the metadata collection.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getTypeDefByName
public TypeDef getTypeDefByName(String name) throws InvalidParameterException, RepositoryErrorException, TypeDefNotKnownException, UserNotAuthorizedException Return the TypeDef identified by the unique name.- Specified by:
getTypeDefByName
in classRepositoryGovernanceContext
- Parameters:
name
- String name of the TypeDef.- Returns:
- TypeDef structure describing its category and properties.
- Throws:
InvalidParameterException
- the name is null.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.TypeDefNotKnownException
- the requested TypeDef is not found in the metadata collection.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getAttributeTypeDefByName
public AttributeTypeDef getAttributeTypeDefByName(String name) throws InvalidParameterException, RepositoryErrorException, TypeDefNotKnownException, UserNotAuthorizedException Return the AttributeTypeDef identified by the unique name.- Specified by:
getAttributeTypeDefByName
in classRepositoryGovernanceContext
- Parameters:
name
- String name of the TypeDef.- Returns:
- TypeDef structure describing its category and properties.
- Throws:
InvalidParameterException
- the name is null.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.TypeDefNotKnownException
- the requested TypeDef is not found in the metadata collection.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
isEntityKnown
public EntityDetail isEntityKnown(String guid) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Returns the entity if the entity is stored in the metadata collection, otherwise null.- Specified by:
isEntityKnown
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique identifier for the entity- Returns:
- the entity details if the entity is found in the metadata collection; otherwise return null
- Throws:
InvalidParameterException
- the guid is null.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getEntitySummary
public EntitySummary getEntitySummary(String guid) throws InvalidParameterException, RepositoryErrorException, EntityNotKnownException, UserNotAuthorizedException Return the header and classifications for a specific entity. The returned entity summary may be from a full entity object or an entity proxy.- Specified by:
getEntitySummary
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique identifier for the entity- Returns:
- EntitySummary structure
- Throws:
InvalidParameterException
- the guid is null.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.EntityNotKnownException
- the requested entity instance is not known in the metadata collection.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getEntityDetail
public EntityDetail getEntityDetail(String guid) throws InvalidParameterException, RepositoryErrorException, EntityNotKnownException, EntityProxyOnlyException, UserNotAuthorizedException Return the header, classifications and properties of a specific entity.- Specified by:
getEntityDetail
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique identifier for the entity.- Returns:
- EntityDetail structure.
- Throws:
InvalidParameterException
- the guid is null.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.EntityNotKnownException
- the requested entity instance is not known in the metadata collection.EntityProxyOnlyException
- the requested entity instance is only a proxy in the metadata collection.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getEntityDetail
public EntityDetail getEntityDetail(String guid, Date asOfTime) throws InvalidParameterException, RepositoryErrorException, EntityNotKnownException, EntityProxyOnlyException, FunctionNotSupportedException, UserNotAuthorizedException Return a historical version of an entity includes the header, classifications and properties of the entity.- Specified by:
getEntityDetail
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique identifier for the entity.asOfTime
- the time used to determine which version of the entity that is desired.- Returns:
- EntityDetail structure.
- Throws:
InvalidParameterException
- the guid or date is null, or the asOfTime property is for a future timeRepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.EntityNotKnownException
- the requested entity instance is not known in the metadata collection at the time requested.EntityProxyOnlyException
- the requested entity instance is only a proxy in the metadata collection.FunctionNotSupportedException
- the repository does not support the asOfTime parameter.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getEntityDetailHistory
public List<EntityDetail> getEntityDetailHistory(String guid, Date fromTime, Date toTime, int startFromElement, int pageSize, HistorySequencingOrder sequencingOrder) throws InvalidParameterException, RepositoryErrorException, EntityNotKnownException, EntityProxyOnlyException, FunctionNotSupportedException, UserNotAuthorizedException Return all historical versions of an entity within the bounds of the provided timestamps. To retrieve all historical versions of an entity, set both the 'fromTime' and 'toTime' to null.- Specified by:
getEntityDetailHistory
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique identifier for the entity.fromTime
- the earliest point in time from which to retrieve historical versions of the entity (inclusive)toTime
- the latest point in time from which to retrieve historical versions of the entity (exclusive)startFromElement
- the starting element number of the historical versions to return. This is used when retrieving versions beyond the first page of results. Zero means start from the first element.pageSize
- the maximum number of result versions that can be returned on this request. Zero means unrestricted return results size.sequencingOrder
- Enum defining how the results should be ordered.- Returns:
List<EntityDetail>
of each historical version of the entity detail within the bounds, and in the order requested.- Throws:
InvalidParameterException
- the guid or date is null or fromTime is after the toTimeRepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.EntityNotKnownException
- the requested entity instance is not known in the metadata collection at the time requested.EntityProxyOnlyException
- the requested entity instance is only a proxy in the metadata collection.FunctionNotSupportedException
- the repository does not support history.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getRelationshipsForEntity
public List<Relationship> getRelationshipsForEntity(String entityGUID, String relationshipTypeGUID, int fromRelationshipElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) throws InvalidParameterException, TypeErrorException, RepositoryErrorException, EntityNotKnownException, PropertyErrorException, PagingErrorException, FunctionNotSupportedException, UserNotAuthorizedException Return the relationships for a specific entity.- Specified by:
getRelationshipsForEntity
in classRepositoryGovernanceContext
- Parameters:
entityGUID
- String unique identifier for the entity.relationshipTypeGUID
- String GUID of the type of relationship required (null for all).fromRelationshipElement
- the starting element number of the relationships to return. This is used when retrieving elements beyond the first page of results. Zero means start from the first element.limitResultsByStatus
- By default, relationships in all statuses are returned. However, it is possible to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values.asOfTime
- Requests a historical query of the relationships for the entity. Null means return the present values.sequencingProperty
- String name of the property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).sequencingOrder
- Enum defining how the results should be ordered.pageSize
- -- the maximum number of result classifications that can be returned on this request. Zero means unrestricted return results size.- Returns:
- Relationships list. Null means no relationships associated with the entity.
- Throws:
InvalidParameterException
- a parameter is invalid or null.TypeErrorException
- the type guid passed on the request is not known by the metadata collection.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.EntityNotKnownException
- the requested entity instance is not known in the metadata collection.PropertyErrorException
- the sequencing property is not valid for the attached classifications.PagingErrorException
- the paging/sequencing parameters are set up incorrectly.FunctionNotSupportedException
- the repository does not support the asOfTime parameter.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findEntities
public List<EntityDetail> findEntities(String entityTypeGUID, List<String> entitySubtypeGUIDs, SearchProperties matchProperties, int fromEntityElement, List<InstanceStatus> limitResultsByStatus, SearchClassifications matchClassifications, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) throws InvalidParameterException, RepositoryErrorException, TypeErrorException, PropertyErrorException, PagingErrorException, FunctionNotSupportedException, UserNotAuthorizedException Return a list of entities that match the supplied criteria. The results can be returned over many pages.- Specified by:
findEntities
in classRepositoryGovernanceContext
- Parameters:
entityTypeGUID
- String unique identifier for the entity type of interest (null means any entity type).entitySubtypeGUIDs
- optional list of the unique identifiers (guids) for subtypes of the entityTypeGUID to include in the search results. Null means all subtypes.matchProperties
- Optional list of entity property conditions to match.fromEntityElement
- the starting element number of the entities to return. This is used when retrieving elements beyond the first page of results. Zero means start from the first element.limitResultsByStatus
- By default, entities in all statuses are returned. However, it is possible to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values.matchClassifications
- Optional list of entity classifications to match.asOfTime
- Requests a historical query of the entity. Null means return the present values.sequencingProperty
- String name of the entity property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).sequencingOrder
- Enum defining how the results should be ordered.pageSize
- the maximum number of result entities that can be returned on this request. Zero means unrestricted return results size.- Returns:
- a list of entities matching the supplied criteria; null means no matching entities in the metadata collection.
- Throws:
InvalidParameterException
- a parameter is invalid or null.TypeErrorException
- the type guid passed on the request is not known by the metadata collection.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.PropertyErrorException
- the properties specified are not valid for any of the requested types of entity.PagingErrorException
- the paging/sequencing parameters are set up incorrectly.FunctionNotSupportedException
- the repository does not support this optional method.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findEntitiesByProperty
public List<EntityDetail> findEntitiesByProperty(String entityTypeGUID, InstanceProperties matchProperties, MatchCriteria matchCriteria, int fromEntityElement, List<InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) throws InvalidParameterException, RepositoryErrorException, TypeErrorException, PropertyErrorException, PagingErrorException, FunctionNotSupportedException, UserNotAuthorizedException Return a list of entities that match the supplied properties according to the match criteria. The results can be returned over many pages.- Specified by:
findEntitiesByProperty
in classRepositoryGovernanceContext
- Parameters:
entityTypeGUID
- String unique identifier for the entity type of interest (null means any entity type).matchProperties
- Optional list of entity properties to match (where any String property's value should be defined as a Java regular expression, even if it should be an exact match).matchCriteria
- Enum defining how the match properties should be matched to the entities in the repository.fromEntityElement
- the starting element number of the entities to return. This is used when retrieving elements beyond the first page of results. Zero means start from the first element.limitResultsByStatus
- By default, entities in all statuses are returned. However, it is possible to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values.limitResultsByClassification
- List of classifications that must be present on all returned entities.asOfTime
- Requests a historical query of the entity. Null means return the present values.sequencingProperty
- String name of the entity property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).sequencingOrder
- Enum defining how the results should be ordered.pageSize
- the maximum number of result entities that can be returned on this request. Zero means unrestricted return results size.- Returns:
- a list of entities matching the supplied criteria; null means no matching entities in the metadata collection.
- Throws:
InvalidParameterException
- a parameter is invalid or null.TypeErrorException
- the type guid passed on the request is not known by the metadata collection.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.PropertyErrorException
- the properties specified are not valid for any of the requested types of entity.PagingErrorException
- the paging/sequencing parameters are set up incorrectly.FunctionNotSupportedException
- the repository does not support one of the provided parameters.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findEntitiesByClassification
public List<EntityDetail> findEntitiesByClassification(String entityTypeGUID, String classificationName, InstanceProperties matchClassificationProperties, MatchCriteria matchCriteria, int fromEntityElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) throws InvalidParameterException, TypeErrorException, RepositoryErrorException, ClassificationErrorException, PropertyErrorException, PagingErrorException, FunctionNotSupportedException, UserNotAuthorizedException Return a list of entities that have the requested type of classifications attached.- Specified by:
findEntitiesByClassification
in classRepositoryGovernanceContext
- Parameters:
entityTypeGUID
- unique identifier for the type of entity requested. Null means any type of entity (but could be slow so not recommended.classificationName
- name of the classification, note a null is not valid.matchClassificationProperties
- list of classification properties used to narrow the search (where any String property's value should be defined as a Java regular expression, even if it should be an exact match).matchCriteria
- Enum defining how the match properties should be matched to the classifications in the repository.fromEntityElement
- the starting element number of the entities to return. This is used when retrieving elements beyond the first page of results. Zero means start from the first element.limitResultsByStatus
- By default, entities in all statuses are returned. However, it is possible to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values.asOfTime
- Requests a historical query of the entity. Null means return the present values.sequencingProperty
- String name of the entity property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).sequencingOrder
- Enum defining how the results should be ordered.pageSize
- the maximum number of result entities that can be returned on this request. Zero means unrestricted return results size.- Returns:
- a list of entities matching the supplied criteria; null means no matching entities in the metadata collection.
- Throws:
InvalidParameterException
- a parameter is invalid or null.TypeErrorException
- the type guid passed on the request is not known by the metadata collection.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.ClassificationErrorException
- the classification request is not known to the metadata collection.PropertyErrorException
- the properties specified are not valid for the requested type of classification.PagingErrorException
- the paging/sequencing parameters are set up incorrectly.FunctionNotSupportedException
- the repository does not support one of the provided parameters.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findEntitiesByPropertyValue
public List<EntityDetail> findEntitiesByPropertyValue(String entityTypeGUID, String searchCriteria, int fromEntityElement, List<InstanceStatus> limitResultsByStatus, List<String> limitResultsByClassification, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) throws InvalidParameterException, TypeErrorException, RepositoryErrorException, PropertyErrorException, PagingErrorException, FunctionNotSupportedException, UserNotAuthorizedException Return a list of entities whose string based property values match the search criteria. The search criteria may include regex style wild cards.- Specified by:
findEntitiesByPropertyValue
in classRepositoryGovernanceContext
- Parameters:
entityTypeGUID
- GUID of the type of entity to search for. Null means all types will be searched (could be slow so not recommended).searchCriteria
- String Java regular expression used to match against any of the String property values within the entities of the supplied type, even if it should be an exact match. (Retrieve all entities of the supplied type if this is either null or an empty string.)fromEntityElement
- the starting element number of the entities to return. This is used when retrieving elements beyond the first page of results. Zero means start from the first element.limitResultsByStatus
- By default, entities in all statuses are returned. However, it is possible to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values.limitResultsByClassification
- List of classifications that must be present on all returned entities.asOfTime
- Requests a historical query of the entity. Null means return the present values.sequencingProperty
- String name of the property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).sequencingOrder
- Enum defining how the results should be ordered.pageSize
- the maximum number of result entities that can be returned on this request. Zero means unrestricted return results size.- Returns:
- a list of entities matching the supplied criteria null means no matching entities in the metadata collection.
- Throws:
InvalidParameterException
- a parameter is invalid or null.TypeErrorException
- the type guid passed on the request is not known by the metadata collection.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.PropertyErrorException
- the sequencing property specified is not valid for any of the requested types of entity.PagingErrorException
- the paging/sequencing parameters are set up incorrectly.FunctionNotSupportedException
- the repository does not support one of the provided parameters.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
isRelationshipKnown
public Relationship isRelationshipKnown(String guid) throws InvalidParameterException, RepositoryErrorException, UserNotAuthorizedException Returns a boolean indicating if the relationship is stored in the metadata collection.- Specified by:
isRelationshipKnown
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique identifier for the relationship.- Returns:
- relationship details if the relationship is found in the metadata collection; otherwise return null.
- Throws:
InvalidParameterException
- the guid is null.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getRelationship
public Relationship getRelationship(String guid) throws InvalidParameterException, RepositoryErrorException, RelationshipNotKnownException, UserNotAuthorizedException Return a requested relationship.- Specified by:
getRelationship
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique identifier for the relationship.- Returns:
- a relationship structure.
- Throws:
InvalidParameterException
- the guid is null.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.RelationshipNotKnownException
- the metadata collection does not have a relationship with the requested GUID stored.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getRelationship
public Relationship getRelationship(String guid, Date asOfTime) throws InvalidParameterException, RepositoryErrorException, RelationshipNotKnownException, FunctionNotSupportedException, UserNotAuthorizedException Return a historical version of a relationship.- Specified by:
getRelationship
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique identifier for the relationship.asOfTime
- the time used to determine which version of the entity that is desired.- Returns:
- Relationship structure.
- Throws:
InvalidParameterException
- the guid or date is null or the asOfTime property is for a future time.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.RelationshipNotKnownException
- the requested entity instance is not known in the metadata collection at the time requested.FunctionNotSupportedException
- the repository does not support the asOfTime parameter.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
getRelationshipHistory
public List<Relationship> getRelationshipHistory(String guid, Date fromTime, Date toTime, int startFromElement, int pageSize, HistorySequencingOrder sequencingOrder) throws InvalidParameterException, RepositoryErrorException, RelationshipNotKnownException, FunctionNotSupportedException, UserNotAuthorizedException Return all historical versions of a relationship within the bounds of the provided timestamps. To retrieve all historical versions of a relationship, set both the 'fromTime' and 'toTime' to null.- Specified by:
getRelationshipHistory
in classRepositoryGovernanceContext
- Parameters:
guid
- String unique identifier for the entity.fromTime
- the earliest point in time from which to retrieve historical versions of the entity (inclusive)toTime
- the latest point in time from which to retrieve historical versions of the entity (exclusive)startFromElement
- the starting element number of the historical versions to return. This is used when retrieving versions beyond the first page of results. Zero means start from the first element.pageSize
- the maximum number of result versions that can be returned on this request. Zero means unrestricted return results size.sequencingOrder
- Enum defining how the results should be ordered.- Returns:
List<Relationship>
of each historical version of the relationship within the bounds, and in the order requested.- Throws:
InvalidParameterException
- the guid or date is null or fromTime is after the toTimeRepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.RelationshipNotKnownException
- the requested relationship instance is not known in the metadata collection at the time requested.FunctionNotSupportedException
- the repository does not support history.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findRelationships
public List<Relationship> findRelationships(String relationshipTypeGUID, List<String> relationshipSubtypeGUIDs, SearchProperties matchProperties, int fromRelationshipElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) throws InvalidParameterException, TypeErrorException, RepositoryErrorException, PropertyErrorException, PagingErrorException, FunctionNotSupportedException, UserNotAuthorizedException Return a list of relationships that match the requested conditions. The results can be received as a series of pages.- Specified by:
findRelationships
in classRepositoryGovernanceContext
- Parameters:
relationshipTypeGUID
- unique identifier (guid) for the new relationship's type. Null means all types (but may be slow so not recommended).relationshipSubtypeGUIDs
- optional list of the unique identifiers (guids) for subtypes of the relationshipTypeGUID to include in the search results. Null means all subtypes.matchProperties
- Optional list of relationship property conditions to match.fromRelationshipElement
- the starting element number of the entities to return. This is used when retrieving elements beyond the first page of results. Zero means start from the first element.limitResultsByStatus
- By default, relationships in all statuses are returned. However, it is possible to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values.asOfTime
- Requests a historical query of the relationships for the entity. Null means return the present values.sequencingProperty
- String name of the property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).sequencingOrder
- Enum defining how the results should be ordered.pageSize
- the maximum number of result relationships that can be returned on this request. Zero means unrestricted return results size.- Returns:
- a list of relationships. Null means no matching relationships.
- Throws:
InvalidParameterException
- one of the parameters is invalid or null.TypeErrorException
- the type guid passed on the request is not known by the metadata collection.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.PropertyErrorException
- the properties specified are not valid for any of the requested types of relationships.PagingErrorException
- the paging/sequencing parameters are set up incorrectly.FunctionNotSupportedException
- the repository does not support one of the provided parameters.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findRelationshipsByProperty
public List<Relationship> findRelationshipsByProperty(String relationshipTypeGUID, InstanceProperties matchProperties, MatchCriteria matchCriteria, int fromRelationshipElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) throws InvalidParameterException, TypeErrorException, RepositoryErrorException, PropertyErrorException, PagingErrorException, FunctionNotSupportedException, UserNotAuthorizedException Return a list of relationships that match the requested properties by the matching criteria. The results can be received as a series of pages.- Specified by:
findRelationshipsByProperty
in classRepositoryGovernanceContext
- Parameters:
relationshipTypeGUID
- unique identifier (guid) for the new relationship's type. Null means all types (but may be slow so not recommended).matchProperties
- Optional list of relationship properties to match (where any String property's value should be defined as a Java regular expression, even if it should be an exact match).matchCriteria
- Enum defining how the properties should be matched to the relationships in the repository.fromRelationshipElement
- the starting element number of the entities to return. This is used when retrieving elements beyond the first page of results. Zero means start from the first element.limitResultsByStatus
- By default, relationships in all statuses are returned. However, it is possible to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values.asOfTime
- Requests a historical query of the relationships for the entity. Null means return the present values.sequencingProperty
- String name of the property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).sequencingOrder
- Enum defining how the results should be ordered.pageSize
- the maximum number of result relationships that can be returned on this request. Zero means unrestricted return results size.- Returns:
- a list of relationships. Null means no matching relationships.
- Throws:
InvalidParameterException
- one of the parameters is invalid or null.TypeErrorException
- the type guid passed on the request is not known by the metadata collection.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.PropertyErrorException
- the properties specified are not valid for any of the requested types of relationships.PagingErrorException
- the paging/sequencing parameters are set up incorrectly.FunctionNotSupportedException
- the repository does not support one of the provided parameters.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
findRelationshipsByPropertyValue
public List<Relationship> findRelationshipsByPropertyValue(String relationshipTypeGUID, String searchCriteria, int fromRelationshipElement, List<InstanceStatus> limitResultsByStatus, Date asOfTime, String sequencingProperty, SequencingOrder sequencingOrder, int pageSize) throws InvalidParameterException, TypeErrorException, RepositoryErrorException, PropertyErrorException, PagingErrorException, FunctionNotSupportedException, UserNotAuthorizedException Return a list of relationships whose string based property values match the search criteria. The search criteria may include regex style wild cards.- Specified by:
findRelationshipsByPropertyValue
in classRepositoryGovernanceContext
- Parameters:
relationshipTypeGUID
- GUID of the type of entity to search for. Null means all types will be searched (could be slow so not recommended).searchCriteria
- String Java regular expression used to match against any of the String property values within the relationships of the supplied type, even if it should be an exact match.fromRelationshipElement
- Element number of the results to skip to when building the results list to return. Zero means begin at the start of the results. This is used to retrieve the results over a number of pages.limitResultsByStatus
- By default, relationships in all statuses are returned. However, it is possible to specify a list of statuses (eg ACTIVE) to restrict the results to. Null means all status values.asOfTime
- Requests a historical query of the relationships for the entity. Null means return the present values.sequencingProperty
- String name of the property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).sequencingOrder
- Enum defining how the results should be ordered.pageSize
- the maximum number of result relationships that can be returned on this request. Zero means unrestricted return results size.- Returns:
- a list of relationships. Null means no matching relationships.
- Throws:
InvalidParameterException
- one of the parameters is invalid or null.TypeErrorException
- the type guid passed on the request is not known by the metadata collection.RepositoryErrorException
- there is a problem communicating with the metadata repository where the metadata collection is stored.PropertyErrorException
- there is a problem with one of the other parameters.PagingErrorException
- the paging/sequencing parameters are set up incorrectly.FunctionNotSupportedException
- the repository does not support one of the provided parameters.UserNotAuthorizedException
- the userId is not permitted to perform this operation.
-
recordCompletionStatus
public void recordCompletionStatus(CompletionStatus status, List<String> outputGuards, Map<String, String> newRequestParameters, List<NewActionTarget> newActionTargets, String completionMessage) throws PropertyServerExceptionDeclare that all the processing for the archive service is finished and the status of the work.- Specified by:
recordCompletionStatus
in classRepositoryGovernanceContext
- Parameters:
status
- completion status enum valueoutputGuards
- optional guard strings for triggering subsequent action(s)newRequestParameters
- additional request parameters. These override/augment any request parameters defined for the next invoked servicenewActionTargets
- list of action target names to GUIDs for the resulting archive servicecompletionMessage
- message to describe completion results or reasons for failure- Throws:
PropertyServerException
- there is a problem connecting to the metadata store
-
getCompletionStatus
Return any completion status from the archive service.- Specified by:
getCompletionStatus
in classRepositoryGovernanceContext
- Returns:
- completion status enum
-
toString
Standard toString method.- Overrides:
toString
in classRepositoryGovernanceContext
- Returns:
- print out of variables in a JSON-style
-