Skip navigation links


com.essbase.eas.essbase.server
Class EssSession

java.lang.Object
  extended by com.essbase.eas.essbase.server.EssSession

All Implemented Interfaces:
ISession

public class EssSession
extends java.lang.Object
implements ISession

Implements the Essbase Session object. An instance of this object contains the following information.

  1. C MaxL Session ID
Version:
1.00, 05/08/2000 1.1.0, 08/04/2000 Upgraded to PW Framework 0.9
Author:
Hank Cox
See Also:
EssSessionPrimitives, ISession

Field Summary
static short ESS_SESSION_ATTRIBUTE_COUNT
          The number of attributes expected by this session type.
static short ESS_SESSION_INVALID_ID
          Essbase session id
static java.lang.String GET_ACTIVE_ESSBASE_NODE
           

 

Constructor Summary
EssSession()
          Creates an instance of a EssSession object.
EssSession(EssSession session)
           

 

Method Summary
protected  void addConnectionMessages()
           
 boolean connect()
          Implements the ISession connect method.
 ISession createNewSession()
          Creates a new session
 boolean disconnect()
          Implements the ISession disconnect method.
 boolean execute(java.lang.String cmd)
           
protected  void finalize()
          Finalizer to close the session when destroying
 java.lang.String getActiveEssbaseNode()
           
 long getAPICtx()
           
 long getAPIInst()
           
 java.util.ArrayList getAttributes()
          Implements the ISession getAttributes method.
 java.lang.String getClusterUrl()
          This is convenience method for getting either server or cluster url to connect to Essbase server
 com.essbase.maxl.MaxlConnection getConnection()
           
protected  java.util.List getConnectionMessages()
           
 ContextHandle getContextHandle()
           
 ContextHandle getContextHandle(boolean reconnect)
           
 java.util.ArrayList getErrorMessage()
          Returns a list of errors for the session
 InstanceHandle getInstanceHandle()
           
 com.essbase.maxl.Message getMessage()
           
 com.essbase.maxl.Message getNextMessage()
           
 java.lang.String getPassword()
          Gets the password used in this session.
 java.lang.String getServerName()
          Gets the server name this session was created for.
 Version getServerVersion()
           
 long getSessionId()
           
 java.lang.Object getSessionID()
          Implements the ISession getSessionID method.
 boolean getSetBusy()
          Returns true if the session is not busy and the busy flag is set
 java.lang.String getToken()
          The token is a users credentials when a session is externally authenticated This token is from the Hyperion Security SDK
 java.lang.String getUserName()
          Gets the user name this session was created for.
 void invalidateConnection()
          Ensures that the session id is an invalid value.
 boolean isBusy()
          Returns true if the session is busy
 boolean isConnected()
          Implements the ISession isConnected method.
 boolean isTemporary()
          Returns if the session is a temporary one
 boolean isValidConnection()
          Checks for a valid context handle
 boolean reconnect()
          Implements the ISession reconnect method.
 void resetValidationTimeStamp()
          Resets the validation time stamp.
 void setAttributes(java.util.ArrayList attributes)
          Implements the ISession setAttributes method.
 void setBusy(boolean busy)
          Sets/Reset the busy flag for the session
 void setClusterUrl(java.lang.String clusterUrl)
           
 void setConnection(com.essbase.maxl.MaxlConnection conn)
          Sets the sessionID for this Essbase session.
 void setPassword(java.lang.String pwd)
          Sets the password used in this session.
 void setServerName(java.lang.String server)
          Sets the server name this session was created for.
 void setServerVersion(Version version)
           
 void setSessionId(long id)
           
 void setSessionID(java.lang.Object conn)
          Implements the ISession setSessionID method.
 void setTemporary()
          Sets the session to be a temporary one which may not have a long life span.
 void setToken(java.lang.String tokenString)
          Set a token when a user is externally authenticated
 void setUserName(java.lang.String user)
          Sets the user name this session was created for.
 boolean useToken()
          A token is used when a user is externally authenticated.

 

Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

ESS_SESSION_INVALID_ID

public static short ESS_SESSION_INVALID_ID
Essbase session id

ESS_SESSION_ATTRIBUTE_COUNT

public static final short ESS_SESSION_ATTRIBUTE_COUNT
The number of attributes expected by this session type.
See Also:
Constant Field Values

GET_ACTIVE_ESSBASE_NODE

public static final java.lang.String GET_ACTIVE_ESSBASE_NODE
See Also:
Constant Field Values

Constructor Detail

EssSession

public EssSession()
Creates an instance of a EssSession object. Create one Maxl object per session.

EssSession

public EssSession(EssSession session)

Method Detail

connect

public boolean connect()
                throws java.lang.Exception
Implements the ISession connect method. Provides a direct pass through to the primitive.
Specified by:
connect in interface ISession
Returns:
true if the session connected
Throws:
java.lang.Exception - for an error while connecting

reconnect

public boolean reconnect()
                  throws java.lang.Exception
Implements the ISession reconnect method. Provides a direct pass through to the primitive.
Specified by:
reconnect in interface ISession
Returns:
true if reconnect was successful
Throws:
java.lang.Exception - for an error while reconnecting

disconnect

public boolean disconnect()
Implements the ISession disconnect method. Provides a direct pass through to the primitive.
Specified by:
disconnect in interface ISession
Returns:
true if disconnected

isConnected

public boolean isConnected()
Implements the ISession isConnected method. Provides a direct pass through to the primitive.
Specified by:
isConnected in interface ISession
Returns:
true if session is connected

isValidConnection

