com.businessobjects.dsws.session
Class Session

java.lang.Object
  extended by com.businessobjects.dsws.Consumer
      extended by com.businessobjects.dsws.session.Session
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class Session
extends Consumer
implements java.io.Externalizable

The Session class is a proxy that can consult the Session Web Service and that is mapped on its WSDL.
The Session class provides services such as getVersion, login, loginWithToken, logout, changePassword, getServerInfo, setDictionary, getDictionary, resetSessionTimeOut...

Example:

URL objURLSession = new URL("http://boserver:port/dswsbobje/services/session");
Connection objConnection = new Connection(objURLSession);
Session objSession = new Session(objConnection);

EnterpriseCredential objEnterpriseCredential = new EnterpriseCredential();
objEnterpriseCredential.setLogin("John");
objEnterpriseCredential.setPassword("MyPassword1973");
objEnterpriseCredential.setDomain("MyCMS");
objEnterpriseCredential.setLocale("en_US");
objEnterpriseCredential.setTimeZone("GMT+01:00");

SessionInfo objSessionInfo = objSession.login(objEnterpriseCredential);

See Also:
Connection, ProxyParameters, EnterpriseCredential, SSLWrapper, Serialized Form

Constructor Summary
Session()
           
Session(Connection objConnection)
          Instantiate a new Session object using a Connection.
Session(Connection objConnection, ConnectionState objConnectionState)
          Instantiate a new Session object using Connection and ConnectionState objects.
Session(java.lang.String strImplementation)
          Internal Use Only.
Session(java.lang.String strImplementation, ConnectionState objConnectionState)
          Internal Use Only.
 
Method Summary
 void changePassword(java.lang.String oldPassword, java.lang.String newPassword)
          Change the current user's password.
 java.lang.String[] getAssociatedServicesURL(java.lang.String strServiceName)
          Deprecated. As of XI 4.0.
 Entry[] getDictionary(DictionaryType.Enum dictionary)
          Return an array of Entries for the User or Server.
static Session getInstance(Consumer objConsumer, java.lang.String strURL)
          GetInstance static method returns a Session by passing the Web Service URL and an already logged Consumer object.
 java.lang.String getSAPAssertionTicket(java.lang.String targetSystemID)
          For internal use only Get an assertion ticket for the currently logged on user, to the specified SAP system.
 java.lang.String getSecondaryCredential(java.lang.String credentialKey)
           
 ServerInfo getServerInfo()
          Return information about the server being accessed by the Web Services.
 ServerInfoDetails getServerInfoDetails()
          Return information about the server being accessed by the Web Services.
 SessionInfo getSessionInfo()
          Returns the information pertaining to a user's session.
 SupportedPVLs getSupportedPVLs()
           
 java.lang.String getVersion()
          Returns a string containing the version of Web Services being used.The format of the string returned that indicates the version number is as follows: .
 SessionInfo login(Credential credential)
          Open a Web Services session by providing full Enterprise Credentials.
 SessionInfo loginWithSerializedSession(java.lang.String serializedSession, LoginOption option)
          Open a Web Services session by providing a login serialized session.
 SessionInfo loginWithSerializedSession(java.lang.String serializedSession, java.lang.String locale, java.lang.String timezone, java.lang.String reportedIPAddress, java.lang.String reportedHostName)
           
 SessionInfo loginWithToken(java.lang.String token, LoginOption option)
          Open a Web Services session by providing a login token.
 SessionInfo loginWithToken(java.lang.String token, java.lang.String locale, java.lang.String timezone)
          Open a Web Services session by providing a login token.
 SessionInfo loginWithToken(java.lang.String token, java.lang.String locale, java.lang.String timezone, java.lang.String reportedIPAddress, java.lang.String reportedHostName)
          Open a Web Services session by providing a login token.
 void logout()
          Log out of a Web Services session.
 void readExternal(java.io.ObjectInput in)
           
 void removeSecondaryCredential(java.lang.String credentialKey)
           
 void resetSessionTimeOut()
          Notifies the web service provider to keep the web service session alive.
 void setDictionary(DictionaryType.Enum dictionary, Entry[] entries)
          The SetDictionary method sets an array of Entries for the User or Server.
 void setPVLocale(java.lang.String pvl)
           
 void setSecondaryCredential(java.lang.String credentialKey, java.lang.String credentialValue)
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class com.businessobjects.dsws.Consumer
displayException, GetAxisFaultDetails, getConnection, getConnection, getConnectionState, getConsumer, getConsumer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session(java.lang.String strImplementation)
        throws AxisFault

