com.ca.jcs.sdkws.forwardinc
Class UserHelper

java.lang.Object
  extended by com.ca.jcs.sdkws.forwardinc.UserHelper
All Implemented Interfaces:
SDKWSHelper

public class UserHelper
extends Object
implements SDKWSHelper

Helper class for general user object related functions.

Author:
erstr01

Field Summary
static String COMPANY
           
static List<String> DB_ATTRS
          Supported database attributes
static String EMAIL
           
static String F_NAME
           
static String GROUPS
           
static String ID
          ConnectorMapTo names
static String L_NAME
           
static String NAME
           
static String PASSWORD
           
static String PHONE
           
static String TITLE
           
 
Constructor Summary
UserHelper()
           
 
Method Summary
 boolean doAdd(SDKWSMetaConnector connector, Attributes attrs)
          Adds a user to the endpoint.
 void doConnectionCheck(SDKWSMetaConnector connector)
          Method for doing a connection check.
 boolean doDelete(SDKWSMetaConnector connector, String id)
          Deletes user from the endpoint.
 Attributes doLookUp(SDKWSMetaConnector connector, String id, String[] attrIds)
          Look up the user from the endpoint.
 boolean doModify(SDKWSMetaConnector connector, String id, ModificationItem[] modItems)
          Modify a ws object from ws endpoint via ws operation.
 NamingEnumeration<SearchResult> doSearch(SDKWSMetaConnector connector, String connObjectClass, FilterInfo filterInfo)
          Searches for users with the given SQL query.
 Attributes makeAttributes(Object object, String[] attrIds)
          Creates an Attributes object from the supplied user.
 String makeRDN(Object object)
          Creates an RDN string for this type from the supplied object.
 void releaseHandle(SDKWSMetaConnector connector, int handleId)
          Informs the endpoint that this handle is no longer needed.
 UserServiceStub.User[] searchUsers(SDKWSMetaConnector connector, int handleId, int startIndex, int endIndex)
          searchUsers should have been called before using this method.
 UserServiceStub.Handle searchUsers(SDKWSMetaConnector connector, String query)
          Searches for users with the given SQL query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
ConnectorMapTo names

See Also:
Constant Field Values

TITLE

public static final String TITLE
See Also:
Constant Field Values

PASSWORD

public static final String PASSWORD
See Also:
Constant Field Values

COMPANY

public static final String COMPANY
See Also:
Constant Field Values

F_NAME

public static final String F_NAME
See Also:
Constant Field Values

L_NAME

public static final String L_NAME
See Also:
Constant Field Values

EMAIL

public static final String EMAIL
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

PHONE

public static final String PHONE
See Also:
Constant Field Values

GROUPS

public static final String GROUPS
See Also:
Constant Field Values

DB_ATTRS

public static final List<String> DB_ATTRS
Supported database attributes

Constructor Detail

UserHelper

public UserHelper()
Method Detail

doConnectionCheck

public void doConnectionCheck(SDKWSMetaConnector connector)
                       throws NamingException
Method for doing a connection check.

Specified by:
doConnectionCheck in interface SDKWSHelper
Parameters:
connector - the connector.
Throws:
NamingException - when error occurs.

doAdd

public boolean doAdd(SDKWSMetaConnector connector,
                     Attributes attrs)
              throws NamingException
Adds a user to the endpoint.

Specified by:
doAdd in interface SDKWSHelper
Parameters:
connector - the connector.
attrs - the attributes that make up the User object.
Returns:
true if successful.
Throws:
NamingException - if any errors occur.

doDelete

public boolean doDelete(SDKWSMetaConnector connector,
                        String id)
                 throws NamingException
Deletes user from the endpoint.

Specified by:
doDelete in interface SDKWSHelper
Parameters:
connector - the connector.
id - the ID of the user to remove.
Returns:
true if successful.
Throws:
NamingException - if any errors occur.

doModify

public boolean doModify(SDKWSMetaConnector connector,
                        String id,
                        ModificationItem[] modItems)
                 throws NamingException
Modify a ws object from ws endpoint via ws operation.

Specified by:
doModify in interface SDKWSHelper
Parameters:
connector - the connector.
id - the naming value of the item being modified.
modItems - contains the items to modify.
Returns:
true if successful.
Throws:
NamingException - when error occurs.

doSearch

public NamingEnumeration<SearchResult> doSearch(SDKWSMetaConnector connector,
                                                String connObjectClass,
                                                FilterInfo filterInfo)
                                         throws NamingException
Searches for users with the given SQL query. This method uses paging.

Specified by:
doSearch in interface SDKWSHelper
Parameters:
connector - the connector.
connObjectClass - the connector object class name. This will be used as the SearchResult's class name.
filterInfo - the LDAP filter object.
Returns:
an enumeration of the results.
Throws:
NamingException - if any errors occur.

doLookUp

public Attributes doLookUp(SDKWSMetaConnector connector,
                           String id,
                           String[] attrIds)
                    throws NamingException
Look up the user from the endpoint.

Specified by:
doLookUp in interface SDKWSHelper
Parameters:
connector - the connector.
id - the ID of the user to look up.
attrIds - contains the target object's attribute ids to lookup.
Returns:
if successful, a user.
Throws:
NamingException - if any errors occur.

searchUsers

public UserServiceStub.Handle searchUsers(SDKWSMetaConnector connector,
                                          String query)
                                   throws NamingException
Searches for users with the given SQL query.

Parameters:
connector - the connector.
query - the query to use.
Returns:
the handle to the result set.
Throws:
NamingException - if any errors occur.

searchUsers

public UserServiceStub.User[] searchUsers(SDKWSMetaConnector connector,
                                          int handleId,
                                          int startIndex,
                                          int endIndex)
                                   throws NamingException
searchUsers should have been called before using this method. This method is for working through a result set.

Parameters:
connector - the connector.
handleId - the result set handle id.
startIndex - the start index (first record to get).
endIndex - the end index.
Returns:
a list of users from the page result set on the endpoint.
Throws:
NamingException - if any errors occur.

releaseHandle

public void releaseHandle(SDKWSMetaConnector connector,
                          int handleId)
                   throws NamingException
Informs the endpoint that this handle is no longer needed.

Parameters:
connector - the connector.
handleId - the result set handle id.
Throws:
NamingException - if there are any errors releasing the handle.

makeAttributes

public Attributes makeAttributes(Object object,
                                 String[] attrIds)
                          throws NamingException
Creates an Attributes object from the supplied user.

Specified by:
makeAttributes in interface SDKWSHelper
Parameters:
object - the user.
attrIds - the attribute ids to add to the attrs.
Returns:
the attributes.
Throws:
NamingException - if the user is null or it's ID is null.

makeRDN

public String makeRDN(Object object)
               throws NamingException
Creates an RDN string for this type from the supplied object.

Specified by:
makeRDN in interface SDKWSHelper
Parameters:
object - the object to get the details from to make the RDN.
Returns:
the RDN.
Throws:
NamingException - if the user is null or it's ID is null.


Created 2011-07-14 13:27 EST