com.sap.mdm.session
Class AbstractSessionContext

java.lang.Object
  extended bycom.sap.mdm.session.AbstractSessionContext
All Implemented Interfaces:
MdmSessionContext, Serializable
Direct Known Subclasses:
ServerSessionContext

public abstract class AbstractSessionContext
extends Object
implements MdmSessionContext

This class is abstract implementation of MdmSessionContext interface.

See Also:
ServerSessionContext, RepositorySessionContext, UserSessionContext, Serialized Form

Constructor Summary
AbstractSessionContext()
          Constructor
AbstractSessionContext(AbstractSessionContext ctx)
          Copy Constructor
 
Method Summary
 boolean equals(Object obj)
           
 String getApplicationId()
           
 String getApplicationName()
          Returns unique application name.
 int getConnectionType()
          Returns the connection type
 String getContextIdentifier()
          Returns unique context identifier.
 MdmSecureSocketFactory getSocketFactory()
          Returns the instance of MdmSocketFactory used for creating a secure socket
 int hashCode()
           
 boolean isTrustedConnection()
          Indicates if connection should be created as trusted connection In this case the user password does not play a role
 boolean isWebServiceContext()
           
 void readFromString(String contextString)
          Initializes context state from the binary string representation of context object.
 void setApplicationId(String applicationId)
           
 void setApplicationName(String applicationName)
          Sets the unique application Name.
 void setConnectionType(int connectionType)
          Sets the connection type
 void setContextIdentifier(String contextIdentifier)
          Sets the unique context identifier (for example, HttpSession ID) This is optional property.
 void setHashCode(int hashCode)
          Sets hash code.
 void setSocketFactory(MdmSecureSocketFactory socketFactory)
          Sets MdmSocketFactory that will be used for creating a secure socket
 void setTrustedConnection(boolean isTrustedConnection)
          Sets connection as trusted connection In this case the user password does not play a role
 String writeToString()
          Creates binary string representation of the context object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sap.mdm.session.MdmSessionContext
getFullyQualifiedServerName, getServerName
 

Constructor Detail

AbstractSessionContext

public AbstractSessionContext()
Constructor


AbstractSessionContext

public AbstractSessionContext(AbstractSessionContext ctx)
Copy Constructor

Method Detail

hashCode

public int hashCode()

equals

public boolean equals(Object obj)

isTrustedConnection

public boolean isTrustedConnection()
Description copied from interface: MdmSessionContext
Indicates if connection should be created as trusted connection In this case the user password does not play a role

Specified by:
isTrustedConnection in interface MdmSessionContext
Returns:
true if connection should be trusted, false otherwise

setTrustedConnection

public void setTrustedConnection(boolean isTrustedConnection)
Description copied from interface: MdmSessionContext
Sets connection as trusted connection In this case the user password does not play a role

Specified by:
setTrustedConnection in interface MdmSessionContext
Parameters:
isTrustedConnection - true if connection should be trusted

getConnectionType

public int getConnectionType()
Description copied from interface: MdmSessionContext
Returns the connection type

Specified by:
getConnectionType in interface MdmSessionContext
Returns:
the connection type
See Also:
for connection type constants

setConnectionType

public void setConnectionType(int connectionType)
Description copied from interface: MdmSessionContext
Sets the connection type

Specified by:
setConnectionType in interface MdmSessionContext
Parameters:
connectionType - the connection type
See Also:
for connection type constants

getApplicationId

public String getApplicationId()
Specified by:
getApplicationId in interface MdmSessionContext

getApplicationName

public String getApplicationName()
Description copied from interface: MdmSessionContext
Returns unique application name. This is optional property used while creating a new session through the SessionManager It also is used when the MdmPasswordStorage is used in SessionManager. By default the application ID is null.

Specified by:
getApplicationName in interface MdmSessionContext
Returns:
the application name
See Also:
SessionManager, MdmPasswordStorage

setApplicationId

public void setApplicationId(String applicationId)
Specified by:
setApplicationId in interface MdmSessionContext

setApplicationName

public void setApplicationName(String applicationName)
Description copied from interface: MdmSessionContext
Sets the unique application Name. This is optional property used while creating a new session through the SessionManager It also is used when the MdmPasswordStorage is used in SessionManager. By default the application Name is null.

Specified by:
setApplicationName in interface MdmSessionContext
Parameters:
applicationName - the unique application name
See Also:
SessionManager, MdmPasswordStorage

getContextIdentifier

public String getContextIdentifier()
Description copied from interface: MdmSessionContext
Returns unique context identifier. This is optional property. By default the context identifier is null.

Specified by:
getContextIdentifier in interface MdmSessionContext
Returns:
the application ID
See Also:
SessionManager, MdmPasswordStorage

setContextIdentifier

public void setContextIdentifier(String contextIdentifier)
Description copied from interface: MdmSessionContext
Sets the unique context identifier (for example, HttpSession ID) This is optional property. By default the context identifier is null. If this parameter is specified then the instance of the context is identified by combination of server name + repository name + user name + context identifier, otherwise the context is identified by object reference.

Specified by:
setContextIdentifier in interface MdmSessionContext
Parameters:
contextIdentifier - the unique context identifier
See Also:
SessionManager, MdmPasswordStorage

getSocketFactory

public MdmSecureSocketFactory getSocketFactory()
Description copied from interface: MdmSessionContext
Returns the instance of MdmSocketFactory used for creating a secure socket

Specified by:
getSocketFactory in interface MdmSessionContext
Returns:
the instance of MdmSocketFactory

setSocketFactory

public void setSocketFactory(MdmSecureSocketFactory socketFactory)
Description copied from interface: MdmSessionContext
Sets MdmSocketFactory that will be used for creating a secure socket

Specified by:
setSocketFactory in interface MdmSessionContext
Parameters:
socketFactory - the instance of MdmSocketFactory

setHashCode

public void setHashCode(int hashCode)
Sets hash code.

Parameters:
hashCode - hash code.

writeToString

public String writeToString()
                     throws IOException
Description copied from interface: MdmSessionContext
Creates binary string representation of the context object.

Specified by:
writeToString in interface MdmSessionContext
Returns:
string representation of context object.
Throws:
IOException
See Also:
MdmSessionContext.readFromString(String)

readFromString

public void readFromString(String contextString)
                    throws IOException,
                           ClassNotFoundException
Description copied from interface: MdmSessionContext
Initializes context state from the binary string representation of context object.

Specified by:
readFromString in interface MdmSessionContext
Parameters:
contextString - string representation of context object.
Throws:
ClassNotFoundException
IOException
See Also:
MdmSessionContext.writeToString()

isWebServiceContext

public boolean isWebServiceContext()


Copyright 2004-2007 by SAP AG. All Rights Reserved.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies (SAP Group) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.