Class TemplateManager
java.lang.Object
org.odpi.openmetadata.accessservices.digitalarchitecture.client.TemplateManager
- All Implemented Interfaces:
ManageTemplates
TemplateManager provides specialist methods for managing templates
-
Constructor Summary
ConstructorDescriptionTemplateManager
(String serverName, String serverPlatformURLRoot, int maxPageSize) Create a new client with no authentication embedded in the HTTP request.TemplateManager
(String serverName, String serverPlatformURLRoot, int maxPageSize, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request.TemplateManager
(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize) Create a new client that passes userId and password in each HTTP request.TemplateManager
(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize, AuditLog auditLog) Create a new client that passes userId and password in each HTTP request.TemplateManager
(String serverName, String serverPlatformURLRoot, DigitalArchitectureRESTClient restClient, int maxPageSize, AuditLog auditLog) Create a new client that is going to be used in an OMAG Server (view service or integration service typically). -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTemplateClassification
(String userId, String elementGUID, TemplateClassificationProperties properties, Map<String, List<Map<String, String>>> specification) Classify an asset as suitable to be used as a template for cataloguing assets of a similar types.findTemplates
(String userId, String searchString, String typeName, Date effectiveTime, int startFrom, int pageSize) Find templates with the requested RegEx in the string properties of the template properties.getTemplatesByName
(String userId, String name, String typeName, Date effectiveTime, int startFrom, int pageSize) Return the templates with the requested name.getTemplatesForType
(String userId, String typeName, Date effectiveTime, int startFrom, int pageSize) Return a list of templates for a particular open metadata type of element.void
removeTemplateClassification
(String userId, String elementGUID) Remove the classification that indicates that this element can be used as a template.
-
Constructor Details
-
TemplateManager
public TemplateManager(String serverName, String serverPlatformURLRoot, int maxPageSize, 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 servicesmaxPageSize
- 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.
-
TemplateManager
public TemplateManager(String serverName, String serverPlatformURLRoot, int maxPageSize) 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 servicesmaxPageSize
- 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.
-
TemplateManager
public TemplateManager(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize, 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 servicesuserId
- caller's userId embedded in all HTTP requestspassword
- caller's userId embedded in all HTTP requestsmaxPageSize
- 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.
-
TemplateManager
public TemplateManager(String serverName, String serverPlatformURLRoot, String userId, String password, int maxPageSize) 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 servicesuserId
- caller's userId embedded in all HTTP requestspassword
- caller's userId embedded in all HTTP requestsmaxPageSize
- 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.
-
TemplateManager
public TemplateManager(String serverName, String serverPlatformURLRoot, DigitalArchitectureRESTClient restClient, int maxPageSize, AuditLog auditLog) throws InvalidParameterException Create a new client that is going to be used in an OMAG Server (view service or integration service typically).- Parameters:
serverName
- name of the server to connect toserverPlatformURLRoot
- the network address of the server running the OMAS REST servicesrestClient
- 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.
-
-
Method Details
-
addTemplateClassification
public void addTemplateClassification(String userId, String elementGUID, TemplateClassificationProperties properties, Map<String, List<Map<String, throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionString>>> specification) Classify an asset as suitable to be used as a template for cataloguing assets of a similar types.- Specified by:
addTemplateClassification
in interfaceManageTemplates
- Parameters:
userId
- calling userelementGUID
- unique identifier of the element to classify as a templateproperties
- properties of the templatespecification
- values required to use the template- Throws:
InvalidParameterException
- element not known, null userId or guidPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
removeTemplateClassification
public void removeTemplateClassification(String userId, String elementGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the classification that indicates that this element can be used as a template. Any specification is also removed.- Specified by:
removeTemplateClassification
in interfaceManageTemplates
- Parameters:
userId
- calling userelementGUID
- unique identifier of the element to declassify- Throws:
InvalidParameterException
- element or element not known, null userId or guidPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getTemplatesForType
public List<TemplateElement> getTemplatesForType(String userId, String typeName, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return a list of templates for a particular open metadata type of element.- Specified by:
getTemplatesForType
in interfaceManageTemplates
- Parameters:
userId
- calling usertypeName
- type name to query (if null, any type is returned)effectiveTime
- optional effective timestartFrom
- starting elementpageSize
- maximum number of elements- Returns:
- list of templates
- Throws:
InvalidParameterException
- element not known, null userId or guidPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
findTemplates
public List<TemplateElement> findTemplates(String userId, String searchString, String typeName, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Find templates with the requested RegEx in the string properties of the template properties.- Specified by:
findTemplates
in interfaceManageTemplates
- Parameters:
userId
- calling usersearchString
- string to search for (regEx)typeName
- type name to query (if null, any type is returned)effectiveTime
- optional effective timestartFrom
- starting elementpageSize
- maximum number of elements- Returns:
- list of templates
- Throws:
InvalidParameterException
- element not known, null userId or guidPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getTemplatesByName
public List<TemplateElement> getTemplatesByName(String userId, String name, String typeName, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the templates with the requested name.- Specified by:
getTemplatesByName
in interfaceManageTemplates
- Parameters:
userId
- calling username
- name to search fortypeName
- type name to query (if null, any type is returned)effectiveTime
- optional effective timestartFrom
- starting elementpageSize
- maximum number of elements- Returns:
- list of templates
- Throws:
InvalidParameterException
- element not known, null userId or guidPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-