com.senn.magic.util
Class DSUtils

java.lang.Object
  extended by com.senn.magic.util.DSUtils

public final class DSUtils
extends Object

This class contains useful methods for DocuShare actions.
You need to include the necessary DocuShare jars (dsapi.jar) in your classpath to be able to use these methods.

Since:
3.2
Author:
Bart Thierens
Last modification: 29/01/2010
See Also:
"DocuShare 6.0 API Specification"

Method Summary
static com.xerox.docushare.rm.DSRMSession createRMSession(String host, int port, String user, String password, String domain)
          The method creates a DocuShare RM-session with the provided credentials.
static com.xerox.docushare.DSSession createSession(String host, int port, String user, String password, String domain)
          The method creates a DocuShare session with the provided credentials.
static com.xerox.docushare.DSObject getObject(String handle, com.xerox.docushare.DSSession session)
          This method gets the object with the specified handle.
static boolean objectExists(com.xerox.docushare.DSHandle handle, com.xerox.docushare.DSSession session)
          This method checks if an object with specified handle exists
static boolean objectExists(String handle, com.xerox.docushare.DSSession session)
          This method checks if an object with specified handle exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSession

public static com.xerox.docushare.DSSession createSession(String host,
                                                          int port,
                                                          String user,
                                                          String password,
                                                          String domain)
                                                   throws com.xerox.docushare.DSException
The method creates a DocuShare session with the provided credentials.

Parameters:
host - the DocuShare host (ie. "localhost" or "192.168.10.13")
port - the DocuShare port (usually 1099)
user - the DocuShare username
password - the DocuShare password
domain - the DocuShare domain (usually "DocuShare")
Returns:
DSSession - a DocuShare session for the provided credentials
Throws:
com.xerox.docushare.DSException

createRMSession

public static com.xerox.docushare.rm.DSRMSession createRMSession(String host,
                                                                 int port,
                                                                 String user,
                                                                 String password,
                                                                 String domain)
                                                          throws com.xerox.docushare.DSException
The method creates a DocuShare RM-session with the provided credentials.

a DocuShare RM-session object (DSRMSession) represents a connection to the server to make Records Management API calls.

Parameters:
host - the DocuShare host (ie. "localhost" or "192.168.10.13")
port - the DocuShare port (usually 1099)
user - the DocuShare username
password - the DocuShare password
domain - the DocuShare domain (usually "DocuShare")
Returns:
DSRMSession - a DocuShare RM session for the provided credentials
Throws:
com.xerox.docushare.DSException

getObject

public static com.xerox.docushare.DSObject getObject(String handle,
                                                     com.xerox.docushare.DSSession session)
                                              throws com.xerox.docushare.DSException
This method gets the object with the specified handle.
This method shortens the normal approach because you can just provide the handle as a String instead of having to create a DSHandle instance.

This method will throw a DSException if the object doesn't exist or is not accessible due to ACL restrictions.

Parameters:
handle - the object handle as a String
session - the DocuShare session
Returns:
DSObject - the object to which @param handle refers
Throws:
com.xerox.docushare.DSException

objectExists

public static boolean objectExists(String handle,
                                   com.xerox.docushare.DSSession session)
                            throws com.xerox.docushare.DSException
This method checks if an object with specified handle exists

Parameters:
handle - the object handle as a String
session - the DocuShare session
Returns:
boolean - true if the object exists, false if it doesn't
Throws:
com.xerox.docushare.DSException
See Also:
objectExists(DSHandle, DSSession)

objectExists

public static boolean objectExists(com.xerox.docushare.DSHandle handle,
                                   com.xerox.docushare.DSSession session)
                            throws com.xerox.docushare.DSException
This method checks if an object with specified handle exists

Parameters:
handle - the object handle as a DSHandle object
session - the DocuShare session
Returns:
boolean - true if the object exists, false if it doesn't
Throws:
com.xerox.docushare.DSException
See Also:
objectExists(String, DSSession)