com.webmethods.caf.faces.data.csp
Class CSPSessionManager

java.lang.Object
  extended by com.webmethods.caf.faces.bean.BaseFacesBean
      extended by com.webmethods.caf.faces.bean.BaseFacesSessionBean
          extended by com.webmethods.caf.faces.data.csp.CSPSessionManager
All Implemented Interfaces:
IPageFlowScopeAdapter, Serializable

public class CSPSessionManager
extends BaseFacesSessionBean
implements Serializable

This class is intended to be something like a helper for creating Session object and getting IRetrieval module.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
fExpireWithPageFlow
 
Fields inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
DATA_BINDING_CLIENTS, OUTCOME_ERROR, OUTCOME_OK, resourcesProviders
 
Constructor Summary
CSPSessionManager()
           
 
Method Summary
 void connect()
           
static CSPSessionManager create(String serverName, String host, int port, int streamingPort)
           
 Session createSession(Credentials credentials)
          Creates and returns Session for a given username and password
 void disconnect()
           
protected  void finalize()
           
static ConversionService getConversionService(Session session)
           
 ConversionService getConversionService(String username, String password)
           
 Credentials getCredentials()
           
 Session getCurrentSession()
          Check if session is open and if not create a new Session.
 String getHost()
           
static String getHost(Session session)
           
 String getImpersonatedUser()
           
 int getPort()
           
static RetrievalModule getRetrievalModule(Session session)
           
 RetrievalModule getRetrievalModule(String username, String password)
           
static SecurityModule getSecurityModule(Session session)
           
 SecurityModule getSecurityModule(String username, String password)
           
 String getServerName()
           
 int getStreamingPort()
           
 boolean isConnected()
           
protected  void release()
          Override this method to release any resources associated with this session.
 void setCredentials(Credentials credentials)
           
 void setHost(String host)
           
 void setImpersonatedUser(String userToImpersonate)
           
 void setPort(int port)
           
 void setServerName(String serverName)
           
 void setStreamingPort(int streamingPort)
           
 
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesSessionBean
getExpireWithPageFlow, setExpireWithPageFlow, valueBound, valueUnbound
 
Methods inherited from class com.webmethods.caf.faces.bean.BaseFacesBean
createMethodBinding, createValueBinding, error, error, error, error, error, getBean, getFacesContext, getLocale, getResourceInputStream, getResources, getResourcesProvider, getRootCause, getStackTrace, getTreeAttribute, isUserInRole, log, log, log, putTreeAttribute, resetDataBindingClients, resolveDataBinding, resolveDataBinding, resolveExpression, setValue
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSPSessionManager

public CSPSessionManager()
Method Detail

getImpersonatedUser

public String getImpersonatedUser()

setImpersonatedUser

public void setImpersonatedUser(String userToImpersonate)

create

public static CSPSessionManager create(String serverName,
                                       String host,
                                       int port,
                                       int streamingPort)

createSession

public Session createSession(Credentials credentials)
                      throws AuthenticationException,
                             Exception
Creates and returns Session for a given username and password

Parameters:
credentials - - used to specify username/password
Returns:
a Session object for a given username and password
Throws:
Exception
AuthenticationException

getRetrievalModule

public static RetrievalModule getRetrievalModule(Session session)
                                          throws COMM_Exception
Throws:
COMM_Exception

getRetrievalModule

public RetrievalModule getRetrievalModule(String username,
                                          String password)
                                   throws AuthenticationException,
                                          Exception
Throws:
AuthenticationException
Exception

getConversionService

public static ConversionService getConversionService(Session session)
                                              throws COMM_Exception
Throws:
COMM_Exception

getConversionService

public ConversionService getConversionService(String username,
                                              String password)
                                       throws AuthenticationException,
                                              Exception
Throws:
AuthenticationException
Exception

getSecurityModule

public static SecurityModule getSecurityModule(Session session)
                                        throws COMM_Exception
Throws:
COMM_Exception

getSecurityModule

public SecurityModule getSecurityModule(String username,
                                        String password)
                                 throws COMM_Exception,
                                        AuthenticationException,
                                        Exception
Throws:
COMM_Exception
AuthenticationException
Exception

release

protected void release()
Description copied from class: BaseFacesSessionBean
Override this method to release any resources associated with this session. Please note, the FacesContext is not valid for this function

Specified by:
release in class BaseFacesSessionBean

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

connect

public void connect()
             throws Exception
Throws:
Exception

disconnect

public void disconnect()
                throws Exception
Throws:
Exception

isConnected

public boolean isConnected()

getCurrentSession

public Session getCurrentSession()
                          throws Exception
Check if session is open and if not create a new Session. If the in the Credentials a user to impersonate is passed switch the scope of the Session to the new user. getSecurityModule(session).isUser(newUser) validates the newUser.

Returns:
Throws:
Exception

getCredentials

public Credentials getCredentials()

setCredentials

public void setCredentials(Credentials credentials)

getServerName

public String getServerName()

getHost

public String getHost()

getHost

public static String getHost(Session session)
                      throws COMM_Exception
Throws:
COMM_Exception

getPort

public int getPort()

getStreamingPort

public int getStreamingPort()

setServerName

public void setServerName(String serverName)

setHost

public void setHost(String host)

setPort

public void setPort(int port)

setStreamingPort

public void setStreamingPort(int streamingPort)