Internal Use Only.

Throws:
AxisFault

Session

public Session(java.lang.String strImplementation,
               ConnectionState objConnectionState)
        throws AxisFault

Internal Use Only.

Throws:
AxisFault

Session

public Session(Connection objConnection)
        throws AxisFault
Instantiate a new Session object using a Connection.

Example: Initializing a Session instance.
Connection objConnection = new Connection(new URL("http://boserver:port/dswsbobje/services/session"));
Session objSession = new Session(objConnection);

Throws:
AxisFault
See Also:
Connection

Session

public Session(Connection objConnection,
               ConnectionState objConnectionState)
        throws AxisFault
Instantiate a new Session object using Connection and ConnectionState objects. This constructor enables you to create a new Session object with an already known session ID.

Example: Initializing a Session instance.
URL objURLSession = new URL("http://boserver:port/dswsbobje/services/session");
Connection objConnection = new Connection(objURLSession);
Session objSession = new Session(objConnection);

EnterpriseCredential objEnterpriseCredential = new EnterpriseCredential();
objEnterpriseCredential.setLogin("John");
objEnterpriseCredential.setPassword("MyPassword1973");
objEnterpriseCredential.setDomain("MyCMS");
objEnterpriseCredential.setLocale("en_US");
objEnterpriseCredential.setTimeZone("GMT+01:00");

SessionInfo objSessionInfo = objSession.login(objEnterpriseCredential);

// To be able to reconnect to the server session, you only need to keep the session id
String strSessionID = objSession.getConnectionState().getSessionID();

// Later on, if the session is still alive, you can connect to the same session just thanks to the session id
URL objURLSession = new URL("http://boserver:port/dswsbobje/services/session");
Connection objConnection = new Connection(objURLSession);
ConnectionState objConnectionState = new ConnectionState(strSessionID);
Session objSession = new Session(objConnection, objConnectionState);
objSession.resetSessionTimeOut();

Parameters:
objConnection - a valid Connection object with the URL set to the Session service.
objConnectionState - the ConnectionState of the current user session.
Throws:
AxisFault
See Also:
Connection, ConnectionState

Session

public Session()
Method Detail

getAssociatedServicesURL

public java.lang.String[] getAssociatedServicesURL(java.lang.String strServiceName)
Deprecated. As of XI 4.0.

Return an array of strings containing the URLs associated to the web service. These URLs are then used to instantiate the service.

Example: Initializing a Session instance.
Connection objConnection = new Connection(new URL("http://boserver:port/dswsbobje/services/session"));
Session objSession = new Session(objConnection);

EnterpriseCredential objEnterpriseCredential = new EnterpriseCredential();
objEnterpriseCredential.setLogin("John");
objEnterpriseCredential.setPassword("MyPassword1973");
objEnterpriseCredential.setDomain("MyCMS");
objEnterpriseCredential.setLocale("en_US");
objEnterpriseCredential.setTimeZone("GMT+01:00");

SessionInfo objSessionInfo = objSession.login(objEnterpriseCredential);
String[] astrURLs = objSession.getAssociatedServicesURL("ReportEngine");

// If no URL is returned, the service is not available
if (astrURLs.length > 0)
{
ReportEngine objReportEngine = ReportEngine.getInstance(objSession, astrURLs[0]);
}

Note:If the user is not logged in or the service name is unknown, NULL will be returned.

Parameters:
strServiceName - A string containing the name of the desired service. For example "BICatalog"
Returns:
an array of strings containing the URLs associated to the service.

getInstance

public static Session getInstance(Consumer objConsumer,
                                  java.lang.String strURL)
                           throws AxisFault
