com.sun.identity.um
Class StoreConnection

java.lang.Object
  |
  +--com.sun.identity.um.StoreConnection

public final class StoreConnection
extends java.lang.Object

The StoreConnection class represents a connection to the Sun ONE Identity Server datastore. It provides methods to creat, remove and get different type of Sun ONE Identity Server SDK objects in the datatore.


Constructor Summary
StoreConnection(SSOToken ssotoken)
          The constructor for opening the connection of the data repository.
 
Method Summary
 AssignableDynamicGroup getAssignableDynamicGroup(java.lang.String assignableDynamicGroupDN)
          Gets the handle to the AssignableDynamicGroup object represented by DN.
 DynamicGroup getDynamicGroup(java.lang.String dynamicGroupDN)
          Gets the handle to the DynamicGroup object represented by DN.
 java.lang.String getFilteredRoleNamingAttribute()
          Gets the filtered role naming attribute.
 java.lang.String getGroupNamingAttribute()
          Gets the group naming attribute.
 Organization getOrganization(java.lang.String orgDN)
          Gets the handle to the Organization object represented by DN.
 java.lang.String getOrganizationalUnitNamingAttribute()
          Gets the organizationalUnit naming attribute.
 java.lang.String getOrganizationDN(java.lang.String domainname, java.lang.String orgSearchTemplate)
          Gets the DN of the organization, using the domainname provided and the searchTemplate (if provided).
 java.lang.String getOrganizationNamingAttribute()
          Gets the org naming attribute.
 Role getRole(java.lang.String roleDN)
          Gets the handle to the Role object represented by DN.
 java.lang.String getRoleNamingAttribute()
          Gets the role naming attribute.
 StaticGroup getStaticGroup(java.lang.String groupDN)
          Gets the handle to the StaticGroup object represented by DN.
 User getUser(java.lang.String userDN)
          Gets the handle to the User object represented by DN.
 java.lang.String getUserNamingAttribute()
          Gets the user naming attribute.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoreConnection

public StoreConnection(SSOToken ssotoken)
                throws UMException
The constructor for opening the connection of the data repository. This object will be used to access of data objects in the directory via the interfaces Organization, User, Role, Group.
Parameters:
token - ssotoken SSO Token of the user
Throws:
UMException -  
Method Detail

getUserNamingAttribute

public java.lang.String getUserNamingAttribute()
                                        throws SSOException
Gets the user naming attribute.
Returns:
user naming attribute
Throws:
SSOException - if the ssotoke is no longer valid

getGroupNamingAttribute

public java.lang.String getGroupNamingAttribute()
                                         throws SSOException
Gets the group naming attribute.
Returns:
group naming attribute
Throws:
SSOException - if the ssotoke is no longer valid

getRoleNamingAttribute

public java.lang.String getRoleNamingAttribute()
                                        throws SSOException
Gets the role naming attribute.
Returns:
role naming attribute
Throws:
SSOException - if the ssotoke is no longer valid

getFilteredRoleNamingAttribute

public java.lang.String getFilteredRoleNamingAttribute()
                                                throws SSOException
Gets the filtered role naming attribute.
Returns:
filtered role naming attribute
Throws:
SSOException - if the ssotoke is no longer valid

getOrganizationNamingAttribute

public java.lang.String getOrganizationNamingAttribute()
                                                throws SSOException
Gets the org naming attribute.
Returns:
org naming attribute
Throws:
SSOException - if the SSO token is no longer valid.

getOrganizationalUnitNamingAttribute

public java.lang.String getOrganizationalUnitNamingAttribute()
                                                      throws SSOException
Gets the organizationalUnit naming attribute.
Returns:
organizationalUnit naming attribute
Throws:
SSOException - if the SSO token is no longer valid

getUser

public User getUser(java.lang.String userDN)
             throws UMException,
                    SSOException
Gets the handle to the User object represented by DN. However, the validity of the handle returned by this method cannot be guaranteed, since the object is created in memory, and not instantiated from the datastore. Using the User returned from this method may result in exceptions thrown in the later part of the application, if the DN is not valid or represents an entry that does not exist.

