Class SecurityGroupManagement
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.communityprofile.client.SecurityGroupManagement
-
- All Implemented Interfaces:
SecurityGroupInterface
public class SecurityGroupManagement extends Object implements SecurityGroupInterface
SecurityManagerClient is the client for explicitly managing the security groups.
-
-
Constructor Summary
Constructors Constructor Description SecurityGroupManagement(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.SecurityGroupManagement(String serverName, String serverPlatformURLRoot, String userId, String password)Create a new client that passes userId and password in each HTTP request.SecurityGroupManagement(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog)Create a new client that passes userId and password in each HTTP request.SecurityGroupManagement(String serverName, String serverPlatformURLRoot, CommunityProfileRESTClient restClient, int maxPageSize)Create a new client that passes userId and password in each HTTP request.SecurityGroupManagement(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 StringcreateSecurityGroup(String userId, SecurityGroupProperties properties)Create a new security group.voiddeleteSecurityGroup(String userId, String securityGroupGUID)Delete a specific security group.List<SecurityGroupElement>findSecurityGroups(String userId, String searchString, int startFrom, int pageSize)Return the list of security groups that match the search string - this can be a regular expression.List<ElementStub>getElementsGovernedBySecurityGroup(String userId, String securityGroupGUID, int startFrom, int pageSize)Return the elements that are governed by the supplied security group.SecurityGroupElementgetSecurityGroupByGUID(String userId, String securityGroupGUID)Retrieve the userIdentity metadata element with the supplied unique identifier.List<SecurityGroupElement>getSecurityGroupsForDistinguishedName(String userId, String distinguishedName, int startFrom, int pageSize)Return the list of security groups associated with a unique distinguishedName.voidupdateSecurityGroup(String userId, String securityGroupGUID, boolean isMergeUpdate, SecurityGroupProperties properties)Update an existing security group.
-
-
-
Constructor Detail
-
SecurityGroupManagement
public SecurityGroupManagement(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- bad input parameters
-
SecurityGroupManagement
public SecurityGroupManagement(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.
-
SecurityGroupManagement
public SecurityGroupManagement(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- bad input parameters
-
SecurityGroupManagement
public SecurityGroupManagement(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- bad input parameters
-
SecurityGroupManagement
public SecurityGroupManagement(String serverName, String serverPlatformURLRoot, CommunityProfileRESTClient restClient, 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 serversrestClient- pre-initialized REST clientmaxPageSize- pre-initialized parameter limit- Throws:
InvalidParameterException- there is a problem with the information about the remote OMAS
-
-
Method Detail
-
createSecurityGroup
public String createSecurityGroup(String userId, SecurityGroupProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a new security group. The type of the definition is located in the properties.- Specified by:
createSecurityGroupin interfaceSecurityGroupInterface- Parameters:
userId- calling userproperties- 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 userId, String securityGroupGUID, boolean isMergeUpdate, SecurityGroupProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update an existing security group.- Specified by:
updateSecurityGroupin interfaceSecurityGroupInterface- Parameters:
userId- calling usersecurityGroupGUID- 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 userId, String securityGroupGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Delete a specific security group.- Specified by:
deleteSecurityGroupin interfaceSecurityGroupInterface- Parameters:
userId- calling usersecurityGroupGUID- 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 userId, 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, the should be only one.- Specified by:
getSecurityGroupsForDistinguishedNamein interfaceSecurityGroupInterface- Parameters:
userId- calling userdistinguishedName- 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 userId, String securityGroupGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Return the elements that are governed by the supplied security group.- Specified by:
getElementsGovernedBySecurityGroupin interfaceSecurityGroupInterface- Parameters:
userId- calling usersecurityGroupGUID- 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 userId, 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.- Specified by:
findSecurityGroupsin interfaceSecurityGroupInterface- Parameters:
userId- calling usersearchString- 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
-
getSecurityGroupByGUID
public SecurityGroupElement getSecurityGroupByGUID(String userId, String securityGroupGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the userIdentity metadata element with the supplied unique identifier.- Specified by:
getSecurityGroupByGUIDin interfaceSecurityGroupInterface- Parameters:
userId- calling usersecurityGroupGUID- 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)
-
-