|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RgyRegistry
The primary point of contact for accessing the registry. Initial contact will be made via a method from this interface. It may return other classes that operate upon the registry, such as RgyUser, RgyGroup and RgyIterator.
Since SAM layers it's users on top of the native registry users, you will observe this duality in the provided methods. There will be SAM methods and "Native" based method and method parameter names that refer to each layer.
It is expected that only one instance of this Interface will be constructed for a given application, though multiple instances are possible. It supports access to multiple SAM domains, but it is likely that only one domain will be in use at a time.
This interface is thread safe. Some of the returned class instances may not be, their documentation should be examined for thread safety.
Field Summary | |
---|---|
static int |
RESOURCE_CRED_LENGTH
|
static int |
RESOURCE_CRED_NAME_INDEX
|
static int |
RESOURCE_CRED_PASSWORD_INDEX
|
static int |
RESOURCE_CRED_TYPE_INDEX
|
static int |
RESOURCE_CRED_USER_INDEX
|
Method Summary | |
---|---|
void |
close()
When finished with the RgyRegistry instance this should be called to release any cached resources. |
java.lang.String |
condenseResourceCredential(java.lang.String[] expandedResourceCredential)
Condenses an array of four strings representing the GSO resource credential data into a single string format required by this API. |
RgyGroup |
createGroup(java.lang.String domain,
java.lang.String groupId,
java.lang.String groupNativeId,
RgyAttributes rgyAttributes)
Creates a new SAM group and underlying Native group. |
RgyUser |
createUser(java.lang.String domain,
java.lang.String userId,
java.lang.String userNativeId,
char[] password,
boolean bypassPasswordPolicy,
RgyAttributes rgyAttributes,
java.util.Set<java.lang.String> groupIds)
Creates a new SAM user and underlying Native user. |
void |
deleteGroup(java.lang.String domain,
java.lang.String groupId,
boolean deleteNativeGroup)
Delete the SAM group entry, optionally also deleting the Registry entry. |
void |
deleteUser(java.lang.String domain,
java.lang.String userId,
boolean deleteNativeUser)
Delete the SAM user entry, optionally also deleting the Native user entry. |
java.lang.String[] |
expandResourceCredential(java.lang.String condensedResourceCredential)
Expands a GSO resource credential in this API's format into an array of strings that are the component parts. |
java.util.Date |
fromRegistryDate(java.lang.String registryDate)
Converts a registry date/time String into a Java Date instance. |
RgyGroup |
getGroup(java.lang.String domain,
java.lang.String groupId)
Fetch the SAM (and Native) group attributes, wrapped in a class that implements the RgyGroup interface. |
RgyGroup |
getNativeGroup(java.lang.String domain,
java.lang.String groupNativeId)
Fetch the Native group attributes wrapped in a class that implements the RgyGroup interface. |
RgyUser |
getNativeUser(java.lang.String domain,
java.lang.String userNativeId)
Fetch the Native user attributes wrapped in a class that implements the RgyUser interface. |
java.util.Locale |
getRgyThreadLocale()
Returns the locale for the generation of RgyException messages set for this thread. |
RgyUser |
getUser(java.lang.String domain,
java.lang.String userId)
Fetch the SAM (and Native) user attributes, wrapped in a class that implements the RgyUser interface. |
RgyIterator |
listGroups(java.lang.String domain,
java.lang.String groupIdPattern,
int maxResults,
int pageSize)
Lists the SAM groups in the registry that match the pattern provided. |
RgyIterator |
listNativeGroups(java.lang.String searchAttributeName,
java.lang.String searchAttributePattern,
int maxResults,
int pageSize)
Lists the Native group IDs in the registry that match the pattern provided. |
RgyIterator |
listNativeUsers(java.lang.String searchAttributeName,
java.lang.String searchAttributePattern,
int maxResults,
int pageSize)
Lists the Native user IDs in the registry that match the pattern provided. |
RgyIterator |
listUsers(java.lang.String domain,
java.lang.String userIdPattern,
int maxResults,
int pageSize)
Lists the SAM users in the registry that match the pattern provided. |
RgyAttributes |
newRgyAttributes()
Creates a fresh instance of RgyAttributes that can be setup for use with createUser() or createGroup(). |
void |
setRgyThreadLocale(java.util.Locale locale)
Sets the locale for the generation of RgyException messages. |
java.lang.String |
toRegistryDate(java.util.Date javaDate)
Converts a Java Date instance into a String suitable for attributes of a user that require a registry specific date format. |
Field Detail |
---|
static final int RESOURCE_CRED_NAME_INDEX
static final int RESOURCE_CRED_TYPE_INDEX
static final int RESOURCE_CRED_USER_INDEX
static final int RESOURCE_CRED_PASSWORD_INDEX
static final int RESOURCE_CRED_LENGTH
Method Detail |
---|
RgyUser getUser(java.lang.String domain, java.lang.String userId) throws RgyException
domain
- The SAM domain the user is a member of, passing null
will cause the configured local domain to be used.userId
- The SAM user ID, such as "sec_master".
RgyException
RgyUser getNativeUser(java.lang.String domain, java.lang.String userNativeId) throws RgyException
domain
- The SAM user in this domain will be returned if
present for the specified Native user. If domain is null, the
configured local domain will be used.userNativeId
- The Native user ID. This is the underlying registry
ID, such as the DN: "cn=testuser,o=ibm,c=us"
RgyException
RgyIterator listUsers(java.lang.String domain, java.lang.String userIdPattern, int maxResults, int pageSize) throws RgyException
domain
- The SAM domain the matched users must be a member of.
If null is provided, the configured local domain will be used.userIdPattern
- SAM User ID pattern to match. Patterns
consist of a mixture of characters and '*' wildcards.maxResults
- Maximum number of SAM user IDs to return.
Supply 0 for no limit (other than any registry server defined limit).
Note that if there are more result available than maxResults, then
after the last SAM User ID is extracted, the RgyIterator hasNext()
method will throw an exception that indicates this fact. This
exception can be caught and ignored if the caller does not care about
the returned list being shorter than the full matching list.pageSize
- Requests that the underlying registry search the be done
in pages. Even though the paging will not be visible via the returned
RgyIterator, some registries can overcome the underlying registry
server max return results limit. To enable, pass in a positive integer.
RgyException
RgyIterator listNativeUsers(java.lang.String searchAttributeName, java.lang.String searchAttributePattern, int maxResults, int pageSize) throws RgyException
searchAttributeName
- The Name of an attribute that Native user entries
contain that will be searched for a match to the searchAttributePattern.searchAttributePattern
- This is a pattern for the attribute
Name provided. It can contain a mix of characters and '*' wildcards.maxResults
- Maximum number of Native user IDs to return.
Supply 0 for no limit (other than any registry server defined limit).
Note that if there are more result available than maxResults, then
after the last Native User ID is extracted, the RgyIterator hasNext()
method will throw an exception that indicates this fact. This
exception can be caught and ignored if the caller does not care about
the returned list being shorter than the full matching list.pageSize
- Requests that the underlying registry search the be done
in pages. Even though the paging will not be visible via the returned
RgyIterator, some registries can overcome the underlying registry
server max return results limit. To enable, pass in a positive integer.
RgyException
RgyUser createUser(java.lang.String domain, java.lang.String userId, java.lang.String userNativeId, char[] password, boolean bypassPasswordPolicy, RgyAttributes rgyAttributes, java.util.Set<java.lang.String> groupIds) throws RgyException
domain
- The SAM domain to create the user under. If domain
is null, the configured local domain will be used.userId
- The ID for the SAM user, for example "testuser".userNativeId
- The ID of the Native user entry to create.
The SAM user will be created on top of this. An example might be
"cn=testuser,o=ibm,c=us".password
- The password to give the Native/SAM userbypassPasswordPolicy
- If set to "true" then the password provided
will not be rejected by SAM if it does not meet the requirements of
SAM global password policy. It may not allow bypassing of the
underlying Registry's policy, if enabled.rgyAttributes
- Attributes to add to the newly created user. For
example, you could override the default "FALSE" value for
RgyAttributes.SEC_ACCT_VALID_NAME with RgyAttributes.BOOL_TRUE_VALUE.groupIds
- A SetRgyException
void deleteUser(java.lang.String domain, java.lang.String userId, boolean deleteNativeUser) throws RgyException
domain
- The SAM domain of the user to delete. If domain
is null, the configured local domain will be used.userId
- The ID for the SAM user, for example "testuser".deleteNativeUser
- When true, the Native user entry will be removed
if possible.
RgyException
WarningNativeEntityInUseRgyException
- This is a warning exception and
can be ignored. The Native entity could not be removed as other entries exist
under it, possibly it is being used in other Security Access Manager domains.
The Security Access Manager User information has been removed so the user is
no longer a member of the domain specified.RgyGroup getGroup(java.lang.String domain, java.lang.String groupId) throws RgyException
domain
- This is the SAM domain in which to look for a SAM
group. If domain is null, the configured local domain will be used.groupId
- The ID for the SAM group, for example "testgroup".
RgyException
RgyGroup getNativeGroup(java.lang.String domain, java.lang.String groupNativeId) throws RgyException
domain
- This is the SAM domain in which to look for a SAM
group entry to also return. If domain is null, the configured local
domain will be used.groupNativeId
- The Native group ID. This is the underlying registry
ID, such as the DN: cn=testgroup,o=ibm,c=us
RgyException
RgyIterator listGroups(java.lang.String domain, java.lang.String groupIdPattern, int maxResults, int pageSize) throws RgyException
domain
- The SAM domain the matched groups must be a member of.
If null is provided, the configured local domain will be used.groupIdPattern
- SAM Group ID pattern to match. Patterns
consist of a mixture of characters and '*' wildcards.maxResults
- Maximum number of SAM group IDs to return.
Supply 0 for no limit (other than any registry server defined limit).
Note that if there are more result available than maxResults, then
after the last SAM Group ID is extracted, the RgyIterator hasNext()
method will throw an exception that indicates this fact. This
exception can be caught and ignored if the caller does not care about
the returned list being shorter than the full matching list.pageSize
- Requests that the underlying registry search the be done
in pages. Even though the paging will not be visible via the returned
RgyIterator, some registries can overcome the underlying registry
server max return results limit. To enable, pass in a positive integer.
RgyException
RgyIterator listNativeGroups(java.lang.String searchAttributeName, java.lang.String searchAttributePattern, int maxResults, int pageSize) throws RgyException
searchAttributeName
- The Name of an attribute that Native group entries
contain that will be searched for a match to the searchNativePattern.searchAttributePattern
- This is a pattern for the attribute
Name provided. It can contain a mix of characters and '*' wildcards.maxResults
- Maximum number of Native group IDs to return.
Supply 0 for no limit (other than any registry server defined limit).
Note that if there are more result available than maxResults, then
after the last Native User ID is extracted, the RgyIterator hasNext()
method will throw an exception that indicates this fact. This
exception can be caught and ignored if the caller does not care about
the returned list being shorter than the full matching list.pageSize
- Requests that the underlying registry search the be done
in pages. Even though the paging will not be visible via the returned
RgyIterator, some registries can overcome the underlying registry
server max return results limit. To enable, pass in a positive integer.
RgyException
RgyGroup createGroup(java.lang.String domain, java.lang.String groupId, java.lang.String groupNativeId, RgyAttributes rgyAttributes) throws RgyException
domain
- The SAM domain to create the group in. If domain
is null, the configured local domain will be used.groupId
- The ID for the SAM group, for example "testgroup".groupNativeId
- The ID of the Native group entry to create.
The SAM group will be created on top of this. An example might be
"cn=testgroup,o=ibm,c=us".rgyAttributes
- Attributes to add to the newly created group. For
example RgyAttributes.COMMON_NAME_NAME.
RgyException
void deleteGroup(java.lang.String domain, java.lang.String groupId, boolean deleteNativeGroup) throws RgyException
domain
- groupId
- deleteNativeGroup
-
RgyException
WarningNativeEntityInUseRgyException
- This is a warning exception and
can be ignored. The Native entity could not be removed as other entries exist
under it, possibly it is being used in other Security Access Manager domains.
The Security Access Manager Group information has been removed so the group is
no longer a member of the domain specified.RgyAttributes newRgyAttributes()
void close()
void setRgyThreadLocale(java.util.Locale locale)
locale
- Locale used for this thread and this instance of
RgyRegistry only.java.util.Locale getRgyThreadLocale()
java.lang.String toRegistryDate(java.util.Date javaDate) throws RgyException
RgyAttributes.ACCOUNT_EXPIRY_DATE_NAME
. Note that
this method is only accurate to the second, so the millisecond resolution is lost.
javaDate
- is the Java Date instance to convert to a String. If
null is provided, a special value is returned that SAM uses to represent
unlimited date for the underlying registry type.
RgyException
java.util.Date fromRegistryDate(java.lang.String registryDate) throws RgyException
registryDate
- A date/time String from a user attribute to convert.
InvalidParametersRgyException
- for an invalid registryDate string.
RgyException
java.lang.String condenseResourceCredential(java.lang.String[] expandedResourceCredential) throws RgyException
See RESOURCE_CRED_*_INDEX for the indexes of the components of String[].
expandedResourceCredential
- The components of the resource credential
to condense into a single String.
InvalidParametersRgyException
- if an incorrect number of components
was supplied.
RgyException
java.lang.String[] expandResourceCredential(java.lang.String condensedResourceCredential) throws RgyException
See RESOURCE_CRED_*_INDEX for the indexes of the components of String[].
condensedResourceCredential
-
InvalidParametersRgyException
- if the condensedResourceCredential
could not be parsed into it's components.
RgyException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |