Class ValidValuesExchangeClient
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.assetmanager.client.ExchangeClientBase
-
- org.odpi.openmetadata.accessservices.assetmanager.client.ValidValuesExchangeClient
-
- All Implemented Interfaces:
ValidValuesExchangeInterface
public class ValidValuesExchangeClient extends ExchangeClientBase implements ValidValuesExchangeInterface
ValidValuesExchangeClient provides the API operations to create and maintain lists of valid value definitions grouped into a valid value set. Both valid value definitions and valid value sets have the same attributes and so inherit from ValidValue where all of the attributes are defined. A set is just grouping of valid values. Valid value definitions and set can be nested many times in other valid value sets.
-
-
Constructor Summary
Constructors Constructor Description ValidValuesExchangeClient(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.ValidValuesExchangeClient(String serverName, String serverPlatformURLRoot, String userId, String password)Create a new client that passes userId and password in each HTTP request.ValidValuesExchangeClient(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog)Create a new client that passes userId and password in each HTTP request.ValidValuesExchangeClient(String serverName, String serverPlatformURLRoot, AssetManagerRESTClient restClient, int maxPageSize, AuditLog auditLog)Create a new client that is going to be used in an OMAG Server.ValidValuesExchangeClient(String serverName, String serverPlatformURLRoot, AuditLog auditLog)Create a new client with no authentication embedded in the HTTP request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachValidValueToSet(String userId, String assetManagerGUID, String assetManagerName, String setGUID, String validValueGUID)Create a link between a valid value set or definition and a set.StringcreateValidValueDefinition(String userId, String setGUID, String assetManagerGUID, String assetManagerName, String validValueExternalIdentifier, String validValueExternalIdentifierName, String validValueExternalIdentifierUsage, String validValueExternalIdentifierSource, KeyPattern validValueExternalIdentifierKeyPattern, Map<String,String> mappingProperties, ValidValueProperties validValueProperties)Create a new valid value definition.StringcreateValidValueSet(String userId, String assetManagerGUID, String assetManagerName, String validValueExternalIdentifier, String validValueExternalIdentifierName, String validValueExternalIdentifierUsage, String validValueExternalIdentifierSource, KeyPattern validValueExternalIdentifierKeyPattern, Map<String,String> mappingProperties, ValidValueProperties validValueProperties)Create a new valid value set.voiddetachValidValueFromSet(String userId, String assetManagerGUID, String assetManagerName, String setGUID, String validValueGUID)Remove the link between a valid value and a set it is a member of.List<ValidValueElement>findValidValues(String userId, String assetManagerGUID, String assetManagerName, String searchString, int startFrom, int pageSize)Locate valid values that match the search string.List<ValidValueElement>getSetsForValidValue(String userId, String assetManagerGUID, String assetManagerName, String validValueGUID, int startFrom, int pageSize)Page through the list of valid value sets that a valid value definition/set belongs to.ValidValueElementgetValidValueByGUID(String userId, String assetManagerGUID, String assetManagerName, String validValueGUID)Retrieve a specific valid value from the repository.List<ValidValueElement>getValidValueByName(String userId, String assetManagerGUID, String assetManagerName, String validValueName, int startFrom, int pageSize)Retrieve a specific valid value from the repository.List<ValidValueElement>getValidValueSetMembers(String userId, String assetManagerGUID, String assetManagerName, String validValueSetGUID, int startFrom, int pageSize)Page through the members of a valid value set.voidremoveValidValue(String userId, String assetManagerGUID, String assetManagerName, String validValueGUID, String validValueExternalIdentifier)Remove the valid value form the repository.voidupdateValidValue(String userId, String assetManagerGUID, String assetManagerName, String validValueGUID, String validValueExternalIdentifier, boolean isMergeUpdate, ValidValueProperties validValueProperties)Update the properties of the valid value.
-
-
-
Constructor Detail
-
ValidValuesExchangeClient
public ValidValuesExchangeClient(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversauditLog- logging destination- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
ValidValuesExchangeClient
public ValidValuesExchangeClient(String serverName, String serverPlatformURLRoot) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST servers- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
ValidValuesExchangeClient
public ValidValuesExchangeClient(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- 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 requestsauditLog- logging destination- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
ValidValuesExchangeClient
public ValidValuesExchangeClient(String serverName, String serverPlatformURLRoot, AssetManagerRESTClient restClient, int maxPageSize, AuditLog auditLog) 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 serverauditLog- logging destination- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
ValidValuesExchangeClient
public ValidValuesExchangeClient(String serverName, String serverPlatformURLRoot, String userId, String password) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- 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 requests- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Detail
-
createValidValueSet
public String createValidValueSet(String userId, String assetManagerGUID, String assetManagerName, String validValueExternalIdentifier, String validValueExternalIdentifierName, String validValueExternalIdentifierUsage, String validValueExternalIdentifierSource, KeyPattern validValueExternalIdentifierKeyPattern, Map<String,String> mappingProperties, ValidValueProperties validValueProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a new valid value set. This just creates the Set itself. Members are added either as they are created, or they can be attached to a set after they are created.- Specified by:
createValidValueSetin interfaceValidValuesExchangeInterface- Parameters:
userId- calling userassetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callervalidValueExternalIdentifier- unique identifier of the valid value in the external asset managervalidValueExternalIdentifierName- name of property for the external identifier in the external asset managervalidValueExternalIdentifierUsage- optional usage description for the external identifier when calling the external asset managervalidValueExternalIdentifierSource- component that issuing this request.validValueExternalIdentifierKeyPattern- pattern for the external identifier within the external asset manager (default is LOCAL_KEY)mappingProperties- additional properties to help with the mapping of the elements in the external asset manager and open metadatavalidValueProperties- properties to store- Returns:
- unique identifier for the new set
- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
createValidValueDefinition
public String createValidValueDefinition(String userId, String setGUID, String assetManagerGUID, String assetManagerName, String validValueExternalIdentifier, String validValueExternalIdentifierName, String validValueExternalIdentifierUsage, String validValueExternalIdentifierSource, KeyPattern validValueExternalIdentifierKeyPattern, Map<String,String> mappingProperties, ValidValueProperties validValueProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a new valid value definition.- Specified by:
createValidValueDefinitionin interfaceValidValuesExchangeInterface- Parameters:
userId- calling user.setGUID- unique identifier of the set to attach this to.assetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callervalidValueExternalIdentifier- unique identifier of the valid value in the external asset managervalidValueExternalIdentifierName- name of property for the external identifier in the external asset managervalidValueExternalIdentifierUsage- optional usage description for the external identifier when calling the external asset managervalidValueExternalIdentifierSource- component that issuing this request.validValueExternalIdentifierKeyPattern- pattern for the external identifier within the external asset manager (default is LOCAL_KEY)mappingProperties- additional properties to help with the mapping of the elements in the external asset manager and open metadatavalidValueProperties- properties to store- Returns:
- unique identifier for the new definition
- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
updateValidValue
public void updateValidValue(String userId, String assetManagerGUID, String assetManagerName, String validValueGUID, String validValueExternalIdentifier, boolean isMergeUpdate, ValidValueProperties validValueProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the properties of the valid value. All properties are updated. If only changing some if the properties, retrieve the current values from the repository and pass existing values back on this call if they are not to change.- Specified by:
updateValidValuein interfaceValidValuesExchangeInterface- Parameters:
userId- calling user.assetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callervalidValueGUID- unique identifier of the valid value.validValueExternalIdentifier- unique identifier of the valid value in the external asset managerisMergeUpdate- should the new properties be merged with existing properties (true) or completely replace them (false)?validValueProperties- properties to store- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
removeValidValue
public void removeValidValue(String userId, String assetManagerGUID, String assetManagerName, String validValueGUID, String validValueExternalIdentifier) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the valid value form the repository. All links to it are deleted too.- Specified by:
removeValidValuein interfaceValidValuesExchangeInterface- Parameters:
userId- calling userassetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callervalidValueGUID- unique identifier of the valid value.validValueExternalIdentifier- unique identifier of the valid value in the external asset manager- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
attachValidValueToSet
public void attachValidValueToSet(String userId, String assetManagerGUID, String assetManagerName, String setGUID, String validValueGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a link between a valid value set or definition and a set. This means the valid value is a member of the set.- Specified by:
attachValidValueToSetin interfaceValidValuesExchangeInterface- Parameters:
userId- calling user.assetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callersetGUID- unique identifier of the set.validValueGUID- unique identifier of the valid value to add to the set.- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
detachValidValueFromSet
public void detachValidValueFromSet(String userId, String assetManagerGUID, String assetManagerName, String setGUID, String validValueGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the link between a valid value and a set it is a member of.- Specified by:
detachValidValueFromSetin interfaceValidValuesExchangeInterface- Parameters:
userId- calling userassetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callersetGUID- owning setvalidValueGUID- unique identifier of the member to be removed.- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
getValidValueByGUID
public ValidValueElement getValidValueByGUID(String userId, String assetManagerGUID, String assetManagerName, String validValueGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve a specific valid value from the repository.- Specified by:
getValidValueByGUIDin interfaceValidValuesExchangeInterface- Parameters:
userId- calling userassetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callervalidValueGUID- unique identifier of the valid value.- Returns:
- Valid value bean
- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
getValidValueByName
public List<ValidValueElement> getValidValueByName(String userId, String assetManagerGUID, String assetManagerName, String validValueName, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve a specific valid value from the repository. Duplicates may be returned if multiple valid values have been assigned the same qualified name.- Specified by:
getValidValueByNamein interfaceValidValuesExchangeInterface- Parameters:
userId- calling userassetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callervalidValueName- qualified name of the valid value.startFrom- starting element (used in paging through large result sets)pageSize- maximum number of results to return- Returns:
- Valid value beans
- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
findValidValues
public List<ValidValueElement> findValidValues(String userId, String assetManagerGUID, String assetManagerName, String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Locate valid values that match the search string. It considers the names, description, scope, usage and preferred value.- Specified by:
findValidValuesin interfaceValidValuesExchangeInterface- Parameters:
userId- calling userassetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callersearchString- string value to look for - may contain RegEx characters.startFrom- paging starting pointpageSize- maximum number of return values.- Returns:
- list of valid value beans
- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
getValidValueSetMembers
public List<ValidValueElement> getValidValueSetMembers(String userId, String assetManagerGUID, String assetManagerName, String validValueSetGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Page through the members of a valid value set.- Specified by:
getValidValueSetMembersin interfaceValidValuesExchangeInterface- Parameters:
userId- calling user.assetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callervalidValueSetGUID- unique identifier of the valid value set.startFrom- paging starting pointpageSize- maximum number of return values.- Returns:
- list of valid value beans
- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
getSetsForValidValue
public List<ValidValueElement> getSetsForValidValue(String userId, String assetManagerGUID, String assetManagerName, String validValueGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Page through the list of valid value sets that a valid value definition/set belongs to.- Specified by:
getSetsForValidValuein interfaceValidValuesExchangeInterface- Parameters:
userId- calling user.assetManagerGUID- unique identifier of software server capability representing the callerassetManagerName- unique name of software server capability representing the callervalidValueGUID- unique identifier of valid value to querystartFrom- paging starting pointpageSize- maximum number of return values.- Returns:
- list of valid value beans
- Throws:
InvalidParameterException- one of the parameters is invalid.UserNotAuthorizedException- the user is not authorized to make this request.PropertyServerException- the repository is not available or not working properly.
-
-