GetInstance static method returns a Session by passing the Web Service URL and an already logged Consumer object.

Parameters:
objConsumer - one of the current user's consumer objects.
strURL - URL to connect to the Session web service.
Returns:
An instance of Session.
Throws:
DSWSException - Exception raised either as a Web Service SOAP Fault or as a Consumer side trapped exception.

Example: Retrieving a Session instance from a BICatalog instance.
...
Session objSession = Session.GetInstance(objBICatalog, "http://boserver:port/dswsbobje/services/session");
objSession.resetTimeout();

AxisFault
See Also:
Connection, Consumer, ConnectionState, com.businessobjects.dsws.session.Session.Login

getVersion

public java.lang.String getVersion()
                            throws AxisFault
Returns a string containing the version of Web Services being used.The format of the string returned that indicates the version number is as follows: . For example, in BusinessObjects Web Services 3.1, the getVersion method would return 12.0.

Returns:
the Web Service version string.
Throws:
AxisFault -
Note:This method could be used to check if the Web Service is up and running.
You don't need to previously login to use this method.

Example:

Connection objConnection = new Connection(new URL("http://boserver:port/dswsbobje/services/session"));
Session objSession = new Session(objConnection);
String strVersion = objSession.getVersion();


login

public SessionInfo login(Credential credential)
                  throws AxisFault
Open a Web Services session by providing full Enterprise Credentials.
Note: When a user logs in to a session many resources on the BusinessObjects Web Service provider and Business Intelligence servers are dedicated to the user session. This includes all documents opened during a session, temporary files and images. Best practice is to close the session explicitly.

Example:
URL objURLSession = new URL("http://boserver:port/dswsbobje/services/session");
Connection objConnection = new Connection(objURLSession);
Session objSession = new Session(objConnection);

EnterpriseCredential objEnterpriseCredential = new EnterpriseCredential();
objEnterpriseCredential.setLogin("John");
objEnterpriseCredential.setPassword("MyPassword1973");
objEnterpriseCredential.setDomain("MyCMS");
objEnterpriseCredential.setLocale("en_US");
objEnterpriseCredential.setTimeZone("GMT+01:00");

SessionInfo objSessionInfo = objSession.login(objEnterpriseCredential);

Parameters:
credential - EnterpriseCredential containing user login information.
Returns:
a SessionInfo object containing all associated session information.
Throws:
DSWSException
AxisFault
See Also:
Connection, ProxyParameters, EnterpriseCredential, SSLWrapper, SessionInfo, EnterpriseCredential

loginWithToken

public SessionInfo loginWithToken(java.lang.String token,
                                  LoginOption option)
                           throws AxisFault
Open a Web Services session by providing a login token.
Note: When a user logs in to a session many resources on the BusinessObjects Web Service provider and Business Intelligence servers are dedicated to the user session. This includes all documents opened during a session, temporary files and images. Best practice is to close the session explicitly.

Example:
URL objURLSession = new URL("http://boserver:port/dswsbobje/services/session");
Connection objConnection = new Connection(objURLSession);
Session objSession = new Session(objConnection);

// The token value is returned from a previous successful login. See SessionInfo.getDefaultToken()
// String strToken;
LoginOption option=LoginOption.Factory.newInstance(); option.setLocale("en_CA"); option.setTimeZone("GMT-08:00"); option.setReportedIPAddress("192.165.218.18"); option.setReportedHostName("full_machine_name"); option.setPolicyID("BOE XI 4.0"); LoginOption option=LoginOption.Factory.newInstance();
SessionInfo objSessionInfo = objSession.loginWithToken(strToken, option);

Parameters:
a - String token containing the login token retrieved from a previous login.
a - LoginOption object containing different options.
Returns:
a SessionInfo object containing all associated session information.
Throws:
AxisFault
See Also:
Connection, ProxyParameters, SSLWrapper, SessionInfo

loginWithToken

public SessionInfo loginWithToken(java.lang.String token,
                                  java.lang.String locale,
                                  java.lang.String timezone)
                           throws AxisFault
