Package ca.saultstemarie.dsjquery
Class DSJQuerySessionHandler
- java.lang.Object
-
- ca.saultstemarie.dsjquery.DSJQuerySessionHandler
-
public class DSJQuerySessionHandler extends java.lang.Object
DSJQuery Session Handler- Author:
- d.gowans
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SERVER_PORT
1099, the most commonly used port for DocuShare connections.static java.lang.String
DEFAULT_SESSION_DOMAIN
"DocuShare", the domain used for users managed by the DocuShare server.
-
Constructor Summary
Constructors Constructor Description DSJQuerySessionHandler()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
closeOpenSessions()
Closes all DSSession objects currently queued.static com.xerox.docushare.DSSession
getSession()
Gets a DSSession object from a pool of available objects.static boolean
isServerSetup()
Tests if the DocuShare server details have been initialized.static boolean
isSessionSetup()
Tests if the DocuShare session login details have been initialized.static void
returnSession(com.xerox.docushare.DSSession dsSession)
Returns a DSSession object to the pool for other threads to use.static void
serverSetup(java.lang.String serverName)
Initializes DSJQuery with DocuShare server details.static void
serverSetup(java.lang.String serverName, int serverPort)
Initializes DSJQuery with complete DocuShare server details.static void
sessionSetup(java.lang.String userName, java.lang.String password)
Initializes DSJQuery with session login details.static void
sessionSetup(java.lang.String userDomain, java.lang.String userName, java.lang.String password)
Initializes DSJQuery with complete session login details.
-
-
-
Field Detail
-
DEFAULT_SERVER_PORT
public static final int DEFAULT_SERVER_PORT
1099, the most commonly used port for DocuShare connections.- See Also:
- Constant Field Values
-
DEFAULT_SESSION_DOMAIN
public static final java.lang.String DEFAULT_SESSION_DOMAIN
"DocuShare", the domain used for users managed by the DocuShare server.- See Also:
- Constant Field Values
-
-
Method Detail
-
serverSetup
public static void serverSetup(java.lang.String serverName) throws DSJQueryException
Initializes DSJQuery with DocuShare server details. Uses the default DocuShare port number.- Parameters:
serverName
- - DocuShare server name- Throws:
DSJQueryException
-
serverSetup
public static void serverSetup(java.lang.String serverName, int serverPort) throws DSJQueryException
Initializes DSJQuery with complete DocuShare server details.- Parameters:
serverName
- - DocuShare server nameserverPort
- - DocuShare server port- Throws:
DSJQueryException
-
isServerSetup
public static boolean isServerSetup()
Tests if the DocuShare server details have been initialized.- Returns:
- TRUE if the server name has been set.
-
sessionSetup
public static void sessionSetup(java.lang.String userName, java.lang.String password) throws DSJQueryException
Initializes DSJQuery with session login details. Uses the default "DocuShare" domain.- Parameters:
userName
- - DocuShare user namepassword
- - DocuShare password- Throws:
DSJQueryException
-
sessionSetup
public static void sessionSetup(java.lang.String userDomain, java.lang.String userName, java.lang.String password) throws DSJQueryException
Initializes DSJQuery with complete session login details. Note that this user must have read permissions for all objects it queries. This user will also be associated with any modifications it makes through DSJQuery.- Parameters:
userDomain
- - The user domain nameuserName
- - The user namepassword
- - The password- Throws:
DSJQueryException
-
isSessionSetup
public static boolean isSessionSetup()
Tests if the DocuShare session login details have been initialized.- Returns:
- TRUE if the session login details have been set.
-
getSession
public static com.xerox.docushare.DSSession getSession() throws java.lang.InterruptedException, com.xerox.docushare.DSException
Gets a DSSession object from a pool of available objects.- Returns:
- A connected DSSession object.
- Throws:
java.lang.InterruptedException
com.xerox.docushare.DSException
-
returnSession
public static void returnSession(com.xerox.docushare.DSSession dsSession)
Returns a DSSession object to the pool for other threads to use.- Parameters:
dsSession
- - A DSSession object that will no longer be used by the thread returning it.
-
closeOpenSessions
public static void closeOpenSessions()
Closes all DSSession objects currently queued. This method should be called when DSJQuery is done being used, or won't be used for a while.
-
-