com.sage.accpac.sm
Class Session

java.lang.Object
  extended by com.sage.accpac.sm.Session

@ThreadSafe
public class Session
extends java.lang.Object

Represents an authenticated session with the Sage Accpac System Manager.
The caller must call the dispose method when finished with the object so that all its resources can be released. The caller must not call any other method on the object after calling dispose.

Thread safety
Thread-safe

Constructor Summary
Session(ProgramSet programSet, SharedDataSet sharedDataSet, java.lang.String userID, java.lang.String password, java.lang.String companyID, java.util.Date sessionDate)
          Complete constructor.
Session(java.lang.String userID, java.lang.String password, java.lang.String companyID, java.util.Date sessionDate)
          Constructs an instance of the Session class with a default ProgramSet and SharedDataSet.
 
Method Summary
 void dispose()
          Closes and releases all resources used by the object.
protected  void finalize()
          overrides the finalize method of object so that the dispose gets called if it hasn't already
 java.lang.String getCharacterSetName()
          Gets the name of the character set used for the session.
 java.lang.String getCompanyID()
          Gets the company database ID that the current session is signed on to.
 java.lang.String getCompanyName()
          Returns the name of the company
 LicenseStatus getLicenseStatus(java.lang.String appID, java.lang.String appVersion)
          Gets the license status of the given version of the given application.
 ProgramSet getProgramSet()
          Get the session's program set
 java.util.Date getSessionDate()
          Gets the date represented by the program
 SharedDataSet getSharedDataSet()
          Get the shared data set for this program
 java.lang.String getSystemID()
          Gets the system database ID that the current session is signed on to.
static java.lang.String getSystemVersion()
          get the system version (e.g., "60A")
 java.lang.String getUserID()
          Gets the Accpac user ID of the program.
 java.lang.String getUserLanguage()
          Gets the language preference of the current user.
 java.lang.String getUserName()
          Gets the name of the current user.
 boolean isTimecardUser()
          check if the current user is a Timecard user.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Session

public Session(ProgramSet programSet,
               SharedDataSet sharedDataSet,
               java.lang.String userID,
               java.lang.String password,
               java.lang.String companyID,
               java.util.Date sessionDate)
Complete constructor.


Session

public Session(java.lang.String userID,
               java.lang.String password,
               java.lang.String companyID,
               java.util.Date sessionDate)
Constructs an instance of the Session class with a default ProgramSet and SharedDataSet.

Method Detail

dispose

public void dispose()
Closes and releases all resources used by the object. Do not call any methods after calling this.


getCharacterSetName

public java.lang.String getCharacterSetName()
Gets the name of the character set used for the session. This reflects how the bytes of the underlying Accpac data are interpreted.

Returns:
the name of the session character set.

getCompanyID

public java.lang.String getCompanyID()
Gets the company database ID that the current session is signed on to.


getCompanyName

public final java.lang.String getCompanyName()
Returns the name of the company

Returns:
the name of the company

getLicenseStatus

public LicenseStatus getLicenseStatus(java.lang.String appID,
                                      java.lang.String appVersion)
Gets the license status of the given version of the given application.
If the caller passes invalid data or the underlying system fails the behavior of this method is undefined. It may throw an exception, return a status of NotKNown or even cause the system to fail.

Parameters:
appID - ID of the application
appVersion - version of the application
Returns:
the status of the license for the given version of the given application.

getProgramSet

public ProgramSet getProgramSet()
Get the session's program set


getSessionDate

public java.util.Date getSessionDate()
Gets the date represented by the program


getSystemID

public java.lang.String getSystemID()
Gets the system database ID that the current session is signed on to.


getSharedDataSet

public SharedDataSet getSharedDataSet()
Get the shared data set for this program


getSystemVersion

public static java.lang.String getSystemVersion()
get the system version (e.g., "60A")

Returns:
the system version (e.g., "60A")

getUserID

public java.lang.String getUserID()
Gets the Accpac user ID of the program.


getUserLanguage

public java.lang.String getUserLanguage()
Gets the language preference of the current user. The property returns the 3-letter uppercase language code of the preferred language.


getUserName

public java.lang.String getUserName()
Gets the name of the current user.

Returns:
the name of the user

isTimecardUser

public boolean isTimecardUser()
check if the current user is a Timecard user.

Returns:
true if the current user is a Timecard user, false otherwise

finalize

protected void finalize()
overrides the finalize method of object so that the dispose gets called if it hasn't already

Overrides:
finalize in class java.lang.Object


Copyright © 2010 Sage Software, Inc. All rights reserved.