Class ProjectClient
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ConnectorContextClientBase
org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ProjectClient
Provides services for connectors to work with project elements.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ConnectorContextClientBase
asOfTimeDefault, auditLog, connectorGUID, connectorUserId, externalSourceGUID, externalSourceIsHome, externalSourceName, forDuplicateProcessing, forLineage, governanceZonesFilterDefault, limitResultsByStatusDefault, localServerName, localServiceName, maxPageSize, parentContext, propertyHelper, sequencingOrderDefault, sequencingPropertyDefault, useCurrentEffectiveTime
-
Constructor Summary
ConstructorsConstructorDescriptionProjectClient
(ConnectorContextBase parentContext, String localServerName, String localServiceName, String connectorUserId, String connectorGUID, String externalSourceGUID, String externalSourceName, OpenMetadataClient openMetadataClient, AuditLog auditLog, int maxPageSize) Constructor for connector context client. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearProjectDependency
(String projectGUID, String dependsOnProjectGUID, DeleteOptions deleteOptions) Remove a project dependency relationship between two projects.void
clearProjectHierarchy
(String projectGUID, String managedProjectGUID, DeleteOptions deleteOptions) Remove a project hierarchy relationship between two projects.void
clearProjectTeam
(String projectGUID, String actorGUID, DeleteOptions deleteOptions) Remove a ProjectTeam relationship between a project and an actor.createProject
(NewElementOptions newElementOptions, String optionalClassification, Map<String, ClassificationProperties> initialClassifications, ProjectProperties properties, RelationshipProperties parentRelationshipProperties) Create a new project.createProjectFromTemplate
(TemplateOptions templateOptions, String templateGUID, ElementProperties replacementProperties, Map<String, String> placeholderProperties, RelationshipProperties parentRelationshipProperties) Create a new metadata element to represent a project using an existing element as a template.void
deleteProject
(String projectGUID, DeleteOptions deleteOptions) Delete a project.findProjects
(String searchString, SearchOptions searchOptions) Retrieve the list of projects metadata elements that contain the search string and show which solution components (if any) are attached to it.getProjectByGUID
(String projectGUID, GetOptions getOptions) Return the properties of a specific project.getProjectsByName
(String name, QueryOptions queryOptions) Returns the list of projects with a particular name.void
setupProjectDependency
(String projectGUID, String dependsOnProjectGUID, MetadataSourceOptions metadataSourceOptions, ProjectDependencyProperties properties) Create a project dependency relationship between two projects.void
setupProjectHierarchy
(String projectGUID, String managedProjectGUID, MetadataSourceOptions metadataSourceOptions, ProjectHierarchyProperties properties) Create a project hierarchy relationship between two projects.void
setupProjectTeam
(String projectGUID, String actorGUID, MetadataSourceOptions metadataSourceOptions, AssignmentScopeProperties properties) Create a ProjectTeam relationship between a project and an actor to show that they are member of the project.void
updateProject
(String projectGUID, UpdateOptions updateOptions, ProjectProperties properties) Update the properties of a project.Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.connectorcontext.ConnectorContextClientBase
getAdditionalProperties, getDeleteOptions, getDisplayName, getEffectiveTime, getGetOptions, getMaxPagingSize, getMetadataSourceOptions, getNewElementProperties, getQualifiedName, getQueryOptions, getQueryOptions, getQueryOptions, getQueryOptions, getSearchOptions, getSearchOptions, getUpdateOptions, isForDuplicateProcessing, isForLineage, isUseCurrentEffectiveTime, publishElement, setAsOfTimeDefault, setEffectiveTimeDefault, setExternalSourceIsHome, setForDuplicateProcessing, setForLineage, setGovernanceZonesFilterDefault, setLimitResultsByStatusDefault, setSequencingOrderDefault, setUseCurrentEffectiveTime, withdrawElement
-
Constructor Details
-
ProjectClient
public ProjectClient(ConnectorContextBase parentContext, String localServerName, String localServiceName, String connectorUserId, String connectorGUID, String externalSourceGUID, String externalSourceName, OpenMetadataClient openMetadataClient, AuditLog auditLog, int maxPageSize) Constructor for connector context client.- Parameters:
parentContext
- connector's contextlocalServerName
- local server where this client is running - used for error handlinglocalServiceName
- local service that his connector is hosted by - used for error handlingconnectorUserId
- the userId to use with all requests for open metadataconnectorGUID
- the unique identifier that represents this connector in open metadataexternalSourceGUID
- unique identifier of the software server capability for the source of metadataexternalSourceName
- unique name of the software server capability for the source of metadataopenMetadataClient
- client to access the open metadata storeauditLog
- logging destinationmaxPageSize
- max number of elements that can be returned on a query
-
-
Method Details
-
createProject
public String createProject(NewElementOptions newElementOptions, String optionalClassification, Map<String, ClassificationProperties> initialClassifications, ProjectProperties properties, RelationshipProperties parentRelationshipProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedExceptionCreate a new project.- Parameters:
newElementOptions
- details of the element to createoptionalClassification
- classification of the projects - eg Campaign, Task or PersonalProjectPropertiesinitialClassifications
- map of classification names to classification properties to include in the entity creation requestproperties
- properties for the new element.parentRelationshipProperties
- properties to include in parent relationship- Returns:
- unique identifier of the newly created element
- Throws:
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.
-
createProjectFromTemplate
public String createProjectFromTemplate(TemplateOptions templateOptions, String templateGUID, ElementProperties replacementProperties, Map<String, String> placeholderProperties, RelationshipProperties parentRelationshipProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionCreate a new metadata element to represent a project using an existing element as a template. The template defines additional classifications and relationships that should be added to the new project.- Parameters:
templateOptions
- details of the element to createtemplateGUID
- the unique identifier of the existing project to copy (this will copy all the attachments such as nested content, schema connection etc)replacementProperties
- properties of the new metadata element. These override the template valuesplaceholderProperties
- property name-to-property value map to replace any placeholder values in the template element - and their anchored elements, which are also copied as part of this operation.parentRelationshipProperties
- properties to include in parent relationship- 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)
-
updateProject
public void updateProject(String projectGUID, UpdateOptions updateOptions, ProjectProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Update the properties of a project.- Parameters:
projectGUID
- unique identifier of the project (returned from create)updateOptions
- provides a structure for the additional options when updating an element.properties
- properties for the element.- Throws:
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.
-
setupProjectDependency
public void setupProjectDependency(String projectGUID, String dependsOnProjectGUID, MetadataSourceOptions metadataSourceOptions, ProjectDependencyProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a project dependency relationship between two projects.- Parameters:
projectGUID
- unique identifier of the projectdependsOnProjectGUID
- unique identifier of the project it depends onmetadataSourceOptions
- options to control access to open metadataproperties
- properties for the relationship- 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)
-
clearProjectDependency
public void clearProjectDependency(String projectGUID, String dependsOnProjectGUID, DeleteOptions deleteOptions) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove a project dependency relationship between two projects.- Parameters:
projectGUID
- unique identifier of the projectdependsOnProjectGUID
- unique identifier of the project it depends ondeleteOptions
- options to control access to open metadata- 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)
-
setupProjectHierarchy
public void setupProjectHierarchy(String projectGUID, String managedProjectGUID, MetadataSourceOptions metadataSourceOptions, ProjectHierarchyProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a project hierarchy relationship between two projects.- Parameters:
projectGUID
- unique identifier of the projectmanagedProjectGUID
- unique identifier of the project it managesmetadataSourceOptions
- options to control access to open metadataproperties
- properties for the relationship- 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)
-
clearProjectHierarchy
public void clearProjectHierarchy(String projectGUID, String managedProjectGUID, DeleteOptions deleteOptions) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove a project hierarchy relationship between two projects.- Parameters:
projectGUID
- unique identifier of the projectmanagedProjectGUID
- unique identifier of the project it managesdeleteOptions
- options to control access to open metadata- 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)
-
setupProjectTeam
public void setupProjectTeam(String projectGUID, String actorGUID, MetadataSourceOptions metadataSourceOptions, AssignmentScopeProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a ProjectTeam relationship between a project and an actor to show that they are member of the project.- Parameters:
projectGUID
- unique identifier of the projectactorGUID
- unique identifier of the person rolemetadataSourceOptions
- options to control access to open metadataproperties
- describes the permissions that the role has in the project- 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)
-
clearProjectTeam
public void clearProjectTeam(String projectGUID, String actorGUID, DeleteOptions deleteOptions) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove a ProjectTeam relationship between a project and an actor.- Parameters:
projectGUID
- unique identifier of the projectactorGUID
- unique identifier of the person roledeleteOptions
- options to control access to open metadata- 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)
-
deleteProject
public void deleteProject(String projectGUID, DeleteOptions deleteOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Delete a project.- Parameters:
projectGUID
- unique identifier of the element- Throws:
InvalidParameterException
- one of the parameters 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.
-
getProjectsByName
public List<OpenMetadataRootElement> getProjectsByName(String name, QueryOptions queryOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Returns the list of projects with a particular name.- Parameters:
name
- name of the element to return - match is full text match in qualifiedName, identifier or displayNamequeryOptions
- multiple options to control the query- Returns:
- a list of elements
- Throws:
InvalidParameterException
- one of the parameters 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.
-
getProjectByGUID
public OpenMetadataRootElement getProjectByGUID(String projectGUID, GetOptions getOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the properties of a specific project.- Parameters:
projectGUID
- unique identifier of the required elementgetOptions
- multiple options to control the query- Returns:
- retrieved properties
- Throws:
InvalidParameterException
- one of the parameters 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.
-
findProjects
public List<OpenMetadataRootElement> findProjects(String searchString, SearchOptions searchOptions) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of projects metadata elements that contain the search string and show which solution components (if any) are attached to it. The returned projects include a list of the components that are associated with it. The search string is treated as a regular expression.- Parameters:
searchString
- string to find in the propertiessearchOptions
- multiple options to control the query- 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)
-