public boolean isValidConnection()
Checks for a valid context handle
Specified by:
isValidConnection in interface ISession
Returns:
true if connection is valid

resetValidationTimeStamp

public void resetValidationTimeStamp()
Resets the validation time stamp. When a successful operation goes' thro we know we had a valid context.

getAttributes

public java.util.ArrayList getAttributes()
Implements the ISession getAttributes method. Returns the following objects in the ArrayList:
  1. Session Type
  2. Server Name Upper Case
  3. User Name
  4. User Password
  5. Server Name as entered
  6. Token if available
Specified by:
getAttributes in interface ISession
Returns:
the attributes of the session

setAttributes

public void setAttributes(java.util.ArrayList attributes)
Implements the ISession setAttributes method. Expects the vector to contain the following information.
  1. Class name matching this class at position 0.
  2. Server Name (in UPPER CASE) at Index position 1.
  3. User name at index position 2.
  4. Password at index position 3.
  5. Server Name (as entered) at Index position 4.
  6. Token supercedes name and password at Index position 5.
Specified by:
setAttributes in interface ISession
Parameters:
attributes - - ArrayList containing attributes for this session. WARNING: This method should throw an exception if the attributes aren't as specified of the correct type and in the correct number.

getSessionID

public java.lang.Object getSessionID()
Implements the ISession getSessionID method. Bundles the instance variable sessionID into a Java Short object and returns it.
Specified by:
getSessionID in interface ISession

getConnection

public com.essbase.maxl.MaxlConnection getConnection()

getAPICtx

public long getAPICtx()

getAPIInst

public long getAPIInst()

getContextHandle

public ContextHandle getContextHandle()

getContextHandle

public ContextHandle getContextHandle(boolean reconnect)

getInstanceHandle

public InstanceHandle getInstanceHandle()

setSessionID

public void setSessionID(java.lang.Object conn)
Implements the ISession setSessionID method. Determines if the object is a MaxlSession and, if so, uses the value to store into the instance variable sessionID
Specified by:
setSessionID in interface ISession

setConnection

public void setConnection(com.essbase.maxl.MaxlConnection conn)
Sets the sessionID for this Essbase session.
Parameters:
id - - the new session id returned from MaxL.

invalidateConnection

public void invalidateConnection()
Ensures that the session id is an invalid value. Does not attempt to disconnect.

getServerName

public java.lang.String getServerName()
Gets the server name this session was created for.
Specified by:
getServerName in interface ISession
Returns:
serverName - String representing the server name.

setServerName

public void setServerName(java.lang.String server)
Sets the server name this session was created for.
Parameters:
server - - String representing the server name.

getClusterUrl

public final java.lang.String getClusterUrl()
This is convenience method for getting either server or cluster url to connect to Essbase server
Returns:
first available APS server url, if not configured for Cluster then it will return serverName.

setClusterUrl

public final void setClusterUrl(java.lang.String clusterUrl)

getActiveEssbaseNode

public java.lang.String getActiveEssbaseNode()

getUserName

public java.lang.String getUserName()
Gets the user name this session was created for.
Specified by:
getUserName in interface ISession
Returns:
userName = String representing the user name.

setUserName

public void setUserName(java.lang.String user)
Sets the user name this session was created for.
Parameters:
user - - String representing the user name.

getPassword

public java.lang.String getPassword()
Gets the password used in this session.
Specified by:
getPassword in interface ISession
Returns:
password - String representing the password

setPassword

public void setPassword(java.lang.String pwd)
Sets the password used in this session.
Parameters:
pwd - - String representing the new password.

getToken

public java.lang.String getToken()
The token is a users credentials when a session is externally authenticated This token is from the Hyperion Security SDK
Returns:
the token for this session

setToken

public void setToken(java.lang.String tokenString)
Set a token when a user is externally authenticated
Parameters:
tokenString - the token

useToken

public boolean useToken()
A token is used when a user is externally authenticated. If a token should be used return that here
Returns:
true if a token should be used

finalize

protected void finalize()
                 throws java.lang.Throwable
Finalizer to close the session when destroying
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

getErrorMessage

public java.util.ArrayList getErrorMessage()
Description copied from interface: ISession
Returns a list of errors for the session
Specified by:
getErrorMessage in interface ISession
Returns:

execute

public boolean execute(java.lang.String cmd)

getMessage

public com.essbase.maxl.Message getMessage()

getNextMessage

public com.essbase.maxl.Message getNextMessage()

setServerVersion

public void setServerVersion(Version version)

getServerVersion

public Version getServerVersion()

isBusy

public boolean isBusy()
Returns true if the session is busy
Specified by:
isBusy in interface ISession
Returns:

getSetBusy

public boolean getSetBusy()
Description copied from interface: ISession
Returns true if the session is not busy and the busy flag is set
Specified by:
getSetBusy in interface ISession
Returns:

setBusy

public void setBusy(boolean busy)
Sets/Reset the busy flag for the session
Specified by:
setBusy in interface ISession
Parameters:
busy -

isTemporary

public boolean isTemporary()
Description copied from interface: ISession
Returns if the session is a temporary one
Specified by:
isTemporary in interface ISession
Returns:

setTemporary

public void setTemporary()
Sets the session to be a temporary one which may not have a long life span.
Specified by:
setTemporary in interface ISession

createNewSession

public ISession createNewSession()
Description copied from interface: ISession
Creates a new session
Specified by:
createNewSession in interface ISession
Returns:
the new session

setSessionId

public void setSessionId(long id)

getSessionId

public long getSessionId()

addConnectionMessages

protected void addConnectionMessages()

getConnectionMessages

protected java.util.List getConnectionMessages()

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.