Validity of the DN can be verified by using isExists() method of the object returned.

Parameters:
userDN - user DN
Returns:
the handle to the User object represented by DN.
Throws:
UMException - if there is a Remote Exception.
SSOException - if ssoToken is invalid or expired.

getOrganizationDN

public java.lang.String getOrganizationDN(java.lang.String domainname,
                                          java.lang.String orgSearchTemplate)
                                   throws UMException,
                                          SSOException
Gets the DN of the organization, using the domainname provided and the searchTemplate (if provided). If searchTemplate is null, SDK uses the default searchTemplate to perform the orgDN search. If the rfc2247flag is set to true in the searchTemplate, the DC tree is used to obtain the org DN, otherwise an LDAP search is conducted using the searchfilter in the searchtemplate. All %V in the filter are replaced with "domainname". If the search returns more than one entries, then an Exception is thrown. Otherwise the DN obtained is returned.
Parameters:
domainname -  
orgSearchTemplate - template to use for the search.
Returns:
DN of the organization.
Throws:
UMException -  
SSOException -  

getOrganization

public Organization getOrganization(java.lang.String orgDN)
                             throws UMException
Gets the handle to the Organization object represented by DN. However, the validity of the handle returned by this method cannot be guaranteed, since the object is created in memory, and not instantiated from the datastore. Using the Organization returned from this method may result in exceptions thrown in the later part of the application, if the DN is not valid or represents an entry that does not exist.

Validity of the DN can be verified by using isExists() method of the object returned.

Parameters:
orgDN - organization DN
Returns:
handle to the Organization object represented by DN.
Throws:
UMException - if there is a remote exception.

getRole

public Role getRole(java.lang.String roleDN)
             throws UMException
Gets the handle to the Role object represented by DN. However, the validity of the handle returned by this method cannot be guaranteed, since the object is created in memory, and not instantiated from the datastore. Using the Role returned from this method may result in exceptions thrown in the later part of the application, if the DN is not valid or represents an entry that does not exist.

Validity of the DN can be verified by using isExists() method of the object returned.

Parameters:
roleDN - role DN
Returns:
the handle to the Role object represented by DN.
Throws:
UMException - if there is a remote exception.

getStaticGroup

public StaticGroup getStaticGroup(java.lang.String groupDN)
                           throws UMException
Gets the handle to the StaticGroup object represented by DN. However, the validity of the handle returned by this method cannot be guaranteed, since the object is created in memory, and not instantiated from the datastore. Using the StaticGroup returned from this method may result in exceptions thrown in the later part of the application, if the DN is not valid or represents an entry that does not exist.

Validity of the DN can be verified by using isExists() method of the object returned.

Parameters:
groupDN - group DN
Throws:
UMException - if there is a remote exception.

getAssignableDynamicGroup

public AssignableDynamicGroup getAssignableDynamicGroup(java.lang.String assignableDynamicGroupDN)
                                                 throws UMException
Gets the handle to the AssignableDynamicGroup object represented by DN. However, the validity of the handle returned by this method cannot be guaranteed, since the object is created in memory, and not instantiated from the datastore. Using the AssignableDynamicGroup returned from this method may result in exceptions thrown in the later part of the application, if the DN is not valid or represents an entry that does not exist.

Validity of the DN can be verified by using isExists() method of the object returned.

Parameters:
assignableDynamicGroupDN - assignable dynamic group DN
Returns:
handle to the AssignableDynamicGroup object.
Throws:
UMException - if there is a remote exception.

getDynamicGroup

public DynamicGroup getDynamicGroup(java.lang.String dynamicGroupDN)
                             throws UMException
Gets the handle to the DynamicGroup object represented by DN. However, the validity of the handle returned by this method cannot be guaranteed, since the object is created in memory, and not instantiated from the datastore. Using the DynamicGroup returned from this method may result in exceptions thrown in the later part of the application, if the DN is not valid or represents an entry that does not exist.

Validity of the DN can be verified by using isExists() method of the object returned.

Parameters:
dynamicGroupDN - group DN
Returns:
handle to the DynamicGroup object represented by DN.
Throws:
UMException - if there is a remote exception.