Class SecurityIntegratorContext
java.lang.Object
org.odpi.openmetadata.frameworks.integration.context.IntegrationContext
org.odpi.openmetadata.integrationservices.security.connector.SecurityIntegratorContext
SecurityIntegratorContext provides a wrapper around the Security Manager OMAS client.
It provides the simplified interface to open metadata needed by the SecurityIntegratorConnector.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.integration.context.IntegrationContext
actionControlInterface, connectorName, externalSourceGUID, externalSourceIsHome, externalSourceName, fileClassifier, governanceConfiguration, integrationConnectorGUID, integrationReportWriter, maxPageSize, openIntegrationClient, openMetadataStoreClient, permittedSynchronization, propertyHelper, userId
-
Constructor Summary
ConstructorDescriptionSecurityIntegratorContext
(String connectorId, String connectorName, String connectorUserId, String serverName, OpenIntegrationClient openIntegrationClient, GovernanceConfiguration governanceConfiguration, OpenMetadataClient openMetadataStoreClient, ActionControlInterface actionControlInterface, SecurityManagerClient securityManagerClient, SecurityManagerEventClient eventClient, boolean generateIntegrationReport, PermittedSynchronization permittedSynchronization, String integrationConnectorGUID, String externalSourceGUID, String externalSourceName, int maxPageSize, AuditLog auditLog) Create a new client to exchange data asset content with open metadata. -
Method Summary
Modifier and TypeMethodDescriptioncreateSecurityGroup
(SecurityGroupProperties properties) Create a new security group.createUserIdentity
(UserIdentityProperties newIdentity) Create a UserIdentity.void
deleteSecurityGroup
(String securityGroupGUID) Delete a specific security group.void
deleteUserIdentity
(String userIdentityGUID) Remove a user identity object.findActorProfile
(String searchString, int startFrom, int pageSize) Retrieve the list of matching profiles for the search string.findPersonRole
(String searchString, int startFrom, int pageSize) Retrieve the list of matching roles for the search string.findSecurityGroups
(String searchString, int startFrom, int pageSize) Return the list of security groups that match the search string - this can be a regular expression.findUserIdentities
(String searchString, int startFrom, int pageSize) Retrieve the list of user identity metadata elements that contain the search string.getActorProfileByGUID
(String actorProfileGUID) Return information about a specific actor profile.getActorProfileByName
(String name, int startFrom, int pageSize) Return information about a named actor profile.getActorProfileByUserId
(String actorProfileUserId) Return information about a specific actor profile.getAppointees
(String personRoleGUID, Date effectiveTime, int startFrom, int pageSize) Return the list of people appointed to a particular role.getElementsGovernedBySecurityGroup
(String securityGroupGUID, int startFrom, int pageSize) Return the elements that are governed by the supplied security group.Return the qualified name of the security manager that is supplied in the configuration document.getPersonRoleByGUID
(String personRoleGUID) Return information about a specific person role.getPersonRoleByName
(String name, int startFrom, int pageSize) Return information about a named person role.getSecurityGroupsForDistinguishedName
(String distinguishedName, int startFrom, int pageSize) Return the list of security groups associated with a unique distinguishedName.getUserIdentitiesByName
(String name, int startFrom, int pageSize) Retrieve the list of user identity metadata elements with a matching qualified name.getUserIdentityByGUID
(String userIdentityGUID) Retrieve the userIdentity metadata element with the supplied unique identifier.void
registerListener
(SecurityManagerEventListener listener) Register a listener object that will be passed each of the events published by the Security Manager OMAS.void
updateSecurityGroup
(String securityGroupGUID, boolean isMergeUpdate, SecurityGroupProperties properties) Update an existing security group.void
updateUserIdentity
(String userIdentityGUID, boolean isMergeUpdate, UserIdentityProperties properties) Update a UserIdentity.Methods inherited from class org.odpi.openmetadata.frameworks.integration.context.IntegrationContext
addCatalogTarget, addCatalogTarget, disconnect, elementShouldBeCatalogued, getAnchorGUID, getAnchorGUID, getCatalogTarget, getCatalogTargets, getCatalogTargets, getConnectedAssetContext, getExternalSourceIsHome, getFileClassifier, getIntegrationGovernanceContext, getMaxPageSize, getMetadataSourceGUID, getMetadataSourceQualifiedName, getMyUserId, getPermittedSynchronization, isRefreshInProgress, isTypeOf, isTypeOf, registerDirectoryListener, registerDirectoryTreeListener, registerFileListener, removeCatalogTarget, reportAnchorGUID, reportAnchorGUID, reportElementCreation, reportElementDelete, reportElementUpdate, reportParentGUID, setActiveReportPublishing, setExternalSourceIsHome, setMetadataSourceQualifiedName, setMetadataSourceQualifiedName, unregisterDirectoryListener, unregisterDirectoryTreeListener, unregisterFileListener, updateCatalogTarget
-
Constructor Details
-
SecurityIntegratorContext
public SecurityIntegratorContext(String connectorId, String connectorName, String connectorUserId, String serverName, OpenIntegrationClient openIntegrationClient, GovernanceConfiguration governanceConfiguration, OpenMetadataClient openMetadataStoreClient, ActionControlInterface actionControlInterface, SecurityManagerClient securityManagerClient, SecurityManagerEventClient eventClient, boolean generateIntegrationReport, PermittedSynchronization permittedSynchronization, String integrationConnectorGUID, String externalSourceGUID, String externalSourceName, int maxPageSize, AuditLog auditLog) Create a new client to exchange data asset content with open metadata.- Parameters:
connectorId
- unique identifier of the connector (used to configure the event listener)connectorName
- name of connector from configconnectorUserId
- userId for the connectorserverName
- name of the integration daemonopenIntegrationClient
- client for calling the metadata servergovernanceConfiguration
- client for managing catalog targetsopenMetadataStoreClient
- client for calling the metadata serveractionControlInterface
- client for initiating governance actionssecurityManagerClient
- client for exchange requestseventClient
- client for registered listenersgenerateIntegrationReport
- should the connector generate an integration reports?permittedSynchronization
- the direction of integration permitted by the integration connectorintegrationConnectorGUID
- unique identifier for the integration connector if it is started via an integration group (otherwise it is null).externalSourceGUID
- unique identifier of the software server capability for the asset managerexternalSourceName
- unique name of the software server capability for the asset managermaxPageSize
- max number of elements that can be returned on a queryauditLog
- logging destination
-
-
Method Details
-
getExternalSourceName
Return the qualified name of the security manager that is supplied in the configuration document.- Returns:
- string name
-
registerListener
public void registerListener(SecurityManagerEventListener listener) throws InvalidParameterException, ConnectionCheckedException, ConnectorCheckedException, PropertyServerException, UserNotAuthorizedException Register a listener object that will be passed each of the events published by the Security Manager OMAS.- Parameters:
listener
- listener object- Throws:
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.
-
createSecurityGroup
public String createSecurityGroup(SecurityGroupProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a new security group. The type of the definition is located in the properties.- Parameters:
properties
- properties of the definition- Returns:
- unique identifier of the definition
- Throws:
InvalidParameterException
- typeName, documentIdentifier or userId is null; documentIdentifier is not unique; typeName is not validPropertyServerException
- problem accessing the metadata serviceUserNotAuthorizedException
- security access problem
-
updateSecurityGroup
public void updateSecurityGroup(String securityGroupGUID, boolean isMergeUpdate, SecurityGroupProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update an existing security group.- Parameters:
securityGroupGUID
- unique identifier of the definition to updateisMergeUpdate
- are unspecified properties unchanged (true) or removed?properties
- properties to update- Throws:
InvalidParameterException
- guid, documentIdentifier or userId is null; documentIdentifier is not unique; guid is not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
deleteSecurityGroup
public void deleteSecurityGroup(String securityGroupGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Delete a specific security group.- Parameters:
securityGroupGUID
- unique identifier of the definition to remove- Throws:
InvalidParameterException
- guid is null or not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getSecurityGroupsForDistinguishedName
public List<SecurityGroupElement> getSecurityGroupsForDistinguishedName(String distinguishedName, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the list of security groups associated with a unique distinguishedName. In an ideal world, there should be only one.- Parameters:
distinguishedName
- unique name of the security groupstartFrom
- where to start from in the list of definitionspageSize
- max number of results to return in one call- Returns:
- list of security groups
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the caller is not authorized to issue the requestPropertyServerException
- the metadata service has problems
-
getElementsGovernedBySecurityGroup
public List<ElementStub> getElementsGovernedBySecurityGroup(String securityGroupGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the elements that are governed by the supplied security group.- Parameters:
securityGroupGUID
- unique name of the security groupstartFrom
- where to start from in the list of definitionspageSize
- max number of results to return in one call- Returns:
- list of headers for the associated elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the caller is not authorized to issue the requestPropertyServerException
- the metadata service has problems
-
findSecurityGroups
public List<SecurityGroupElement> findSecurityGroups(String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the list of security groups that match the search string - this can be a regular expression.- Parameters:
searchString
- value to search forstartFrom
- where to start from in the list of definition resultspageSize
- max number of results to return in one call- Returns:
- list of security groups
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the caller is not authorized to issue the requestPropertyServerException
- the metadata service has problems
-
createUserIdentity
public String createUserIdentity(UserIdentityProperties newIdentity) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Create a UserIdentity.- Parameters:
newIdentity
- properties for the new userIdentity.- Returns:
- unique identifier of the UserIdentity
- 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.
-
updateUserIdentity
public void updateUserIdentity(String userIdentityGUID, boolean isMergeUpdate, UserIdentityProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Update a UserIdentity.- Parameters:
userIdentityGUID
- unique identifier of the UserIdentityisMergeUpdate
- should the supplied properties be overlaid on the existing properties (true) or replace them (falseproperties
- updated properties for the new userIdentity- 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.
-
deleteUserIdentity
public void deleteUserIdentity(String userIdentityGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Remove a user identity object. This will fail if the profile would be left without an associated user identity.- Parameters:
userIdentityGUID
- unique identifier of the UserIdentity- 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.
-
findUserIdentities
public List<UserIdentityElement> findUserIdentities(String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of user identity metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
searchString
- string to find in the propertiesstartFrom
- paging start pointpageSize
- maximum results that can be returned- 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)
-
getUserIdentitiesByName
public List<UserIdentityElement> getUserIdentitiesByName(String name, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of user identity metadata elements with a matching qualified name. There are no wildcards supported on this request.- Parameters:
name
- name to search forstartFrom
- paging start pointpageSize
- maximum results that can be returned- 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)
-
getUserIdentityByGUID
public UserIdentityElement getUserIdentityByGUID(String userIdentityGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the userIdentity metadata element with the supplied unique identifier.- Parameters:
userIdentityGUID
- unique identifier of the requested metadata element- Returns:
- matching 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)
-
getActorProfileByGUID
public ActorProfileElement getActorProfileByGUID(String actorProfileGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about a specific actor profile.- Parameters:
actorProfileGUID
- unique identifier for the actor profile- Returns:
- properties of the actor profile
- Throws:
InvalidParameterException
- actorProfileGUID or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getActorProfileByUserId
public ActorProfileElement getActorProfileByUserId(String actorProfileUserId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about a specific actor profile.- Parameters:
actorProfileUserId
- unique identifier for the actor profile- Returns:
- properties of the actor profile
- Throws:
InvalidParameterException
- actorProfileUserId or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getActorProfileByName
public List<ActorProfileElement> getActorProfileByName(String name, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about a named actor profile.- Parameters:
name
- unique name for the actor profilestartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return.- Returns:
- list of matching actor profiles (hopefully only one)
- Throws:
InvalidParameterException
- name or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
findActorProfile
public List<ActorProfileElement> findActorProfile(String searchString, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Retrieve the list of matching profiles for the search string.- Parameters:
searchString
- RegEx string to search forstartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return.- Returns:
- list of matching actor profiles
- Throws:
InvalidParameterException
- guid invalid or the external references are not correctly specified, or are null.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
getAppointees
public List<Appointee> getAppointees(String personRoleGUID, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return the list of people appointed to a particular role.- Parameters:
personRoleGUID
- unique identifier of the person roleeffectiveTime
- time for appointments, null for full appointment historystartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return- Returns:
- list of appointees
- Throws:
InvalidParameterException
- one of the guids is null or not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getPersonRoleByGUID
public PersonRoleElement getPersonRoleByGUID(String personRoleGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about a specific person role.- Parameters:
personRoleGUID
- unique identifier for the person role- Returns:
- properties of the person role
- Throws:
InvalidParameterException
- personRoleGUID or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getPersonRoleByName
public List<PersonRoleElement> getPersonRoleByName(String name, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about a named person role.- Parameters:
name
- unique name for the actor profilestartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return.- Returns:
- list of matching actor profiles (hopefully only one)
- Throws:
InvalidParameterException
- name or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
findPersonRole
public List<PersonRoleElement> findPersonRole(String searchString, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Retrieve the list of matching roles for the search string.- Parameters:
searchString
- RegEx string to search forstartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return.- Returns:
- list of matching actor profiles
- Throws:
InvalidParameterException
- guid invalid or the external references are not correctly specified, or are null.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-