public class AssetConsumer extends Object implements AssetConsumerAssetInterface, AssetConsumerConnectorFactoryInterface, AssetConsumerFeedbackInterface, AssetConsumerGlossaryInterface, AssetConsumerLoggingInterface, AssetConsumerTaggingInterface
| Constructor and Description |
|---|
AssetConsumer(String serverName,
String newServerURL)
Create a new client with no authentication embedded in the HTTP request.
|
AssetConsumer(String serverName,
String omasServerURL,
String userId,
String password)
Create a new client that passes userId and password in each HTTP request.
|
| Modifier and Type | Method and Description |
|---|---|
String |
addCommentReply(String userId,
String commentGUID,
CommentType commentType,
String commentText)
Adds a comment to another comment.
|
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 about the asset.
|
String |
addReviewToAsset(String userId,
String assetGUID,
StarRating starRating,
String review)
Adds a star rating and optional review text to the asset.
|
void |
addTagToAsset(String userId,
String assetGUID,
String tagGUID)
Adds a tag (either private of public) to an asset.
|
String |
createPrivateTag(String userId,
String tagName,
String tagDescription)
Creates a new private informal tag and returns the unique identifier for it.
|
String |
createPublicTag(String userId,
String tagName,
String tagDescription)
Creates a new public informal tag and returns the unique identifier for it.
|
void |
deleteTag(String userId,
String tagGUID)
Removes a tag from the repository.
|
String |
getAssetForConnection(String userId,
String connectionGUID)
Returns the unique identifier for the asset connected to the requested connection.
|
String |
getAssetForConnectionName(String userId,
String connectionName)
Returns the asset corresponding to the supplied connection name.
|
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.
|
GlossaryTerm |
getMeaning(String userId,
String guid)
Return the full definition (meaning) of a term using the unique identifier of the glossary term
that contains the definition.
|
List<GlossaryTerm> |
getMeaningByName(String userId,
String term,
int startFrom,
int pageSize)
Return the full definition (meaning) of the terms matching the supplied name.
|
Tag |
getTag(String userId,
String guid)
Return the tag for the supplied unique identifier (guid).
|
List<Tag> |
getTagsByName(String userId,
String tag,
int startFrom,
int pageSize)
Return the list of tags matching the supplied name.
|
void |
removeCommentFromAsset(String userId,
String commentGUID)
Removes a comment added to the asset by this user.
|
void |
removeLikeFromAsset(String userId,
String likeGUID)
Removes a "Like" added to the asset by this user.
|
void |
removeReviewFromAsset(String userId,
String reviewGUID)
Removes of a review that was added to the asset by this user.
|
void |
removeTagFromAsset(String userId,
String assetGUID,
String tagGUID)
Removes a tag from the asset that was added by this user.
|
void |
updateComment(String userId,
String commentGUID,
CommentType commentType,
String commentText)
Update an existing comment.
|
void |
updateReviewOnAsset(String userId,
String reviewGUID,
StarRating starRating,
String review)
Updates the rating and optional review text attached to the asset by this user.
|
void |
updateTagDescription(String userId,
String tagGUID,
String tagDescription)
Updates the description of an existing tag (either private of public).
|
public AssetConsumer(String serverName, String newServerURL)
serverName - name of the server to connect tonewServerURL - the network address of the server running the OMAS REST serverspublic AssetConsumer(String serverName, String omasServerURL, String userId, String password)
serverName - name of the server to connect toomasServerURL - the network address of the server running the OMAS REST serversuserId - caller's userId embedded in all HTTP requestspassword - caller's userId embedded in all HTTP requestspublic String getAssetForConnection(String userId, String connectionGUID) throws InvalidParameterException, NoConnectedAssetException, PropertyServerException, UserNotAuthorizedException
getAssetForConnection in interface AssetConsumerAssetInterfaceuserId - the userId of the requesting user.connectionGUID - unique identifier for the connection.InvalidParameterException - one of the parameters is null or invalid.PropertyServerException - there is a problem retrieving information from the property server.NoConnectedAssetException - there is no asset associated with this connection.UserNotAuthorizedException - the requesting user is not authorized to issue this request.public String getAssetForConnectionName(String userId, String connectionName) throws InvalidParameterException, AmbiguousConnectionNameException, NoConnectedAssetException, PropertyServerException, UserNotAuthorizedException
getAssetForConnectionName in interface AssetConsumerAssetInterfaceuserId - 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.AmbiguousConnectionNameException - there is more than one connection defined for this name.NoConnectedAssetException - there is no asset associated with this connection.PropertyServerException - there is a problem retrieving information from 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 AssetConsumerAssetInterfaceuserId - userId of user making request.assetGUID - unique identifier 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 Connector getConnectorByName(String userId, String connectionName) throws InvalidParameterException, AmbiguousConnectionNameException, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException, UserNotAuthorizedException
getConnectorByName in interface AssetConsumerConnectorFactoryInterfaceuserId - 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.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, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException, UserNotAuthorizedException
getConnectorByGUID in interface AssetConsumerConnectorFactoryInterfaceuserId - 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.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 AssetConsumerConnectorFactoryInterfaceuserId - 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 String addReviewToAsset(String userId, String assetGUID, StarRating starRating, String review) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addReviewToAsset in interface AssetConsumerFeedbackInterfaceuserId - userId of user making request.assetGUID - unique identifier for the asset.starRating - StarRating enumeration for not recommended, one to five stars.review - user review of asset. This can be null.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 updateReviewOnAsset(String userId, String reviewGUID, StarRating starRating, String review) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
updateReviewOnAsset in interface AssetConsumerFeedbackInterfaceuserId - userId of user making request.reviewGUID - unique identifier for the review.starRating - StarRating enumeration for none, one to five stars.review - user review of asset. This can be null.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 removeReviewFromAsset(String userId, String reviewGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
removeReviewFromAsset in interface AssetConsumerFeedbackInterfaceuserId - userId of user making request.reviewGUID - unique identifier 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 String addLikeToAsset(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addLikeToAsset in interface AssetConsumerFeedbackInterfaceuserId - userId of user making request.assetGUID - unique identifier 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 void removeLikeFromAsset(String userId, String likeGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
removeLikeFromAsset in interface AssetConsumerFeedbackInterfaceuserId - userId of user making request.likeGUID - unique identifier 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 String addCommentToAsset(String userId, String assetGUID, CommentType commentType, String commentText) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addCommentToAsset in interface AssetConsumerFeedbackInterfaceuserId - userId of user making request.assetGUID - unique identifier 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 AssetConsumerFeedbackInterfaceuserId - userId of user making request.commentGUID - unique identifier 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 updateComment(String userId, String commentGUID, CommentType commentType, String commentText) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
updateComment in interface AssetConsumerFeedbackInterfaceuserId - userId of user making request.commentGUID - unique identifier for the comment to change.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 removeCommentFromAsset(String userId, String commentGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
removeCommentFromAsset in interface AssetConsumerFeedbackInterfaceuserId - userId of user making request.commentGUID - unique identifier 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.public GlossaryTerm getMeaning(String userId, String guid) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
getMeaning in interface AssetConsumerGlossaryInterfaceuserId - userId of the user making the request.guid - unique identifier of the glossary term.InvalidParameterException - the userId is null or 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<GlossaryTerm> getMeaningByName(String userId, String term, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
getMeaningByName in interface AssetConsumerGlossaryInterfaceuserId - the name of the calling user.term - name of term. This may include wild card characters.startFrom - index of the list ot start from (0 for start)pageSize - maximum number of elements to return.InvalidParameterException - the userId is null or 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 addLogMessageToAsset(String userId, String assetGUID, String connectorInstanceId, String connectionName, String connectorType, String contextId, String message) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addLogMessageToAsset in interface AssetConsumerLoggingInterfaceuserId - 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 createPublicTag(String userId, String tagName, String tagDescription) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
createPublicTag in interface AssetConsumerTaggingInterfaceuserId - userId of user making request.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 createPrivateTag(String userId, String tagName, String tagDescription) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
createPrivateTag in interface AssetConsumerTaggingInterfaceuserId - userId of user making request.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 void updateTagDescription(String userId, String tagGUID, String tagDescription) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
updateTagDescription in interface AssetConsumerTaggingInterfaceuserId - userId of user making request.tagGUID - unique identifier for the tag.tagDescription - 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 void deleteTag(String userId, String tagGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
deleteTag in interface AssetConsumerTaggingInterfaceuserId - 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 Tag getTag(String userId, String guid) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
getTag in interface AssetConsumerTaggingInterfaceuserId - userId of the user making the request.guid - unique identifier of the tag.InvalidParameterException - the userId is null or 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<Tag> getTagsByName(String userId, String tag, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
getTagsByName in interface AssetConsumerTaggingInterfaceuserId - the name of the calling user.tag - name of tag. This may include wild card characters.startFrom - index of the list ot start from (0 for start)pageSize - maximum number of elements to return.InvalidParameterException - the userId is null or 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 addTagToAsset(String userId, String assetGUID, String tagGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
addTagToAsset in interface AssetConsumerTaggingInterfaceuserId - userId of user making request.assetGUID - unique id for the asset.tagGUID - unique id 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 void removeTagFromAsset(String userId, String assetGUID, String tagGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
removeTagFromAsset in interface AssetConsumerTaggingInterfaceuserId - userId of user making request.assetGUID - unique id for the asset.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.Copyright © 2018–2019 ODPi. All rights reserved.