public class AssetConsumer extends Object implements AssetConsumerInterface
| Constructor and Description |
|---|
AssetConsumer(String newServerURL)
Create a new AssetConsumer client.
|
| Modifier and Type | Method and Description |
|---|---|
String |
addCommentReply(String userId,
String commentGUID,
CommentType commentType,
String commentText)
Adds a comment to the asset.
|
String |
addCommentToAsset(String userId,
String assetGUID,
CommentType commentType,
String commentText)
Adds a comment to the asset.
|
String |
addLikeToAsset(String userId,
String assetGUID)
Adds a "Like" to the asset.
|
void |
addLogMessageToAsset(String userId,
String assetGUID,
String connectorInstanceId,
String connectionName,
String connectorType,
String contextId,
String message)
Creates an Audit log record for the asset.
|
String |
addPrivateTagToAsset(String userId,
String assetGUID,
String tagName,
String tagDescription)
Adds a new private tag to the asset's properties.
|
String |
addRatingToAsset(String userId,
String assetGUID,
StarRating starRating,
String review)
Adds a rating to the asset.
|
String |
addTagToAsset(String userId,
String assetGUID,
String tagName,
String tagDescription)
Adds a new public tag to the asset's properties.
|
void |
addToMyAssets(String userId,
String assetGUID)
Add an asset to the identified user's list of favorite assets.
|
void |
addToMyAssets(String userId,
String assetCollectionGUID,
String assetGUID)
Add an asset to the identified user's list of favorite assets.
|
AssetCollection |
attachAssetCollection(String userId,
String assetCollectionGUID)
Connect an existing asset collection to this user's profile.
|
AssetCollection |
createAssetCollection(String userId,
String qualifiedName,
String displayName,
String description,
String collectionUse,
AssetCollectionOrder assetCollectionOrder,
Map<String,Object> additionalProperties)
Create a new asset collection.
|
AssetCollection |
getAssetCollection(String userId,
String assetCollectionGUID)
Return the properties of a specific asset collection,
|
String |
getAssetForConnection(String userId,
String connectionGUID)
Returns the unique identifier for the asset connected to the connection.
|
AssetUniverse |
getAssetProperties(String userId,
String assetGUID)
Returns a comprehensive collection of properties about the requested asset.
|
Connector |
getConnectorByConnection(String userId,
Connection connection)
Returns the connector corresponding to the supplied connection.
|
Connector |
getConnectorByGUID(String userId,
String connectionGUID)
Returns the connector corresponding to the supplied connection GUID.
|
Connector |
getConnectorByName(String userId,
String connectionName)
Returns the connector corresponding to the supplied connection name.
|
List<AssetCollection> |
getMyAssetCollections(String userId,
int startFrom,
int pageSize)
Returns the list of asset collections that this user has created or linked to their profile.
|
List<Asset> |
getMyAssets(String userId,
int startFrom,
int pageSize)
Return a list of assets that the specified user has added to their favorites list.
|
List<AssetCollectionMember> |
getMyAssets(String userId,
String assetCollectionGUID,
int startFrom,
int pageSize)
Return a list of assets that the specified user has added to their favorites list.
|
MyProfile |
getMyProfile(String userId)
Return the profile for this user.
|
void |
removeAssetCollection(String userId,
String assetCollectionGUID)
Delete an asset collection (the assets are not affected).
|
void |
removeComment(String userId,
String commentGUID)
Removes a comment added to the asset by this user.
|
void |
removeFromMyAssets(String userId,
String assetGUID)
Remove an asset from identified user's list of favorite assets.
|
void |
removeFromMyAssets(String userId,
String assetCollectionGUID,
String assetGUID)
Remove an asset from identified user's list of favorite assets.
|
void |
removeLike(String userId,
String likeGUID)
Removes a "Like" added to the asset by this user.
|
void |
removePrivateTag(String userId,
String tagGUID)
Removes a private tag from the asset that was added by this user.
|
void |
removeRating(String userId,
String ratingGUID)
Removes of a star rating that was added to the asset by this user.
|
void |
removeTag(String userId,
String tagGUID)
Removes a tag from the asset that was added by this user.
|
void |
updateMyProfile(String userId,
String employeeNumber,
String fullName,
String knownName,
String jobTitle,
String jobRoleDescription,
Map<String,Object> additionalProperties)
Create or update the profile for the requesting user.
|
public AssetConsumer(String newServerURL)
newServerURL - the network address of the server running the OMAS REST servicespublic Connector getConnectorByName(String userId, String connectionName) throws InvalidParameterException, UnrecognizedConnectionNameException, AmbiguousConnectionNameException, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException, UserNotAuthorizedException
getConnectorByName in interface AssetConsumerInterfaceuserId - userId of user making request.connectionName - this may be the qualifiedName or displayName of the connection.InvalidParameterException - one of the parameters is null or invalid.UnrecognizedConnectionNameException - there is no connection defined for this name.AmbiguousConnectionNameException - there is more than one connection defined for this name.ConnectionCheckedException - there are errors in the configuration of the connection which is preventing
the creation of a connector.ConnectorCheckedException - there are errors in the initialization of the connector.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public Connector getConnectorByGUID(String userId, String connectionGUID) throws InvalidParameterException, UnrecognizedConnectionGUIDException, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException, UserNotAuthorizedException
getConnectorByGUID in interface AssetConsumerInterfaceuserId - userId of user making request.connectionGUID - the unique id for the connection within the metadata repository.InvalidParameterException - one of the parameters is null or invalid.UnrecognizedConnectionGUIDException - the supplied GUID is not recognized by the property server.ConnectionCheckedException - there are errors in the configuration of the connection which is preventing
the creation of a connector.ConnectorCheckedException - there are errors in the initialization of the connector.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public Connector getConnectorByConnection(String userId, Connection connection) throws InvalidParameterException, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException
getConnectorByConnection in interface AssetConsumerInterfaceuserId - userId of user making request.connection - the connection object that contains the properties needed to create the connection.InvalidParameterException - one of the parameters is null or invalid.ConnectionCheckedException - there are errors in the configuration of the connection which is preventing
the creation of a connector.ConnectorCheckedException - there are errors in the initialization of the connector.PropertyServerException - there is a problem retrieving information from the property server(s).public MyProfile getMyProfile(String userId) throws InvalidParameterException, NoProfileForUserException, PropertyServerException, UserNotAuthorizedException
getMyProfile in interface AssetConsumerInterfaceuserId - userId of the user making the request.InvalidParameterException - the userId is null or invalid.NoProfileForUserException - the user does not have a profile.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void updateMyProfile(String userId, String employeeNumber, String fullName, String knownName, String jobTitle, String jobRoleDescription, Map<String,Object> additionalProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
updateMyProfile in interface AssetConsumerInterfaceuserId - the name of the calling user.employeeNumber - personnel/serial/unique employee number of the individual.fullName - full name of the person.knownName - known name or nickname of the individual.jobTitle - job title of the individual.jobRoleDescription - job description of the individual.additionalProperties - additional properties about the individual.InvalidParameterException - one of the parameters is invalid.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public List<AssetCollection> getMyAssetCollections(String userId, int startFrom, int pageSize) throws InvalidParameterException, NoProfileForUserException, PropertyServerException, UserNotAuthorizedException
getMyAssetCollections in interface AssetConsumerInterfaceuserId - userId of user making requeststartFrom - index of the list to start from (0 for start)pageSize - maximum number of elements to returnInvalidParameterException - one of the parameters is null or invalid.NoProfileForUserException - the user does not have a profile so can not have any asset collections.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public AssetCollection getAssetCollection(String userId, String assetCollectionGUID) throws InvalidParameterException, NoProfileForUserException, PropertyServerException, UserNotAuthorizedException
getAssetCollection in interface AssetConsumerInterfaceuserId - userId of user making request.assetCollectionGUID - unique identifier of the required connection.InvalidParameterException - one of the parameters is null or invalid.NoProfileForUserException - the user does not have a profile so can not have any asset collections.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public AssetCollection createAssetCollection(String userId, String qualifiedName, String displayName, String description, String collectionUse, AssetCollectionOrder assetCollectionOrder, Map<String,Object> additionalProperties) throws InvalidParameterException, NoProfileForUserException, PropertyServerException, UserNotAuthorizedException
createAssetCollection in interface AssetConsumerInterfaceuserId - userId of user making request.qualifiedName - unique name of the asset collection.displayName - short displayable name for the asset collection.description - description of the asset collection.collectionUse - description of how the asset consumer intends to use the collection.assetCollectionOrder - description of how the assets in the collection should be organized (null for no organization).additionalProperties - additional arbitrary properties.InvalidParameterException - one of the parameters is invalid.NoProfileForUserException - the user does not have a profile so can not have any asset collections.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public AssetCollection attachAssetCollection(String userId, String assetCollectionGUID) throws InvalidParameterException, NoProfileForUserException, PropertyServerException, UserNotAuthorizedException
attachAssetCollection in interface AssetConsumerInterfaceuserId - userId of user making request.assetCollectionGUID - unique identifier of the asset collection.InvalidParameterException - one of the parameters is null or invalid.NoProfileForUserException - the user does not have a profile so can not have any asset collections.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void removeAssetCollection(String userId, String assetCollectionGUID) throws InvalidParameterException, NoProfileForUserException, PropertyServerException, UserNotAuthorizedException
removeAssetCollection in interface AssetConsumerInterfaceuserId - userId of user making request.assetCollectionGUID - unique identifier of the asset collection.InvalidParameterException - one of the parameters is null or invalid.NoProfileForUserException - the user does not have a profile so can not have any asset collections.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public List<AssetCollectionMember> getMyAssets(String userId, String assetCollectionGUID, int startFrom, int pageSize) throws InvalidParameterException, NoProfileForUserException, PropertyServerException, UserNotAuthorizedException
getMyAssets in interface AssetConsumerInterfaceuserId - userId of user making request.assetCollectionGUID - unique identifier of the asset collection to use.startFrom - index of the list to start from (0 for start)pageSize - maximum number of elements to return.InvalidParameterException - one of the parameters is invalid.NoProfileForUserException - the user does not have a profile so can not have any asset collections.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void addToMyAssets(String userId, String assetCollectionGUID, String assetGUID) throws InvalidParameterException, NoProfileForUserException, NotAnAssetException, PropertyServerException, UserNotAuthorizedException
addToMyAssets in interface AssetConsumerInterfaceuserId - userId of user making request.assetCollectionGUID - unique identifier of the asset collection to use.assetGUID - unique identifier of the asset.InvalidParameterException - one of the parameters is invalid.NoProfileForUserException - the user does not have a profile so can not have any asset collections.NotAnAssetException - the guid is not recognized as an identifier for an asset.PropertyServerException - there is a problem updating information in the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void removeFromMyAssets(String userId, String assetCollectionGUID, String assetGUID) throws InvalidParameterException, NoProfileForUserException, PropertyServerException, UserNotAuthorizedException
removeFromMyAssets in interface AssetConsumerInterfaceuserId - userId of user making request.assetCollectionGUID - unique identifier of the asset collection to use.assetGUID - unique identifier of the asset.InvalidParameterException - one of the parameters is invalid.NoProfileForUserException - the user does not have a profile so can not have any asset collections.PropertyServerException - there is a problem updating information in the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public String getAssetForConnection(String userId, String connectionGUID) throws InvalidParameterException, UnrecognizedConnectionGUIDException, NoConnectedAssetException, PropertyServerException, UserNotAuthorizedException
getAssetForConnection in interface AssetConsumerInterfaceuserId - the userId of the requesting user.connectionGUID - uniqueId for the connection.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem retrieving the connected asset properties from the property server.UnrecognizedConnectionGUIDException - the supplied GUID is not recognized by the property server.NoConnectedAssetException - there is no asset associated with this connection.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public List<Asset> getMyAssets(String userId, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
userId - userId of user making request.startFrom - index of the list ot start from (0 for start)pageSize - maximum number of elements to return.InvalidParameterException - one of the parameters is invalid.PropertyServerException - there is a problem retrieving information from the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void addToMyAssets(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
userId - userId of user making request.assetGUID - unique identifier of the asset.InvalidParameterException - one of the parameters is invalid.PropertyServerException - there is a problem updating information in the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void removeFromMyAssets(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
userId - userId of user making request.assetGUID - unique identifier of the asset.InvalidParameterException - one of the parameters is invalid.PropertyServerException - there is a problem updating information in the property server(s).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public AssetUniverse getAssetProperties(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
getAssetProperties in interface AssetConsumerInterfaceuserId - userId of user making request.assetGUID - unique id for asset.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - There is a problem retrieving the asset properties from the property servers).UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void addLogMessageToAsset(String userId, String assetGUID, String connectorInstanceId, String connectionName, String connectorType, String contextId, String message) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addLogMessageToAsset in interface AssetConsumerInterfaceuserId - userId of user making request.assetGUID - unique id for the asset.connectorInstanceId - (optional) id of connector in use (if any).connectionName - (optional) name of the connection (extracted from the connector).connectorType - (optional) type of connector in use (if any).contextId - (optional) function name, or processId of the activity that the caller is performing.message - log record content.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - There is a problem adding the asset properties to the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public String addTagToAsset(String userId, String assetGUID, String tagName, String tagDescription) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addTagToAsset in interface AssetConsumerInterfaceuserId - userId of user making request.assetGUID - unique id for the asset.tagName - name of the tag.tagDescription - (optional) description of the tag. Setting a description, particularly in a public tag
makes the tag more valuable to other users and can act as an embryonic glossary term.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem adding the asset properties to the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public String addPrivateTagToAsset(String userId, String assetGUID, String tagName, String tagDescription) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addPrivateTagToAsset in interface AssetConsumerInterfaceuserId - userId of user making request.assetGUID - unique id for the asset.tagName - name of the tag.tagDescription - (optional) description of the tag.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem adding the asset properties to the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public String addRatingToAsset(String userId, String assetGUID, StarRating starRating, String review) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addRatingToAsset in interface AssetConsumerInterfaceuserId - userId of user making request.assetGUID - unique id for the asset.starRating - StarRating enumeration for none, one to five stars.review - user review of asset.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem adding the asset properties to the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public String addLikeToAsset(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addLikeToAsset in interface AssetConsumerInterfaceuserId - userId of user making request.assetGUID - unique id for the assetInvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem adding the asset properties to the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public String addCommentToAsset(String userId, String assetGUID, CommentType commentType, String commentText) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addCommentToAsset in interface AssetConsumerInterfaceuserId - userId of user making request.assetGUID - unique id for the asset.commentType - type of comment enum.commentText - the text of the comment.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem adding the asset properties to the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public String addCommentReply(String userId, String commentGUID, CommentType commentType, String commentText) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addCommentReply in interface AssetConsumerInterfaceuserId - userId of user making request.commentGUID - unique id for an existing comment. Used to add a reply to a comment.commentType - type of comment enum.commentText - the text of the comment.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem adding the asset properties to the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void removeTag(String userId, String tagGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
removeTag in interface AssetConsumerInterfaceuserId - userId of user making request.tagGUID - unique id for the tag.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem updating the asset properties in the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void removePrivateTag(String userId, String tagGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
removePrivateTag in interface AssetConsumerInterfaceuserId - userId of user making request.tagGUID - unique id for the tag.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem updating the asset properties in the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void removeRating(String userId, String ratingGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
removeRating in interface AssetConsumerInterfaceuserId - userId of user making request.ratingGUID - unique id for the rating object.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem updating the asset properties in the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void removeLike(String userId, String likeGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
removeLike in interface AssetConsumerInterfaceuserId - userId of user making request.likeGUID - unique id for the like object.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem updating the asset properties in the property server.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public void removeComment(String userId, String commentGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
removeComment in interface AssetConsumerInterfaceuserId - userId of user making request.commentGUID - unique id for the comment object.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem updating the asset properties in the property server.UserNotAuthorizedException - the user does not have permission to perform this request.Copyright © 2018 ODPi. All rights reserved.