Class AssetManagerClient
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.itinfrastructure.client.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 Summary
Constructors Constructor Description AssetManagerClient(String serverName, String serverPlatformURLRoot, ITInfrastructureRESTClient restClient, int maxPageSize)Create a new client that is going to be used in an OMAG Server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearRelatedAsset(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String assetGUID, String relationshipTypeName, String relatedAssetGUID)Remove a relationship between a asset and a related asset.StringcreateAsset(String userId, String infrastructureManagerGUID, String infrastructureManagerName, boolean infrastructureManagerIsHome, AssetProperties assetProperties)Create a new metadata element to represent a asset.StringcreateAssetFromTemplate(String userId, String infrastructureManagerGUID, String infrastructureManagerName, boolean infrastructureManagerIsHome, String templateGUID, TemplateProperties templateProperties)Create a new metadata element to represent a asset using an existing metadata element as a template.List<AssetElement>findAssets(String userId, String searchString, String assetTypeName, Date effectiveTime, int startFrom, int pageSize)Retrieve the list of asset metadata elements that contain the search string.AssetElementgetAssetByGUID(String userId, String assetTypeName, String guid)Retrieve the asset metadata element with the supplied unique identifier.List<AssetElement>getAssetsByName(String userId, String name, String assetTypeName, Date effectiveTime, int startFrom, int pageSize)Retrieve the list of asset metadata elements with a matching qualified or display name.List<AssetElement>getAssetsForInfrastructureManager(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String assetTypeName, Date effectiveTime, int startFrom, int pageSize)Retrieve the list of assets created by this caller.List<AssetElement>getRelatedAssets(String userId, String assetGUID, int startingEnd, String relationshipTypeName, Date effectiveTime, int startFrom, int pageSize)Return the list of assets linked by another asset.voidpublishAsset(String userId, String assetGUID)Update the zones for the asset asset so that it becomes visible to consumers.voidremoveAsset(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String assetGUID)Remove the metadata element representing a asset.voidsetupRelatedAsset(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String assetGUID, String relationshipTypeName, String relatedAssetGUID, Map<String,Object> relationshipProperties)Create a relationship between a asset and a asseted asset.voidupdateAsset(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String assetGUID, boolean isMergeUpdate, AssetProperties assetProperties)Update the metadata element representing a asset.voidwithdrawAsset(String userId, String assetGUID)Update the zones for the asset asset so that it is no longer visible to consumers.
-
-
-
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 toserverPlatformURLRoot- the network address of the server running the OMAS REST serversrestClient- client that issues the REST API callsmaxPageSize- 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 userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerinfrastructureManagerIsHome- 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 invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- 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 userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerinfrastructureManagerIsHome- should the asset be marked as owned by the infrastructure manager so others can not update?templateGUID- unique identifier of the metadata element to copytemplateProperties- properties that override the template- Returns:
- unique identifier of the new metadata element
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- 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 userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerassetGUID- unique identifier of the metadata element to updateisMergeUpdate- are unspecified properties unchanged (true) or removed?assetProperties- new properties for this element- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- 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 userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerassetGUID- unique identifier of the assetrelationshipTypeName- name of the relationship typerelatedAssetGUID- unique identifier of the related assetrelationshipProperties- properties- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- 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 userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerassetGUID- unique identifier of the assetrelationshipTypeName- name of the relationship typerelatedAssetGUID- unique identifier of the related asset- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
publishAsset
public void publishAsset(String userId, String assetGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the zones for the asset asset so that it becomes visible to consumers. (The zones are set to the list of zones in the publishedZones option configured for each instance of the IT Infrastructure OMAS).- Parameters:
userId- calling userassetGUID- unique identifier of the metadata element to publish- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
withdrawAsset
public void withdrawAsset(String userId, String assetGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the zones for the asset asset so that it is no longer visible to consumers. (The zones are set to the list of zones in the defaultZones option configured for each instance of the IT Infrastructure OMAS. This is the setting when the asset is first created).- Parameters:
userId- calling userassetGUID- unique identifier of the metadata element to withdraw- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
removeAsset
public void removeAsset(String userId, String infrastructureManagerGUID, String infrastructureManagerName, String assetGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the metadata element representing a asset.- Parameters:
userId- calling userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerassetGUID- unique identifier of the metadata element to remove- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
findAssets
public List<AssetElement> findAssets(String userId, String searchString, String assetTypeName, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of asset metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
userId- calling usersearchString- string to find in the propertiesassetTypeName- name of type for the asseteffectiveTime- effective time for the querystartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getAssetsByName
public List<AssetElement> getAssetsByName(String userId, String name, String assetTypeName, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of asset metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Parameters:
userId- calling username- name to search forassetTypeName- name of type for the asseteffectiveTime- effective time for the querystartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- 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 userinfrastructureManagerGUID- unique identifier of software server capability representing the infrastructure managerinfrastructureManagerName- unique name of software server capability representing the infrastructure managerassetTypeName- name of type for the asseteffectiveTime- effective time for the querystartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getAssetByGUID
public AssetElement getAssetByGUID(String userId, String assetTypeName, String guid) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the asset metadata element with the supplied unique identifier.- Parameters:
userId- calling userassetTypeName- name of type for the assetguid- unique identifier of the requested metadata element- Returns:
- matching metadata element
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- 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 userassetGUID- unique identifier of the asset to start withstartingEnd- which end of the relationship to start at 0=either end; 1=end1 and 2=end 2relationshipTypeName- name of type for the relationshipeffectiveTime- effective time for the querystartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
-