Open a Web Services session by providing a login token.
Note: When a user logs in to a session many resources on the BusinessObjects Web Service provider and Business Intelligence servers are dedicated to the user session. This includes all documents opened during a session, temporary files and images. Best practice is to close the session explicitly.

Example:
URL objURLSession = new URL("http://boserver:port/dswsbobje/services/session");
Connection objConnection = new Connection(objURLSession);
Session objSession = new Session(objConnection);

// The token value is returned from a previous successful login. See SessionInfo.getDefaultToken()
// String strToken;
String strLocale = "fr_CA";
String strTimezone = "GMT-08:00";

SessionInfo objSessionInfo = objSession.loginWithToken(strToken, strLocale, strTimezone);

Parameters:
a - String token containing the login token retrieved from a previous login.
a - String locale representing the current locale.
a - String timezone representing the current timezone.
Returns:
a SessionInfo object containing all associated session information.
Throws:
AxisFault
See Also:
Connection, ProxyParameters, SSLWrapper, SessionInfo

loginWithToken

public SessionInfo loginWithToken(java.lang.String token,
                                  java.lang.String locale,
                                  java.lang.String timezone,
                                  java.lang.String reportedIPAddress,
                                  java.lang.String reportedHostName)
                           throws AxisFault
Open a Web Services session by providing a login token.
Note: When a user logs in to a session many resources on the BusinessObjects Web Service provider and Business Intelligence servers are dedicated to the user session. This includes all documents opened during a session, temporary files and images. Best practice is to close the session explicitly.

Example:
URL objURLSession = new URL("http://boserver:port/dswsbobje/services/session");
Connection objConnection = new Connection(objURLSession);
Session objSession = new Session(objConnection);

// The token value is returned from a previous successful login. See SessionInfo.getDefaultToken()
// String strToken;
String strLocale = "fr_CA";
String strTimezone = "GMT-08:00";

SessionInfo objSessionInfo = objSession.loginWithToken(strToken, strLocale, strTimezone);

Parameters:
a - String token containing the login token retrieved from a previous login.
a - String locale representing the current locale.
a - String timezone representing the current timezone.
reported - IP Address
reported - Host Name
Returns:
a SessionInfo object containing all associated session information.
Throws:
AxisFault
See Also:
Connection, ProxyParameters, SSLWrapper, SessionInfo

loginWithSerializedSession

public SessionInfo loginWithSerializedSession(java.lang.String serializedSession,
                                              LoginOption option)
                                       throws AxisFault
Open a Web Services session by providing a login serialized session.
Note: When a user logs in to a session many resources on the BusinessObjects Web Service provider and Business Intelligence servers are dedicated to the user session. This includes all documents opened during a session, temporary files and images. Best practice is to close the session explicitly.

Example:
URL objURLSession = new URL("http://boserver:port/dswsbobje/services/session");
Connection objConnection = new Connection(objURLSession);
Session objSession = new Session(objConnection);

// The token value is returned from a previous successful login. See SessionInfo.getDefaultToken()
// String serializedSession;
LoginOption option=LoginOption.Factory.newInstance(); option.setLocale("en_CA"); option.setTimeZone("GMT-08:00"); option.setReportedIPAddress("192.165.218.18"); option.setReportedHostName("full_machine_name"); option.setPolicyID("BOE XI 4.0");
SessionInfo objSessionInfo = objSession.loginWithSerializedSession(serializedSession, option);

Parameters:
a - String serializedSession containing the login serialized session retrieved from a previous login.
a - LoginOption object containing different options.
Returns:
a SessionInfo object containing all associated session information.
Throws:
AxisFault
See Also:
Connection, ProxyParameters, SSLWrapper, SessionInfo

loginWithSerializedSession

public SessionInfo loginWithSerializedSession(java.lang.String serializedSession,
                                              java.lang.String locale,
                                              java.lang.String timezone,
                                              java.lang.String reportedIPAddress,
                                              java.lang.String reportedHostName)
                                       throws AxisFault
Throws:
AxisFault

logout

