Class RepositoryHandler


  • public class RepositoryHandler
    extends Object
    RepositoryHandler issues common calls to the open metadata repository to retrieve and store metadata. It converts the repository service exceptions into access service exceptions.
    • Constructor Detail

      • RepositoryHandler

        public RepositoryHandler​(AuditLog auditLog,
                                 RepositoryErrorHandler errorHandler,
                                 OMRSMetadataCollection metadataCollection,
                                 int maxPageSize)
        Construct the basic handler with information needed to call the repository services and report any error.
        Parameters:
        auditLog - logging destination
        errorHandler - generates error messages and exceptions
        metadataCollection - access to the repository content.
        maxPageSize - maximum number of instances that can be returned on a single call
    • Method Detail

      • createEntity

        public String createEntity​(String userId,
                                   String entityTypeGUID,
                                   String entityTypeName,
                                   String externalSourceGUID,
                                   String externalSourceName,
                                   InstanceProperties properties,
                                   List<Classification> initialClassifications,
                                   String methodName)
                            throws UserNotAuthorizedException,
                                   PropertyServerException
        Create a new entity in the open metadata repository with the ACTIVE instance status.
        Parameters:
        userId - calling user
        entityTypeGUID - type of entity to create
        entityTypeName - name of the entity's type
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        properties - properties for the entity
        initialClassifications - list of classifications to attach to the entity
        methodName - name of calling method
        Returns:
        unique identifier of new entity
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • createEntity

        public String createEntity​(String userId,
                                   String entityTypeGUID,
                                   String entityTypeName,
                                   String externalSourceGUID,
                                   String externalSourceName,
                                   InstanceProperties properties,
                                   String methodName)
                            throws UserNotAuthorizedException,
                                   PropertyServerException
        Create a new entity in the open metadata repository with the ACTIVE instance status.
        Parameters:
        userId - calling user
        entityTypeGUID - type of entity to create
        entityTypeName - name of the entity's type
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        properties - properties for the entity
        methodName - name of calling method
        Returns:
        unique identifier of new entity
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • createEntity

        public String createEntity​(String userId,
                                   String entityTypeGUID,
                                   String entityTypeName,
                                   String externalSourceGUID,
                                   String externalSourceName,
                                   InstanceProperties properties,
                                   InstanceStatus instanceStatus,
                                   String methodName)
                            throws UserNotAuthorizedException,
                                   PropertyServerException
        Create a new entity in the open metadata repository with the specified instance status. The setting of externalSourceGUID determines whether a local or a remote entity is created.
        Parameters:
        userId - calling user
        entityTypeGUID - type of entity to create
        entityTypeName - name of the entity's type
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        properties - properties for the entity
        instanceStatus - initial status (needs to be valid for type)
        methodName - name of calling method
        Returns:
        unique identifier of new entity
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • createEntity

        public String createEntity​(String userId,
                                   String entityTypeGUID,
                                   String entityTypeName,
                                   String externalSourceGUID,
                                   String externalSourceName,
                                   InstanceProperties properties,
                                   List<Classification> initialClassifications,
                                   InstanceStatus instanceStatus,
                                   String methodName)
                            throws UserNotAuthorizedException,
                                   PropertyServerException
        Create a new entity in the open metadata repository with the specified instance status. The setting of externalSourceGUID determines whether a local or a remote entity is created.
        Parameters:
        userId - calling user
        entityTypeGUID - type of entity to create
        entityTypeName - name of the entity's type
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        properties - properties for the entity
        initialClassifications - list of classifications for the first version of this entity.
        instanceStatus - initial status (needs to be valid for type)
        methodName - name of calling method
        Returns:
        unique identifier of new entity
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • addUniqueAttachedEntityToElement

        public String addUniqueAttachedEntityToElement​(String userId,
                                                       String externalSourceGUID,
                                                       String externalSourceName,
                                                       String startingEntityGUID,
                                                       String startingEntityTypeName,
                                                       String startingRelationshipTypeGUID,
                                                       String startingRelationshipTypeName,
                                                       InstanceProperties startingRelationshipProperties,
                                                       String attachedEntityTypeGUID,
                                                       String attachedEntityTypeName,
                                                       InstanceProperties attachedEntityProperties,
                                                       String methodName)
                                                throws InvalidParameterException,
                                                       UserNotAuthorizedException,
                                                       PropertyServerException
        Remove an entity attached to an starting. There should be only one instance of this relationship.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        startingEntityGUID - unique identifier of the starting entity
        startingEntityTypeName - name of starting entity's type
        startingRelationshipTypeGUID - unique identifier for the relationship's type
        startingRelationshipTypeName - unique name for the relationship's type
        startingRelationshipProperties - properties from relationship
        attachedEntityTypeGUID - unique identifier for the attached entity's type
        attachedEntityTypeName - name of the attached entity's type
        attachedEntityProperties - properties of entity
        methodName - name of calling method
        Returns:
        attached entity GUID
        Throws:
        InvalidParameterException - the entity guid is not known
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem accessing the property server
      • updateSelectedEntityClassifications

        public void updateSelectedEntityClassifications​(String userId,
                                                        String externalSourceGUID,
                                                        String externalSourceName,
                                                        String entityGUID,
                                                        String entityTypeGUID,
                                                        String entityTypeName,
                                                        List<Classification> newClassifications,
                                                        String methodName)
                                                 throws InvalidParameterException,
                                                        UserNotAuthorizedException,
                                                        PropertyServerException
        Update just the specific list of classifications on an existing entity in the open metadata repository.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        entityGUID - unique identifier of entity to update
        entityTypeGUID - type of entity to create
        entityTypeName - name of the entity's type
        newClassifications - classifications for the entity
        methodName - name of calling method
        Throws:
        InvalidParameterException - problem with the GUID
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • updateEntityProperties

        public void updateEntityProperties​(String userId,
                                           String externalSourceGUID,
                                           String externalSourceName,
                                           InstanceHeader entityHeader,
                                           String entityTypeGUID,
                                           String entityTypeName,
                                           InstanceProperties properties,
                                           String methodName)
                                    throws UserNotAuthorizedException,
                                           PropertyServerException
        Update an existing entity in the open metadata repository. The external source identifiers are used to validate the provenance of the entity before the update. If they are null, only local cohort entities can be updated. If they are not null, they need to match the instances metadata collection identifiers.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        entityHeader - unique identifier of entity to update
        entityTypeGUID - type of entity to create
        entityTypeName - name of the entity's type
        properties - properties for the entity
        methodName - name of calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • updateEntityStatus

        public void updateEntityStatus​(String userId,
                                       String externalSourceGUID,
                                       String externalSourceName,
                                       String entityGUID,
                                       String entityTypeGUID,
                                       String entityTypeName,
                                       InstanceStatus instanceStatus,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Update an existing entity status in the open metadata repository. The external source identifiers are used to validate the provenance of the entity before the update. If they are null, only local cohort entities can be updated. If they are not null, they need to match the instances metadata collection identifiers.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        entityGUID - unique identifier of entity to update
        entityTypeGUID - type of entity to create
        entityTypeName - name of the entity's type
        instanceStatus - initial status (needs to be valid for type)
        methodName - name of calling method
        Throws:
        InvalidParameterException - problem with the GUID
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • updateEntity

        @Deprecated
        public EntityDetail updateEntity​(String userId,
                                         String entityGUID,
                                         String entityTypeGUID,
                                         String entityTypeName,
                                         InstanceProperties properties,
                                         String methodName)
                                  throws UserNotAuthorizedException,
                                         PropertyServerException
        Deprecated.
        Update the properties of an existing entity in the open metadata repository. This method is deprecated because it does not pass the external source identifiers and so the metadata provenance can not be verified.
        Parameters:
        userId - calling user
        entityGUID - unique identifier of entity to update
        entityTypeGUID - type of entity to create
        entityTypeName - name of the entity's type
        properties - properties for the entity
        methodName - name of calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • classifyEntity

        public EntityDetail classifyEntity​(String userId,
                                           String externalSourceGUID,
                                           String externalSourceName,
                                           String entityGUID,
                                           String classificationTypeGUID,
                                           String classificationTypeName,
                                           ClassificationOrigin classificationOrigin,
                                           String classificationOriginGUID,
                                           InstanceProperties properties,
                                           String methodName)
                                    throws UserNotAuthorizedException,
                                           PropertyServerException
        Add a new classification to an existing entity in the open metadata repository.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        entityGUID - unique identifier of entity to update
        classificationTypeGUID - type of classification to create
        classificationTypeName - name of the classification's type
        classificationOrigin - is this classification assigned or propagated?
        classificationOriginGUID - which entity did a propagated classification originate from?
        properties - properties for the classification
        methodName - name of calling method
        Returns:
        updated entity
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • reclassifyEntity

        public void reclassifyEntity​(String userId,
                                     String externalSourceGUID,
                                     String externalSourceName,
                                     String entityGUID,
                                     String classificationTypeGUID,
                                     String classificationTypeName,
                                     InstanceAuditHeader existingClassificationHeader,
                                     InstanceProperties newProperties,
                                     String methodName)
                              throws InvalidParameterException,
                                     UserNotAuthorizedException,
                                     PropertyServerException
        Update the properties of an existing classification to an existing entity in the open metadata repository.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        entityGUID - unique identifier of entity to update
        classificationTypeGUID - type of classification to create
        classificationTypeName - name of the classification's type
        existingClassificationHeader - current value of classification
        newProperties - properties for the classification
        methodName - name of calling method
        Throws:
        InvalidParameterException - invalid parameters passed - probably GUID
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • declassifyEntity

        public void declassifyEntity​(String userId,
                                     String externalSourceGUID,
                                     String externalSourceName,
                                     String entityGUID,
                                     String classificationTypeGUID,
                                     String classificationTypeName,
                                     InstanceAuditHeader existingClassificationHeader,
                                     String methodName)
                              throws InvalidParameterException,
                                     UserNotAuthorizedException,
                                     PropertyServerException
        Remove an existing classification from an existing entity in the open metadata repository.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        entityGUID - unique identifier of entity to update
        classificationTypeGUID - type of classification to create
        classificationTypeName - name of the classification's type
        existingClassificationHeader - current value of classification
        methodName - name of calling method
        Throws:
        InvalidParameterException - one of the parameters is invalid = probably the GUID
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • removeEntity

        public void removeEntity​(String userId,
                                 String externalSourceGUID,
                                 String externalSourceName,
                                 String obsoleteEntityGUID,
                                 String obsoleteEntityGUIDParameterName,
                                 String entityTypeGUID,
                                 String entityTypeName,
                                 String validatingPropertyName,
                                 String validatingProperty,
                                 String methodName)
                          throws InvalidParameterException,
                                 UserNotAuthorizedException,
                                 PropertyServerException
        Remove an entity from the open metadata repository if the validating properties match. The external source identifiers are used to validate the provenance of the entity before the update. If they are null, only local cohort entities can be updated. If they are not null, they need to match the instances metadata collection identifiers.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        obsoleteEntityGUID - unique identifier of the entity
        obsoleteEntityGUIDParameterName - name for unique identifier of the entity
        entityTypeGUID - type of entity to delete
        entityTypeName - name of the entity's type
        validatingPropertyName - name of property that should be in the entity if we have the correct one.
        validatingProperty - value of property that should be in the entity if we have the correct one.
        methodName - name of calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
        InvalidParameterException - mismatch on properties
      • removeEntityOnLastUse

        public void removeEntityOnLastUse​(String userId,
                                          String externalSourceGUID,
                                          String externalSourceName,
                                          String obsoleteEntityGUID,
                                          String guidParameterName,
                                          String entityTypeGUID,
                                          String entityTypeName,
                                          String methodName)
                                   throws InvalidParameterException,
                                          UserNotAuthorizedException,
                                          PropertyServerException
        Remove an entity from the repository if it is no longer connected to any other entity.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        obsoleteEntityGUID - unique identifier of the entity
        guidParameterName - name of parameter that passed the entity guid
        entityTypeGUID - unique identifier for the entity's type
        entityTypeName - name of the entity's type
        methodName - name of calling method
        Throws:
        InvalidParameterException - the entity guid is not known
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem accessing the property server
      • removeIsolatedEntity

        @Deprecated
        public void removeIsolatedEntity​(String userId,
                                         String obsoleteEntityGUID,
                                         String entityTypeGUID,
                                         String entityTypeName,
                                         String methodName)
                                  throws UserNotAuthorizedException,
                                         PropertyServerException
        Deprecated.
        Remove an entity from the open metadata repository after checking that is is not connected to anything else. The repository handler helps to ensure that all relationships are deleted explicitly ensuring the events are created and making it easier for third party repositories to keep track of changes rather than have to implement the implied deletes from the logical graph.
        Parameters:
        userId - calling user
        obsoleteEntityGUID - unique identifier of the entity
        entityTypeGUID - type of entity to delete
        entityTypeName - name of the entity's type
        methodName - name of calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • restoreEntity

        public void restoreEntity​(String userId,
                                  String externalSourceGUID,
                                  String externalSourceName,
                                  String deletedEntityGUID,
                                  String methodName)
                           throws UserNotAuthorizedException,
                                  PropertyServerException
        Restore the requested entity to the state it was before it was deleted.
        Parameters:
        userId - unique identifier for requesting user.
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        deletedEntityGUID - String unique identifier (guid) for the entity.
        methodName - name of calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • getEntitiesForType

        public List<EntityDetail> getEntitiesForType​(String userId,
                                                     String entityTypeGUID,
                                                     String entityTypeName,
                                                     int startingFrom,
                                                     int pageSize,
                                                     String methodName)
                                              throws UserNotAuthorizedException,
                                                     PropertyServerException
        Return the list of entities of the requested type.
        Parameters:
        userId - user making the request
        entityTypeGUID - identifier for the entity's type
        entityTypeName - name for the entity's type
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - name of calling method
        Returns:
        retrieved entities or null
        Throws:
        PropertyServerException - problem accessing the property server
        UserNotAuthorizedException - security access problem
      • getEntitiesForRelationshipType

        public List<EntityDetail> getEntitiesForRelationshipType​(String userId,
                                                                 String startingEntityGUID,
                                                                 String startingEntityTypeName,
                                                                 String relationshipTypeGUID,
                                                                 String relationshipTypeName,
                                                                 int startingFrom,
                                                                 int pageSize,
                                                                 String methodName)
                                                          throws UserNotAuthorizedException,
                                                                 PropertyServerException
        Return the list of entities at the other end of the requested relationship type.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - name of calling method
        Returns:
        retrieved entities or null
        Throws:
        PropertyServerException - problem accessing the property server
        UserNotAuthorizedException - security access problem
      • getEntitiesForRelationshipType

        public List<EntityDetail> getEntitiesForRelationshipType​(String userId,
                                                                 String startingEntityGUID,
                                                                 String startingEntityTypeName,
                                                                 String relationshipTypeGUID,
                                                                 String relationshipTypeName,
                                                                 String sequencingPropertyName,
                                                                 int startingFrom,
                                                                 int pageSize,
                                                                 String methodName)
                                                          throws UserNotAuthorizedException,
                                                                 PropertyServerException
        Return the list of entities at the other end of the requested relationship type.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        sequencingPropertyName - name of property used to sequence the results - null means no sequencing
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - name of calling method
        Returns:
        retrieved entities or null
        Throws:
        PropertyServerException - problem accessing the property server
        UserNotAuthorizedException - security access problem
      • getEntitiesForClassificationType

        public List<EntityDetail> getEntitiesForClassificationType​(String userId,
                                                                   String entityEntityTypeGUID,
                                                                   String classificationName,
                                                                   int startingFrom,
                                                                   int pageSize,
                                                                   String methodName)
                                                            throws UserNotAuthorizedException,
                                                                   PropertyServerException
        Return the list of entities by the requested classification type.
        Parameters:
        userId - user making the request
        entityEntityTypeGUID - starting entity's GUID
        classificationName - type name for the classification to follow
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - name of calling method
        Returns:
        retrieved entities or null
        Throws:
        PropertyServerException - problem accessing the property server
        UserNotAuthorizedException - security access problem
      • getEntitiesForRelationshipEnd

        public List<EntityDetail> getEntitiesForRelationshipEnd​(String userId,
                                                                String anchorEntityGUID,
                                                                String anchorEntityTypeName,
                                                                boolean anchorAtEnd1,
                                                                String relationshipTypeGUID,
                                                                String relationshipTypeName,
                                                                int startingFrom,
                                                                int pageSize,
                                                                String methodName)
                                                         throws UserNotAuthorizedException,
                                                                PropertyServerException
        Return the list of entities at the requested end of the requested relationship type.
        Parameters:
        userId - user making the request
        anchorEntityGUID - starting entity's GUID
        anchorEntityTypeName - starting entity's type name
        anchorAtEnd1 - indicates that the match of the anchor entity must be at end 1 (otherwise it is at end two)
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - name of calling method
        Returns:
        retrieved entities or null
        Throws:
        PropertyServerException - problem accessing the property server
        UserNotAuthorizedException - security access problem
      • getAttachedEntityFromUser

        public EntityDetail getAttachedEntityFromUser​(String userId,
                                                      String startingEntityGUID,
                                                      String startingEntityTypeName,
                                                      String relationshipTypeGUID,
                                                      String relationshipTypeName,
                                                      String attachedEntityTypeGUID,
                                                      String attachedEntityTypeName,
                                                      String methodName)
                                               throws InvalidParameterException,
                                                      UserNotAuthorizedException,
                                                      PropertyServerException
        Return the list of entities at the other end of the requested relationship type that were created or edited by the requesting user.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        attachedEntityTypeGUID - identifier for the relationship to follow
        attachedEntityTypeName - type name for the relationship to follow
        methodName - name of calling method
        Returns:
        retrieved entities or null
        Throws:
        InvalidParameterException - the entity at the other end is not of the expected type
        PropertyServerException - problem accessing the property server
        UserNotAuthorizedException - security access problem
      • getAttachedEntitiesFromUser

        public List<EntityDetail> getAttachedEntitiesFromUser​(String userId,
                                                              String startingEntityGUID,
                                                              String startingEntityTypeName,
                                                              String relationshipTypeGUID,
                                                              String relationshipTypeName,
                                                              String attachedEntityTypeGUID,
                                                              String attachedEntityTypeName,
                                                              String sequencingPropertyName,
                                                              int startingFrom,
                                                              int pageSize,
                                                              String methodName)
                                                       throws InvalidParameterException,
                                                              UserNotAuthorizedException,
                                                              PropertyServerException
        Return the list of entities at the other end of the requested relationship type that were created or edited by the requesting user.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        attachedEntityTypeGUID - identifier for the relationship to follow
        attachedEntityTypeName - type name for the relationship to follow
        sequencingPropertyName - name of property used to sequence the results - needed for paging
        startingFrom - initial position in the stored list
        pageSize - maximum number of definitions to return on this call.
        methodName - name of calling method
        Returns:
        retrieved entities or null
        Throws:
        PropertyServerException - problem accessing the property server
        UserNotAuthorizedException - security access problem
        InvalidParameterException - one of the parameters is in error
      • getRelatedEntityProxies

        public List<EntityProxy> getRelatedEntityProxies​(String userId,
                                                         String startingEntityGUID,
                                                         String startingEntityTypeName,
                                                         String relationshipTypeGUID,
                                                         String relationshipTypeName,
                                                         int startingFrom,
                                                         int pageSize,
                                                         String methodName)
                                                  throws InvalidParameterException,
                                                         UserNotAuthorizedException,
                                                         PropertyServerException
        Return the list of entity proxies for the entities at the far end of the relationships linked to the starting entity.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - calling method
        Returns:
        list of entity proxies
        Throws:
        InvalidParameterException - the starting entity is not of the expected type
        PropertyServerException - problem accessing the property server
        UserNotAuthorizedException - security access problem
      • getOtherEnd

        public EntityProxy getOtherEnd​(String startingEntityGUID,
                                       Relationship relationship)
        Return the entity proxy for the related entity.
        Parameters:
        startingEntityGUID - unique identifier of the starting entity
        relationship - relationship to another entity
        Returns:
        proxy to the other entity.
      • getOtherEnd

        public EntityProxy getOtherEnd​(String startingEntityGUID,
                                       String startingEntityTypeName,
                                       Relationship relationship,
                                       String methodName)
                                throws InvalidParameterException
        Return the entity proxy for the related entity.
        Parameters:
        startingEntityGUID - unique identifier of the starting entity
        startingEntityTypeName - type of the entity
        relationship - relationship to another entity
        methodName - calling method
        Returns:
        proxy to the other entity.
        Throws:
        InvalidParameterException - the type of the starting entity is incorrect
      • getEntityForRelationshipType

        public EntityDetail getEntityForRelationshipType​(String userId,
                                                         String startingEntityGUID,
                                                         String startingEntityTypeName,
                                                         String relationshipTypeGUID,
                                                         String relationshipTypeName,
                                                         String methodName)
                                                  throws UserNotAuthorizedException,
                                                         PropertyServerException
        Return the entity at the other end of the requested relationship type. The assumption is that this is a 0..1 relationship so one entity (or null) is returned. If lots of relationships are found then the PropertyServerException is thrown.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        methodName - name of calling method
        Returns:
        retrieved entity or null
        Throws:
        PropertyServerException - problem accessing the property server
        UserNotAuthorizedException - security access problem
      • getEntitiesByName

        public List<EntityDetail> getEntitiesByName​(String userId,
                                                    InstanceProperties nameProperties,
                                                    String entityTypeGUID,
                                                    String sequencingPropertyName,
                                                    int startingFrom,
                                                    int pageSize,
                                                    String methodName)
                                             throws UserNotAuthorizedException,
                                                    PropertyServerException
        Return the requested entity by name. The sequencing property name ensure that all elements are returned in the same order to ensure none are lost in the paging process.
        Parameters:
        userId - calling userId
        nameProperties - list of name properties to search on
        entityTypeGUID - unique identifier of the entity's type
        sequencingPropertyName - property name used to sequence the results
        startingFrom - initial position in the stored list
        pageSize - maximum number of definitions to return on this call
        methodName - calling method
        Returns:
        list of returned entities
        Throws:
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem retrieving the entity.
      • getEntitiesByAllProperties

        public List<EntityDetail> getEntitiesByAllProperties​(String userId,
                                                             InstanceProperties properties,
                                                             String entityTypeGUID,
                                                             String sequencingPropertyName,
                                                             int startingFrom,
                                                             int pageSize,
                                                             String methodName)
                                                      throws UserNotAuthorizedException,
                                                             PropertyServerException
        Return the entities that match all supplied properties.
        Parameters:
        userId - calling userId
        properties - list of name properties to search on.
        entityTypeGUID - unique identifier of the entity's type
        sequencingPropertyName - property name used to sequence the results
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - calling method
        Returns:
        list of returned entities
        Throws:
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem retrieving the entity.
      • getEntitiesWithoutPropertyValues

        public List<EntityDetail> getEntitiesWithoutPropertyValues​(String userId,
                                                                   InstanceProperties properties,
                                                                   String entityTypeGUID,
                                                                   String sequencingPropertyName,
                                                                   int startingFrom,
                                                                   int pageSize,
                                                                   String methodName)
                                                            throws UserNotAuthorizedException,
                                                                   PropertyServerException
        Return the entities that match all supplied properties.
        Parameters:
        userId - calling userId
        properties - list of name properties to search on.
        entityTypeGUID - unique identifier of the entity's type
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - calling method
        Returns:
        list of returned entities
        Throws:
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem retrieving the entity.
      • getEntitiesByValue

        public List<EntityDetail> getEntitiesByValue​(String userId,
                                                     String propertyValue,
                                                     String entityTypeGUID,
                                                     String sequencingPropertyName,
                                                     int startingFrom,
                                                     int pageSize,
                                                     String methodName)
                                              throws UserNotAuthorizedException,
                                                     PropertyServerException
        Return the entities that match all supplied properties. The sequencing order is important if the caller is paging to ensure that all of the results are returned.
        Parameters:
        userId - calling userId
        propertyValue - string value to search on - may be a RegEx
        entityTypeGUID - unique identifier of the entity's type
        startingFrom - initial position in the stored list
        sequencingPropertyName - name of property used to sequence the results - null means no sequencing
        pageSize - maximum number of definitions to return on this call
        methodName - calling method
        Returns:
        list of returned entities
        Throws:
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem retrieving the entity.
      • getEntitiesByPropertyValue

        public List<EntityDetail> getEntitiesByPropertyValue​(String userId,
                                                             String entityTypeGUID,
                                                             String searchCriteria,
                                                             int startingFrom,
                                                             int pageSize,
                                                             Date asOfTime,
                                                             String sequencingProperty,
                                                             SequencingOrder sequencingOrder,
                                                             String methodName)
                                                      throws UserNotAuthorizedException,
                                                             PropertyServerException
        Return the entities that match all supplied properties.
        Parameters:
        userId - calling user
        entityTypeGUID - unique identifier of the entity's type
        searchCriteria - String Java regular expression used to match against any of the String property values within entity instances of the specified type(s). This parameter must not be null.
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        asOfTime - Requests a historical query of the entity. Null means return the present values.
        sequencingOrder - Enum defining how the results should be ordered.
        methodName - calling method
        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).
        methodName - calling method
        Returns:
        list of returned entities
        Throws:
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem retrieving the entity.
      • getEntitiesByType

        public List<EntityDetail> getEntitiesByType​(String userId,
                                                    String entityTypeGUID,
                                                    int startingFrom,
                                                    int pageSize,
                                                    String methodName)
                                             throws UserNotAuthorizedException,
                                                    PropertyServerException
        Return the requested entities that match the requested type.
        Parameters:
        userId - calling userId
        entityTypeGUID - type of entity required
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - calling method
        Returns:
        list of returned entities
        Throws:
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem retrieving the entity.
      • getEntitiesByType

        public List<EntityDetail> getEntitiesByType​(String userId,
                                                    String entityTypeGUID,
                                                    int startingFrom,
                                                    int pageSize,
                                                    Date asOfTime,
                                                    String sequencingProperty,
                                                    SequencingOrder sequencingOrder,
                                                    String methodName)
                                             throws UserNotAuthorizedException,
                                                    PropertyServerException
        Return the requested entities that match the requested type.
        Parameters:
        userId - calling userId
        entityTypeGUID - type of entity required
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        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.
        methodName - calling method
        Returns:
        list of returned entities
        Throws:
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem retrieving the entity.
      • findEntities

        public List<EntityDetail> findEntities​(String userId,
                                               String entityTypeGUID,
                                               List<String> entitySubtypeGUIDs,
                                               SearchProperties searchProperties,
                                               List<InstanceStatus> limitResultsByStatus,
                                               SearchClassifications searchClassifications,
                                               Date asOfTime,
                                               String sequencingProperty,
                                               SequencingOrder sequencingOrder,
                                               int startingFrom,
                                               int pageSize,
                                               String methodName)
                                        throws UserNotAuthorizedException,
                                               PropertyServerException
        Return a list of entities that match the supplied criteria. The results can be returned over many pages.
        Parameters:
        userId - unique identifier for requesting user.
        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.
        searchProperties - Optional list of entity property conditions to match.
        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.
        searchClassifications - 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.
        startingFrom - 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.
        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:
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem retrieving the entity.
      • findRelationships

        public List<Relationship> findRelationships​(String userId,
                                                    String relationshipTypeGUID,
                                                    List<String> relationshipSubtypeGUIDs,
                                                    SearchProperties searchProperties,
                                                    List<InstanceStatus> limitResultsByStatus,
                                                    Date asOfTime,
                                                    String sequencingProperty,
                                                    SequencingOrder sequencingOrder,
                                                    int startingFrom,
                                                    int pageSize,
                                                    String methodName)
                                             throws UserNotAuthorizedException,
                                                    PropertyServerException
        Return a list of relationships that match the requested conditions. The results can be received as a series of pages.
        Parameters:
        userId - unique identifier for requesting user.
        relationshipTypeGUID - String unique identifier for the entity type of interest (null means any entity type).
        relationshipSubtypeGUIDs - optional list of the unique identifiers (guids) for subtypes of the relationshipTypeGUID to include in the search results. Null means all subtypes.
        searchProperties - Optional list of entity property conditions to match.
        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.
        startingFrom - 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.
        pageSize - the maximum number of result entities that can be returned on this request. Zero means unrestricted return results size.
        Returns:
        a list of relationships. Null means no matching relationships.
        Throws:
        UserNotAuthorizedException - user not authorized to issue this request.
        PropertyServerException - problem retrieving the entity.
      • getRelationshipsByType

        public List<Relationship> getRelationshipsByType​(String userId,
                                                         String startingEntityGUID,
                                                         String startingEntityTypeName,
                                                         String relationshipTypeGUID,
                                                         String relationshipTypeName,
                                                         String methodName)
                                                  throws UserNotAuthorizedException,
                                                         PropertyServerException
        Return the list of relationships of the requested type connected to the starting entity. The list is expected to be small.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        methodName - name of calling method
        Returns:
        retrieved relationships or null
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - problem accessing the property server
      • getRelationshipsByType

        public List<Relationship> getRelationshipsByType​(String userId,
                                                         String startingEntityGUID,
                                                         String startingEntityTypeName,
                                                         String relationshipTypeGUID,
                                                         String relationshipTypeName,
                                                         int startingFrom,
                                                         int pageSize,
                                                         String methodName)
                                                  throws UserNotAuthorizedException,
                                                         PropertyServerException
        Return the list of relationships of the requested type connected to the starting entity. The list is expected to be small.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - name of calling method
        Returns:
        retrieved relationships or null
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - problem accessing the property server
      • getRelationshipsByType

        public List<Relationship> getRelationshipsByType​(String userId,
                                                         String startingEntityGUID,
                                                         String relationshipTypeGUID,
                                                         List<InstanceStatus> limitResultsByStatus,
                                                         Date asOfTime,
                                                         String sequencingProperty,
                                                         SequencingOrder sequencingOrder,
                                                         int startingFrom,
                                                         int pageSize,
                                                         String methodName)
                                                  throws UserNotAuthorizedException,
                                                         PropertyServerException
        Return the list of relationships of the requested type connected to the starting entity. The list is expected to be small.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        relationshipTypeGUID - identifier for the relationship to follow
        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.
        startingFrom - initial position in the stored list.
        pageSize - maximum number of definitions to return on this call.
        methodName - name of calling method
        Returns:
        retrieved relationships or null
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - problem accessing the property server
      • getRequiredRelationshipsByType

        public List<Relationship> getRequiredRelationshipsByType​(String userId,
                                                                 String anchorEntityGUID,
                                                                 String anchorEntityTypeName,
                                                                 String relationshipTypeGUID,
                                                                 String relationshipTypeName,
                                                                 String methodName)
                                                          throws UserNotAuthorizedException,
                                                                 PropertyServerException
        Return the list of relationships of the requested type connected to the anchor entity. No relationships found results in an exception.
        Parameters:
        userId - user making the request
        anchorEntityGUID - starting entity's GUID
        anchorEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        methodName - name of calling method
        Returns:
        retrieved relationships or null
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - problem accessing the property server
      • getRequiredRelationshipsByType

        public List<Relationship> getRequiredRelationshipsByType​(String userId,
                                                                 String anchorEntityGUID,
                                                                 String anchorEntityTypeName,
                                                                 String relationshipTypeGUID,
                                                                 String relationshipTypeName,
                                                                 int startingFrom,
                                                                 List<InstanceStatus> limitResultsByStatus,
                                                                 Date asOfTime,
                                                                 String sequencingProperty,
                                                                 SequencingOrder sequencingOrder,
                                                                 int pageSize,
                                                                 String methodName)
                                                          throws UserNotAuthorizedException,
                                                                 PropertyServerException
        Return the list of relationships of the requested type connected to the anchor entity. No relationships found results in an exception.
        Parameters:
        userId - user making the request
        anchorEntityGUID - starting entity's GUID
        anchorEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        methodName - name of calling method
        Returns:
        retrieved relationships or null
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - problem accessing the property server
      • countAttachedRelationshipsByType

        public int countAttachedRelationshipsByType​(String userId,
                                                    String startingEntityGUID,
                                                    String startingEntityTypeName,
                                                    String relationshipTypeGUID,
                                                    String relationshipTypeName,
                                                    String methodName)
                                             throws PropertyServerException,
                                                    UserNotAuthorizedException
        Count the number of relationships of a specific type attached to an starting entity.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        methodName - name of calling method
        Returns:
        count of the number of relationships
        Throws:
        UserNotAuthorizedException - user not authorized to issue this request
        PropertyServerException - problem accessing the property server
      • getPagedRelationshipsByType

        public List<Relationship> getPagedRelationshipsByType​(String userId,
                                                              String startingEntityGUID,
                                                              String startingEntityTypeName,
                                                              String relationshipTypeGUID,
                                                              String relationshipTypeName,
                                                              int startingFrom,
                                                              int maximumResults,
                                                              String methodName)
                                                       throws UserNotAuthorizedException,
                                                              PropertyServerException
        Return the list of relationships of the requested type connected to the starting entity. If there are no relationships null is returned
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        startingFrom - results starting point
        maximumResults - page size
        methodName - name of calling method
        Returns:
        retrieved relationships or null
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - problem accessing the property server
      • getUniqueParentRelationshipByType

        public Relationship getUniqueParentRelationshipByType​(String userId,
                                                              String startingEntityGUID,
                                                              String startingEntityTypeName,
                                                              String relationshipTypeGUID,
                                                              String relationshipTypeName,
                                                              boolean parentAtEnd1,
                                                              String methodName)
                                                       throws UserNotAuthorizedException,
                                                              PropertyServerException
        Return the relationship of the requested type connected to the starting entity and where the starting entity is the logical child. The assumption is that this is a 0..1 relationship so the first matching relationship is returned (or null if there is none).
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        parentAtEnd1 - boolean flag to indicate which end has the parent element
        methodName - name of calling method
        Returns:
        retrieved relationship or null
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - problem accessing the property server
      • getUniqueRelationshipByType

        public Relationship getUniqueRelationshipByType​(String userId,
                                                        String startingEntityGUID,
                                                        String startingEntityTypeName,
                                                        String relationshipTypeGUID,
                                                        String relationshipTypeName,
                                                        String methodName)
                                                 throws UserNotAuthorizedException,
                                                        PropertyServerException
        Return the relationship of the requested type connected to the starting entity. The assumption is that this is a 0..1 relationship so one relationship (or null) is returned. If lots of relationships are found then the PropertyServerException is thrown.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        methodName - name of calling method
        Returns:
        retrieved relationship or null
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - problem accessing the property server
      • getUniqueRelationshipByType

        public Relationship getUniqueRelationshipByType​(String userId,
                                                        String startingEntityGUID,
                                                        String startingEntityTypeName,
                                                        boolean startAtEnd1,
                                                        String relationshipTypeGUID,
                                                        String relationshipTypeName,
                                                        String methodName)
                                                 throws UserNotAuthorizedException,
                                                        PropertyServerException
        Return the list of relationships of the requested type connected to the starting entity where the starting entity is at the end indicated by the startAtEnd1 boolean parameter. The assumption is that this is a 0..1 relationship so one relationship (or null) is returned. If lots of relationships are found then the PropertyServerException is thrown.
        Parameters:
        userId - user making the request
        startingEntityGUID - starting entity's GUID
        startingEntityTypeName - starting entity's type name
        startAtEnd1 - is the starting entity at end 1 of the relationship
        relationshipTypeGUID - identifier for the relationship to follow
        relationshipTypeName - type name for the relationship to follow
        methodName - name of calling method
        Returns:
        retrieved relationship or null
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - problem accessing the property server
      • createRelationship

        public Relationship createRelationship​(String userId,
                                               String relationshipTypeGUID,
                                               String externalSourceGUID,
                                               String externalSourceName,
                                               String end1GUID,
                                               String end2GUID,
                                               InstanceProperties relationshipProperties,
                                               String methodName)
                                        throws UserNotAuthorizedException,
                                               PropertyServerException
        Create a relationship between two entities. The value of external source GUID determines if it is local or remote.
        Parameters:
        userId - calling user
        relationshipTypeGUID - unique identifier of the relationship's type
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        end1GUID - entity to store at end 1
        end2GUID - entity to store at end 2
        relationshipProperties - properties for the relationship
        methodName - name of calling method
        Returns:
        Relationship structure with the new header, requested entities and properties or null.
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • ensureRelationship

        public void ensureRelationship​(String userId,
                                       String end1TypeName,
                                       String externalSourceGUID,
                                       String externalSourceName,
                                       String end1GUID,
                                       String end2GUID,
                                       String relationshipTypeGUID,
                                       String relationshipTypeName,
                                       InstanceProperties relationshipProperties,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Ensure a relationship exists between two entities. The setting of external source GUID determines if the relationship is external or not
        Parameters:
        userId - calling user
        end1TypeName - unique name of the end 1's type
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        end1GUID - entity to store at end 1
        end2GUID - entity to store at end 2
        relationshipTypeGUID - unique identifier of the relationship's type
        relationshipTypeName - unique name of the relationship's type
        relationshipProperties - properties for the relationship
        methodName - name of calling method
        Throws:
        InvalidParameterException - type of end 1 is not correct
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • createExternalRelationship

        public void createExternalRelationship​(String userId,
                                               String relationshipTypeGUID,
                                               String externalSourceGUID,
                                               String externalSourceName,
                                               String end1GUID,
                                               String end2GUID,
                                               InstanceProperties relationshipProperties,
                                               String methodName)
                                        throws UserNotAuthorizedException,
                                               PropertyServerException
        Create a relationship from an external source between two entities.
        Parameters:
        userId - calling user
        relationshipTypeGUID - unique identifier of the relationship's type
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        end1GUID - entity to store at end 1
        end2GUID - entity to store at end 2
        relationshipProperties - properties for the relationship
        methodName - name of calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • removeRelationship

        @Deprecated
        public void removeRelationship​(String userId,
                                       String relationshipTypeGUID,
                                       String relationshipTypeName,
                                       String relationshipGUID,
                                       String methodName)
                                throws UserNotAuthorizedException,
                                       PropertyServerException
        Deprecated.
        Delete a relationship between two entities. If delete is not supported, purge is used. This method is deprecated because it is not possible to verify the metadata provenance of the relationship being deleted.
        Parameters:
        userId - calling user
        relationshipTypeGUID - unique identifier of the type of relationship to delete
        relationshipTypeName - name of the type of relationship to delete
        relationshipGUID - unique identifier of the relationship to delete
        methodName - name of calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • removeRelationship

        public void removeRelationship​(String userId,
                                       String externalSourceGUID,
                                       String externalSourceName,
                                       String relationshipTypeName,
                                       String relationshipGUID,
                                       String methodName)
                                throws UserNotAuthorizedException,
                                       PropertyServerException
        Delete a relationship between two entities. If delete is not supported, purge is used. The external source identifiers are used to validate the provenance of the entity before the update. If they are null, only local cohort entities can be updated. If they are not null, they need to match the instances metadata collection identifiers.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        relationshipTypeName - name of the type of relationship to delete
        relationshipGUID - unique identifier of the relationship to delete
        methodName - name of calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • removeRelationship

        public void removeRelationship​(String userId,
                                       String externalSourceGUID,
                                       String externalSourceName,
                                       Relationship relationship,
                                       String methodName)
                                throws UserNotAuthorizedException,
                                       PropertyServerException
        Delete a relationship between two entities. If delete is not supported, purge is used. The external source identifiers are used to validate the provenance of the entity before the update. If they are null, only local cohort entities can be updated. If they are not null, they need to match the instances metadata collection identifiers.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        relationship - relationship to delete
        methodName - name of calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • purgeRelationship

        public void purgeRelationship​(String userId,
                                      String relationshipTypeGUID,
                                      String relationshipTypeName,
                                      String relationshipGUID,
                                      String methodName)
                               throws UserNotAuthorizedException,
                                      PropertyServerException
        Purge a relationship between two entities. Used if delete fails.
        Parameters:
        userId - calling user
        relationshipTypeGUID - unique identifier of the type of relationship to delete
        relationshipTypeName - name of the type of relationship to delete
        relationshipGUID - unique identifier of the relationship to delete
        methodName - name of calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • removeAllRelationshipsOfType

        public void removeAllRelationshipsOfType​(String userId,
                                                 String externalSourceGUID,
                                                 String externalSourceName,
                                                 String startingEntityGUID,
                                                 String startingEntityTypeName,
                                                 String relationshipTypeGUID,
                                                 String relationshipTypeName,
                                                 String methodName)
                                          throws UserNotAuthorizedException,
                                                 PropertyServerException
        Remove all relationships of a certain type starting at a particular entity.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        startingEntityGUID - identifier of starting entity
        startingEntityTypeName - type of entity
        relationshipTypeGUID - unique identifier of the relationship type
        relationshipTypeName - unique name of the relationship type
        methodName - calling method
        Throws:
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • removeRelationshipBetweenEntities

        public void removeRelationshipBetweenEntities​(String userId,
                                                      String externalSourceGUID,
                                                      String externalSourceName,
                                                      String relationshipTypeGUID,
                                                      String relationshipTypeName,
                                                      String entity1GUID,
                                                      String entity1TypeName,
                                                      String entity2GUID,
                                                      String methodName)
                                               throws UserNotAuthorizedException,
                                                      PropertyServerException,
                                                      InvalidParameterException
        Delete a relationship between two specific entities. The relationship must have compatible provenance to allow the update to proceed.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        relationshipTypeGUID - unique identifier of the type of relationship to delete
        relationshipTypeName - name of the type of relationship to delete
        entity1GUID - unique identifier of the entity at end 1 of the relationship to delete
        entity1TypeName - type name of the entity at end 1 of the relationship to delete
        entity2GUID - unique identifier of the entity at end 1 of the relationship to delete
        methodName - name of calling method
        Throws:
        InvalidParameterException - type of entity 1 is not correct
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • updateRelationshipProperties

        public void updateRelationshipProperties​(String userId,
                                                 String externalSourceGUID,
                                                 String externalSourceName,
                                                 Relationship relationship,
                                                 InstanceProperties relationshipProperties,
                                                 String methodName)
                                          throws UserNotAuthorizedException,
                                                 PropertyServerException
        Update the properties in the requested relationship.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        relationship - relationship to update.
        relationshipProperties - new properties for relationship
        methodName - name of calling method.
        Throws:
        PropertyServerException - there is a problem communicating with the repository.
        UserNotAuthorizedException - security access problem
      • updateRelationshipProperties

        @Deprecated
        public void updateRelationshipProperties​(String userId,
                                                 String relationshipGUID,
                                                 InstanceProperties relationshipProperties,
                                                 String methodName)
                                          throws UserNotAuthorizedException,
                                                 PropertyServerException
        Deprecated.
        Update the properties in the requested relationship. This method is deprecated because it is not possible to verify the metadata provenance of the relationship.
        Parameters:
        userId - calling user
        relationshipGUID - unique identifier of the relationship.
        relationshipProperties - new properties for relationship
        methodName - name of calling method.
        Throws:
        PropertyServerException - there is a problem communicating with the repository.
        UserNotAuthorizedException - security access problem
      • updateRelationshipProperties

        public void updateRelationshipProperties​(String userId,
                                                 String externalSourceGUID,
                                                 String externalSourceName,
                                                 String relationshipGUID,
                                                 InstanceProperties relationshipProperties,
                                                 String methodName)
                                          throws UserNotAuthorizedException,
                                                 PropertyServerException
        Update the properties in the requested relationship.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        relationshipGUID - unique identifier of the relationship.
        relationshipProperties - new properties for relationship
        methodName - name of calling method.
        Throws:
        PropertyServerException - there is a problem communicating with the repository.
        UserNotAuthorizedException - security access problem
      • updateRelationshipStatus

        public void updateRelationshipStatus​(String userId,
                                             String externalSourceGUID,
                                             String externalSourceName,
                                             String relationshipGUID,
                                             String relationshipParameterName,
                                             String relationshipTypeName,
                                             InstanceStatus instanceStatus,
                                             String methodName)
                                      throws UserNotAuthorizedException,
                                             PropertyServerException
        Update the status in the requested relationship.
        Parameters:
        userId - calling user
        relationshipGUID - unique identifier of the relationship.
        relationshipParameterName - parameter name supplying relationshipGUID
        relationshipTypeName - type name for the relationship
        instanceStatus - new InstanceStatus for the entity.
        methodName - name of calling method.
        Throws:
        PropertyServerException - there is a problem communicating with the repository.
        UserNotAuthorizedException - security access problem
      • updateUniqueRelationshipByType

        public void updateUniqueRelationshipByType​(String userId,
                                                   String externalSourceGUID,
                                                   String externalSourceName,
                                                   String end1GUID,
                                                   String end1TypeName,
                                                   String end2GUID,
                                                   String end2TypeName,
                                                   String relationshipTypeGUID,
                                                   String relationshipTypeName,
                                                   String methodName)
                                            throws UserNotAuthorizedException,
                                                   PropertyServerException
        Ensure that the unique relationship between two entities is established. It is possible that there is already a relationship of this type between either of the entities and another and so that needs to be removed first.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source.
        externalSourceName - unique name for the external source.
        end1GUID - unique identifier of the entity for end 1 of the relationship.
        end1TypeName - type of the entity for end 1
        end2GUID - unique identifier of the entity for end 2 of the relationship.
        end2TypeName - type of the entity for end 2
        relationshipTypeGUID - unique identifier of the type of relationship to create.
        relationshipTypeName - name of the type of relationship to create.
        methodName - name of calling method.
        Throws:
        PropertyServerException - there is a problem communicating with the repository.
        UserNotAuthorizedException - security access problem
      • removeUniqueRelationshipByType

        public void removeUniqueRelationshipByType​(String userId,
                                                   String externalSourceGUID,
                                                   String externalSourceName,
                                                   String entityGUID,
                                                   String entityTypeName,
                                                   String relationshipTypeGUID,
                                                   String relationshipTypeName,
                                                   String methodName)
                                            throws UserNotAuthorizedException,
                                                   PropertyServerException
        Remove the relationship connected to the supplied entity. Due to the definition of the relationship, only one is expected.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier (guid) for the external source, or null for local.
        externalSourceName - unique name for the external source.
        entityGUID - unique identity of the starting entity.
        entityTypeName - type name of entity
        relationshipTypeGUID - unique identifier of the relationship's type
        relationshipTypeName - name of the relationship's type
        methodName - calling method
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - there is a problem communicating with the repository.
      • getEntityNeighborhood

        public InstanceGraph getEntityNeighborhood​(String userId,
                                                   String entityGUID,
                                                   List<String> entityTypeGUIDs,
                                                   List<String> relationshipTypeGUIDs,
                                                   List<InstanceStatus> limitResultsByStatus,
                                                   List<String> limitResultsByClassification,
                                                   Date asOfTime,
                                                   int level,
                                                   String methodName)
                                            throws UserNotAuthorizedException,
                                                   PropertyServerException
        Return the entities and relationships that radiate out from the supplied entity GUID. The results are scoped both the instance type guids and the level.
        Parameters:
        userId - unique identifier for requesting user.
        entityGUID - the starting point of the query.
        entityTypeGUIDs - list of entity types to include in the query results. Null means include all entities found, irrespective of their type.
        relationshipTypeGUIDs - list of relationship types to include in the query results. Null means include all relationships found, irrespective of their type.
        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.
        limitResultsByClassification - List of classifications that must be present on all returned entities.
        asOfTime - Requests a historical query of the relationships for the entity. Null means return the present values.
        level - the number of the relationships out from the starting entity that the query will traverse to gather results.
        methodName - name of calling method.
        Returns:
        InstanceGraph the sub-graph that represents the returned linked entities and their relationships or null.
        Throws:
        UserNotAuthorizedException - security access problem
        PropertyServerException - problem accessing the property server
      • getMetadataCollection

        public OMRSMetadataCollection getMetadataCollection()
        Return the metadata collection for the repository. This is used by services that need function that is not supported by this class.
        Returns:
        metadata collection for the repository