Class AssetManagerClient

  • Direct Known Subclasses:
    HostManagerClient

    public abstract class AssetManagerClient
    extends Object
    AssetManagerClient supports the APIs to maintain assets and their related objects. It is called from the specific clients that manage the specializations of asset.
    • Constructor Detail

      • AssetManagerClient

        public AssetManagerClient​(String serverName,
                                  String serverPlatformURLRoot,
                                  ITInfrastructureRESTClient restClient,
                                  int maxPageSize)
                           throws InvalidParameterException
        Create a new client that is going to be used in an OMAG Server.
        Parameters:
        serverName - name of the server to connect to
        serverPlatformURLRoot - the network address of the server running the OMAS REST servers
        restClient - client that issues the REST API calls
        maxPageSize - maximum number of results supported by this server
        Throws:
        InvalidParameterException - there is a problem creating the client-side components to issue any REST API calls.
    • Method Detail

      • createAsset

        public String createAsset​(String userId,
                                  String infrastructureManagerGUID,
                                  String infrastructureManagerName,
                                  boolean infrastructureManagerIsHome,
                                  AssetProperties assetProperties)
                           throws InvalidParameterException,
                                  UserNotAuthorizedException,
                                  PropertyServerException
        Create a new metadata element to represent a asset.
        Parameters:
        userId - calling user
        infrastructureManagerGUID - unique identifier of software server capability representing the infrastructure manager
        infrastructureManagerName - unique name of software server capability representing the infrastructure manager
        infrastructureManagerIsHome - should the asset be marked as owned by the infrastructure manager so others can not update?
        assetProperties - properties to store
        Returns:
        unique identifier of the new metadata element
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • createAssetFromTemplate

        public String createAssetFromTemplate​(String userId,
                                              String infrastructureManagerGUID,
                                              String infrastructureManagerName,
                                              boolean infrastructureManagerIsHome,
                                              String templateGUID,
                                              TemplateProperties templateProperties)
                                       throws InvalidParameterException,
                                              UserNotAuthorizedException,
                                              PropertyServerException
        Create a new metadata element to represent a asset using an existing metadata element as a template.
        Parameters:
        userId - calling user
        infrastructureManagerGUID - unique identifier of software server capability representing the infrastructure manager
        infrastructureManagerName - unique name of software server capability representing the infrastructure manager
        infrastructureManagerIsHome - should the asset be marked as owned by the infrastructure manager so others can not update?
        templateGUID - unique identifier of the metadata element to copy
        templateProperties - properties that override the template
        Returns:
        unique identifier of the new metadata element
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • updateAsset

        public void updateAsset​(String userId,
                                String infrastructureManagerGUID,
                                String infrastructureManagerName,
                                String assetGUID,
                                boolean isMergeUpdate,
                                AssetProperties assetProperties)
                         throws InvalidParameterException,
                                UserNotAuthorizedException,
                                PropertyServerException
        Update the metadata element representing a asset.
        Parameters:
        userId - calling user
        infrastructureManagerGUID - unique identifier of software server capability representing the infrastructure manager
        infrastructureManagerName - unique name of software server capability representing the infrastructure manager
        assetGUID - unique identifier of the metadata element to update
        isMergeUpdate - are unspecified properties unchanged (true) or removed?
        assetProperties - new properties for this element
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • setupRelatedAsset

        public void setupRelatedAsset​(String userId,
                                      String infrastructureManagerGUID,
                                      String infrastructureManagerName,
                                      String assetGUID,
                                      String relationshipTypeName,
                                      String relatedAssetGUID,
                                      Map<String,​Object> relationshipProperties)
                               throws InvalidParameterException,
                                      UserNotAuthorizedException,
                                      PropertyServerException
        Create a relationship between a asset and a asseted asset.
        Parameters:
        userId - calling user
        infrastructureManagerGUID - unique identifier of software server capability representing the infrastructure manager
        infrastructureManagerName - unique name of software server capability representing the infrastructure manager
        assetGUID - unique identifier of the asset
        relationshipTypeName - name of the relationship type
        relatedAssetGUID - unique identifier of the related asset
        relationshipProperties - properties
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • clearRelatedAsset

        public void clearRelatedAsset​(String userId,
                                      String infrastructureManagerGUID,
                                      String infrastructureManagerName,
                                      String assetGUID,
                                      String relationshipTypeName,
                                      String relatedAssetGUID)
                               throws InvalidParameterException,
                                      UserNotAuthorizedException,
                                      PropertyServerException
        Remove a relationship between a asset and a related asset.
        Parameters:
        userId - calling user
        infrastructureManagerGUID - unique identifier of software server capability representing the infrastructure manager
        infrastructureManagerName - unique name of software server capability representing the infrastructure manager
        assetGUID - unique identifier of the asset
        relationshipTypeName - name of the relationship type
        relatedAssetGUID - unique identifier of the related asset
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • getAssetsForInfrastructureManager

        public List<AssetElement> getAssetsForInfrastructureManager​(String userId,
                                                                    String infrastructureManagerGUID,
                                                                    String infrastructureManagerName,
                                                                    String assetTypeName,
                                                                    Date effectiveTime,
                                                                    int startFrom,
                                                                    int pageSize)
                                                             throws InvalidParameterException,
                                                                    UserNotAuthorizedException,
                                                                    PropertyServerException
        Retrieve the list of assets created by this caller.
        Parameters:
        userId - calling user
        infrastructureManagerGUID - unique identifier of software server capability representing the infrastructure manager
        infrastructureManagerName - unique name of software server capability representing the infrastructure manager
        assetTypeName - name of type for the asset
        effectiveTime - effective time for the query
        startFrom - paging start point
        pageSize - maximum results that can be returned
        Returns:
        list of matching metadata elements
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • getRelatedAssets

        public List<AssetElement> getRelatedAssets​(String userId,
                                                   String assetGUID,
                                                   int startingEnd,
                                                   String relationshipTypeName,
                                                   Date effectiveTime,
                                                   int startFrom,
                                                   int pageSize)
                                            throws InvalidParameterException,
                                                   UserNotAuthorizedException,
                                                   PropertyServerException
        Return the list of assets linked by another asset.
        Parameters:
        userId - calling user
        assetGUID - unique identifier of the asset to start with
        startingEnd - which end of the relationship to start at 0=either end; 1=end1 and 2=end 2
        relationshipTypeName - name of type for the relationship
        effectiveTime - effective time for the query
        startFrom - paging start point
        pageSize - maximum results that can be returned
        Returns:
        list of matching metadata elements
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)