public void logout()
            throws AxisFault
Log out of a Web Services session. When a user logs in to a session many resources on the BusinessObjects Web Service provider and Business Intelligence servers are dedicated to the user session. This includes all documents opened during a session, temporary files and images. Best practice is to close the session explicitly.

Throws:
DSWSException
AxisFault

resetSessionTimeOut

public void resetSessionTimeOut()
                         throws AxisFault
Notifies the web service provider to keep the web service session alive. Web Service Sessions are closed automatically after a period of inactivity to prevent system performance degradation. By default this period of inactivity is 20 minutes but is configurable on the web service provider.

Note: Most web service operations will reset the period of inactivity of a web service session. This includes operations for web services such as Session, BIPlatform, and ReportEngine except Session.getVersion.

Throws:
DSWSException
AxisFault

getServerInfo

public ServerInfo getServerInfo()
                         throws AxisFault
Return information about the server being accessed by the Web Services.

Returns:
information about the available server.
Throws:
DSWSException
AxisFault
See Also:
ServerInfo, EnterpriseCredential.getAuthType()

getServerInfoDetails

public ServerInfoDetails getServerInfoDetails()
                                       throws AxisFault
Return information about the server being accessed by the Web Services.

Returns:
information about the available server, including installed security plugin progIDs, Names etc
Throws:
DSWSException
AxisFault
See Also:
ServerInfoDetails, EnterpriseCredential.getAuthType()

setDictionary

public void setDictionary(DictionaryType.Enum dictionary,
                          Entry[] entries)
                   throws AxisFault
The SetDictionary method sets an array of Entries for the User or Server.

Parameters:
dictionary - The DictionaryType to be set. Either DictionaryType.USER or DictionaryType.SERVER.
entries - an Array of Entries to be stored in the dictionary.
Throws:
DSWSException
AxisFault
See Also:
Entry, DictionaryType

getDictionary

public Entry[] getDictionary(DictionaryType.Enum dictionary)
                      throws AxisFault
Return an array of Entries for the User or Server.

Parameters:
dictionary - The DictionaryType to be retrueved. Either DictionaryType.USER or DictionaryType.SERVER.
Returns:
An array of Entries associated to the DictionaryType.
Throws:
DSWSException
AxisFault
See Also:
Entry, DictionaryType

changePassword

public void changePassword(java.lang.String oldPassword,
                           java.lang.String newPassword)
                    throws AxisFault
Change the current user's password.

Parameters:
oldPassword - a string containing the user's current password.
newPassword - a string containing the user's new password.
Throws:
DSWSException
AxisFault

getSessionInfo

public SessionInfo getSessionInfo()
                           throws AxisFault
Returns the information pertaining to a user's session. This is the same information that is returned by calling the login method.

Note: the Session object must have a valid session ID string, either from a successful login or from being constructed with a valid ConnectionState.

Returns:
a SessionInfo object containing the relevant information associated with a user's session
Throws:
DSWSException - If the session ID associated with this Session object is no longer valid.
AxisFault

setPVLocale

public void setPVLocale(java.lang.String pvl)
                 throws AxisFault
Throws:
AxisFault

getSupportedPVLs

public SupportedPVLs getSupportedPVLs()
                               throws AxisFault
Throws:
AxisFault

setSecondaryCredential

public void setSecondaryCredential(java.lang.String credentialKey,
                                   java.lang.String credentialValue)
                            throws AxisFault
Throws:
AxisFault

getSecondaryCredential

public java.lang.String getSecondaryCredential(java.lang.String credentialKey)
                                        throws AxisFault
Throws:
AxisFault

removeSecondaryCredential

public void removeSecondaryCredential(java.lang.String credentialKey)
                               throws AxisFault
Throws:
AxisFault

getSAPAssertionTicket

public java.lang.String getSAPAssertionTicket(java.lang.String targetSystemID)
                                       throws AxisFault
For internal use only Get an assertion ticket for the currently logged on user, to the specified SAP system.

Parameters:
targetSystemID -
Returns:
SAP Assertion Ticket
Throws:
AxisFault

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException