***  This class is subject to change   ***

com.sas.workspace
Class AppServer

java.lang.Object
  |
  +--com.sas.workspace.AppServer

public class AppServer
extends Object

Provides a 'packaged' interface to an Application Server (ServerContext accessed as an IOM server). AppServer hides the details on IOM communication and OMA model navigation from callers. The following types of services are provided:

Usage: Specify ServerContext information directly
appServer = new AppServer( strServerContextId );
appServer.setLogin( strUserId );
...// Communicate with the server
appServer.termAppServer(); // Terminate the server

Usage: Allow AppServer to pick ServerContext based on accessed PhysicalTable
appServer = new AppServer(physTable);
appServer.setLogin( strUserId );
...// Communicate with the server
appServer.termAppServer(); // Terminate the server

Usage: Allow AppServer to pick ServerContext based on accessed EFile
appServer = new AppServer(extFile);
appServer.setLogin( strUserId );
...// Communicate with the server
appServer.termAppServer(); // Terminate the server

If initial values for ServerContext and UserId are unknown in a visual interactive environment, several components are available to default & query for the info, AppServerDialog and AppServerTab:

   // for a dialog:
   AppServer appServer = new AppServer();
   AppServerDialog pDlg = new AppServerDialog(frame, appServer, strInfoText);
    pDlg.setTitle("..."); // Optional, can use AppServerDialog default title
   pDlg.show(); 
if( pDlg.getReturnValue() == AppServerDialog.OK ) { // Do your stuff... appServer.termAppServer(); } // for a wizard AppServerTab tab = new AppServerTab(appServer);


Inner Class Summary
 
Field Summary
protected static com.sas.metadata.MetadataResource bundle
           
protected  String m_2ndStatusMsg
           
protected  boolean m_bLocalStore
           
protected  com.sas.metadata.File m_EFile
           
protected  com.sas.metadata.SASLibrary m_Library
           
protected  com.sas.iom.SAS.ILanguageServicePackage.CarriageControlSeqHolder m_listCCHolder
           
protected  com.sas.iom.SASIOMDefs.StringSeqHolder m_listLinesHolder
           
protected  com.sas.iom.SAS.ILanguageServicePackage.LineTypeSeqHolder m_listTypeHolder
           
protected  com.sas.iom.SAS.ILanguageServicePackage.CarriageControlSeqHolder m_logCCHolder
           
protected  com.sas.metadata.LogicalServer m_LogicalServer
           
protected  com.sas.iom.SASIOMDefs.StringSeqHolder m_logLinesHolder
           
protected  com.sas.iom.SAS.ILanguageServicePackage.LineTypeSeqHolder m_logTypeHolder
           
protected  boolean m_operationComplete
           
protected  com.sas.metadata.PhysicalTable m_PhysTable
           
protected  ArrayList m_populatedSC
           
protected  ArrayList m_reposSC
           
protected  com.sas.iom.SAS.IDataService m_rio
           
protected  com.sas.rio.MVAResultSet m_rsltSet
           
protected  com.sas.iom.SAS.ILanguageService m_sasLanguage
           
protected  Boolean m_sasSubmitRunning
           
protected  com.sas.iom.SAS.IWorkspace m_sasWorkspace
           
protected  HashMap m_SCMap
           
protected  com.sas.metadata.ServerContext m_ServerContext
           
protected  Connection m_sqlConnection
           
protected  com.sas.rio.MVAStatement m_sqlStmt
           
protected  int m_status
           
protected  String m_statusMsg
           
protected  com.sas.metadata.MdObjectStore m_store
           
protected  Workspace m_workspace
           
static int MAX_STATUS_ERROR
           
static int STATUS_Abort
           
static int STATUS_AttemptLimitReached
           
static int STATUS_BadServer
           
static int STATUS_CodeError
           
static int STATUS_ConnClosFail
           
static int STATUS_ConnectCancelled
           
static int STATUS_ConnFailed
           
static int Status_ExpiredCredentials
           
static int STATUS_NoConnObj
           
static int STATUS_NoDCMetadata
           
static int STATUS_NoDCObj
           
static int STATUS_NoLibAssign
           
static int STATUS_NoLibAssign2
           
static int STATUS_NoLibFound
           
static int STATUS_NoListFetch
           
static int STATUS_NoLogFetch
           
static int STATUS_NoLoginObj
           
static int STATUS_NoPassword
           
static int STATUS_NoPort
           
static int STATUS_NoServer
           
static int STATUS_NoSQLConn
           
static int STATUS_NoUserid
           
static int STATUS_NoWSConf
           
static int STATUS_OK
           
static int STATUS_SQLAbrtConn
           
static int STATUS_SQLQryFail
           
static int STATUS_SubmitCancelled
           
static int STATUS_SubmitFailed
           
static int STATUS_TblClosFail
           
static int STATUS_TblOpenFail
           
static int STATUS_TblOpenFail2
           
static String WORKSPACECLASSID
           
 
Constructor Summary
AppServer()
          Constructs an empty AppServer object.
AppServer(com.sas.iom.SAS.IWorkspace iWorkspace)
           
AppServer(com.sas.metadata.MdStore owningStore)
          Constructs an empty AppServer object.
AppServer(com.sas.metadata.MdStore owningStore, String serverContextId)
          Constructs an AppServer object, using given ServerContext metadata-id
AppServer(com.sas.metadata.MdStore owningStore, String serverContextId, String userLoginId, String userPassword)
          Constructs an AppServer object, using given ServerContext metadata-id and UserId strings.
AppServer(com.sas.metadata.PhysicalTable physTable)
          Deprecated. Use logical server constructor
AppServer(String serverContextId)
          Constructs an AppServer object, using given ServerContext metadata-id
AppServer(String serverContextId, String userLoginId, String userPassword)
          Constructs an AppServer object, using given ServerContext metadata-id and UserId strings.
 
Method Summary
 String assignLibref(com.sas.metadata.SASLibrary iLib)
          Make connection (libref) to library given the SASLibrary object.
 String assignLibref(String strLibref0, String strEngine, String strPath, String strOptions)
          Make connection (libref) to library given by path, engine, & options.
 String assignLibref(String strLibref0, String strEngine, String strPath, String strOptions, boolean useOldMethod)
          Deprecated. As of 10/8/2001, the boolean has no efect
static String bldOptionString(com.sas.metadata.AssociationList optionList, String optionRole)
          * @todo fix this to work with Property objects
 void clearLibref(com.sas.metadata.SASLibrary iLib)
          Clear a previously assigned Libref
 void clearLibref(String strLibref)
          Clear a previously assigned Libref
 void clearReposServerContexts()
          Return ordered list of ServerContexts in our repositories.
 void closeJDBCTable()
          Close our JDBC connection to opened PhysicalTable.
 int determineStatus()
          Determine current status of AppServer.
 void dropConnection()
          Drop connection to IOM server, if active.
 void dropSQLConnection()
          Drop all JDBC access connections.
 String getAssignedLibref()
           
 String getConnectionHostName()
           
 String getFullStatusMsg()
          Return full (2-level) message associated with current status of Application Server.
 com.sas.iom.SAS.ILanguageServicePackage.CarriageControlSeqHolder getListCCHolder()
          Returns container of executed source Listing line carriage controls.
 com.sas.iom.SASIOMDefs.StringSeqHolder getListLinesHolder()
          Returns container of executed source Listing lines.
 com.sas.iom.SAS.ILanguageServicePackage.LineTypeSeqHolder getListTypeHolder()
          Returns container of executed source Listing line types.
 StringBuffer getLog()
          Returns log in a simple string buffer.
 com.sas.iom.SAS.ILanguageServicePackage.CarriageControlSeqHolder getLogCCHolder()
          Returns container of executed source Log line carriage controls.
 com.sas.iom.SASIOMDefs.StringSeqHolder getLogLinesHolder()
          Returns container of executed source Log lines.
 com.sas.iom.SAS.ILanguageServicePackage.LineTypeSeqHolder getLogTypeHolder()
          Returns container of executed source Log line types.
 ArrayList getReposServerContexts()
          Return ordered list of ServerContexts in our repositories.
 com.sas.metadata.SASLibrary getSASLibrary()
           
 com.sas.metadata.SASLibrary getSchemaLibrary(com.sas.metadata.DatabaseSchema m_metadata)
          Return SASLibrary associated to a schema
 com.sas.metadata.ServerContext getServerContext()
          Return current ServerContext object for AppServer.
 Connection getSQLConnection()
          Returns the sql connection
 int getStatus()
          Return current status of AppServer.
 String getStatusMsg()
          Return message associated with current status of Application Server.
 String getStatusMsg2()
          Return any secondary message associated with current status of Application Server.
 com.sas.metadata.MdObjectStore getStore()
           
 com.sas.rio.MVAResultSet getTable(String strLibref, String strTable, String strMemType, String[] sasPasswords, String strOptions)
          Return SQL ResultSet (via JDBC) for given table.
 boolean isLibrefAssigned(com.sas.metadata.SASLibrary iLib)
           
 boolean isLibrefAssigned(String strLibref)
           
 boolean isPreassignedMetaEngine(com.sas.metadata.SASLibrary iLib)
          isPreassignedMetaEngine used to determine if a library is preassigned and is of type META
 com.sas.iom.SAS.IWorkspace makeConnection()
          Make connection to IOM server on current ServerContext.
 void makeSQLConnection()
          Make connection for SQL processing.
 String makeSQLConnection(String tempLibRef, String engine, String path, String strIncomingOptions)
          Make connection (libref) to library given by path, engine, & options.
 com.sas.rio.MVAResultSet openJDBCTable(com.sas.metadata.PhysicalTable physTable)
          Return SQL ResultSet (via JDBC) for given table.
 void postCompletion()
          Post that latest operation has completed.
 void resetStatus()
          Set new status for AppServer.
 void setCloseOnError(boolean bDoTheClose)
          Does the connection to the workspace need to be closed when a SAS code error occurs.
 void setLogin(String strUserid, String strPassword)
          Use Userid string and (optionally) Password string to create a Login object and set as current.
 void setPhysicalTable(com.sas.metadata.PhysicalTable table)
           
 void setSASLibrary(com.sas.metadata.SASLibrary inLibrary)
          Sets the Library used for Appserver.
 com.sas.metadata.ServerContext setServerContext(com.sas.metadata.PhysicalTable physTable)
          Determine the 'best' ServerContext for access to a given PhysicalTable object.
 void setServerContext(com.sas.metadata.ServerContext scObj)
          Make given ServerContext object AppServer's current ServerContext, and populate with metadata and associations if needed.
 com.sas.metadata.ServerContext setServerContext(String strSCId)
          Make given ServerContext object AppServer's current ServerContext, and populate with metadata and associations if needed.
protected  void setStatus(int newStatus)
          Set new status for AppServer.
protected  void setStatus(int newStatus, Object[] subStrs)
          Set new status for AppServer, and build associated message.
protected  void setStatus(int newStatus, Object[] subStrs, String str2ndMsg)
          Set new status for AppServer, build associated message, and set secondary info message.
protected  void setStatus(int newStatus, String str2ndMsg)
          Set new status for AppServer, and secondary info message.
 void setStore(com.sas.metadata.MdObjectStore inStore)
           
 com.sas.rio.MVAResultSet submitSQLStatement(String strStatement)
          Execute the specified query against the rio connection in this appserver
 com.sas.rio.MVAResultSet submitSQLStatement(String strStatement, com.sas.rio.MVAStatement sqlStatement)
          Execute the specified query against the rio connection in this appserver
 int submitSrc(String sasStmts)
          Submit SAS source statements for execution to an IOM Application Server.
 void termAppServer()
          Terminate AppServer object.
 void testConnection()
           
 void testConnection(String machine, String port, String userid, String password)
          Test given information for connecting to AppServer ServerContext Throws AppServerException if connect fails.
 void updateMetadataAll()
          Update any new/changed metadata for this AppServer.
 int waitForCompletion()
          Wait for completion of AppServer operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bundle

protected static com.sas.metadata.MetadataResource bundle

m_SCMap

protected HashMap m_SCMap

m_populatedSC

protected ArrayList m_populatedSC

m_reposSC

protected ArrayList m_reposSC

m_PhysTable

protected com.sas.metadata.PhysicalTable m_PhysTable

m_Library

protected com.sas.metadata.SASLibrary m_Library

m_EFile

protected com.sas.metadata.File m_EFile

m_ServerContext

protected com.sas.metadata.ServerContext m_ServerContext

m_LogicalServer

protected com.sas.metadata.LogicalServer m_LogicalServer

m_workspace

protected Workspace m_workspace

m_sasWorkspace

protected com.sas.iom.SAS.IWorkspace m_sasWorkspace

m_sqlConnection

protected Connection m_sqlConnection

m_sqlStmt

protected com.sas.rio.MVAStatement m_sqlStmt

m_rsltSet

protected com.sas.rio.MVAResultSet m_rsltSet

m_sasLanguage

protected com.sas.iom.SAS.ILanguageService m_sasLanguage

m_sasSubmitRunning

protected Boolean m_sasSubmitRunning

m_operationComplete

protected boolean m_operationComplete

m_rio

protected com.sas.iom.SAS.IDataService m_rio

m_store

protected com.sas.metadata.MdObjectStore m_store

m_bLocalStore

protected boolean m_bLocalStore

m_logCCHolder

protected com.sas.iom.SAS.ILanguageServicePackage.CarriageControlSeqHolder m_logCCHolder

m_logTypeHolder

protected com.sas.iom.SAS.ILanguageServicePackage.LineTypeSeqHolder m_logTypeHolder

m_logLinesHolder

protected com.sas.iom.SASIOMDefs.StringSeqHolder m_logLinesHolder

m_listCCHolder

protected com.sas.iom.SAS.ILanguageServicePackage.CarriageControlSeqHolder m_listCCHolder

m_listTypeHolder

protected com.sas.iom.SAS.ILanguageServicePackage.LineTypeSeqHolder m_listTypeHolder

m_listLinesHolder

protected com.sas.iom.SASIOMDefs.StringSeqHolder m_listLinesHolder

m_status

protected int m_status

m_statusMsg

protected String m_statusMsg

m_2ndStatusMsg

protected String m_2ndStatusMsg

WORKSPACECLASSID

public static final String WORKSPACECLASSID

MAX_STATUS_ERROR

public static final int MAX_STATUS_ERROR

STATUS_OK

public static final int STATUS_OK

STATUS_NoDCObj

public static final int STATUS_NoDCObj

STATUS_NoConnObj

public static final int STATUS_NoConnObj

STATUS_NoWSConf

public static final int STATUS_NoWSConf

STATUS_NoPort

public static final int STATUS_NoPort

STATUS_NoLoginObj

public static final int STATUS_NoLoginObj

STATUS_NoUserid

public static final int STATUS_NoUserid

STATUS_NoPassword

public static final int STATUS_NoPassword

STATUS_NoDCMetadata

public static final int STATUS_NoDCMetadata

STATUS_NoServer

public static final int STATUS_NoServer

STATUS_ConnFailed

public static final int STATUS_ConnFailed

STATUS_SubmitFailed

public static final int STATUS_SubmitFailed

STATUS_SubmitCancelled

public static final int STATUS_SubmitCancelled

STATUS_NoLogFetch

public static final int STATUS_NoLogFetch

STATUS_NoListFetch

public static final int STATUS_NoListFetch

STATUS_NoLibAssign

public static final int STATUS_NoLibAssign

STATUS_NoSQLConn

public static final int STATUS_NoSQLConn

STATUS_TblOpenFail

public static final int STATUS_TblOpenFail

STATUS_TblClosFail

public static final int STATUS_TblClosFail

STATUS_NoLibFound

public static final int STATUS_NoLibFound

STATUS_NoLibAssign2

public static final int STATUS_NoLibAssign2

STATUS_SQLQryFail

public static final int STATUS_SQLQryFail

STATUS_SQLAbrtConn

public static final int STATUS_SQLAbrtConn

STATUS_TblOpenFail2

public static final int STATUS_TblOpenFail2

STATUS_ConnClosFail

public static final int STATUS_ConnClosFail

STATUS_CodeError

public static final int STATUS_CodeError

STATUS_AttemptLimitReached

public static final int STATUS_AttemptLimitReached

STATUS_ConnectCancelled

public static final int STATUS_ConnectCancelled

STATUS_BadServer

public static final int STATUS_BadServer

Status_ExpiredCredentials

public static final int Status_ExpiredCredentials

STATUS_Abort

public static final int STATUS_Abort
Constructor Detail

AppServer

public AppServer()
Constructs an empty AppServer object. Caller is required to specify ServerContext and Login, via setServerContext() and setLogin(), respectively, before using this AppServer object.

AppServer

public AppServer(com.sas.metadata.MdStore owningStore)
Constructs an empty AppServer object. Caller is required to specify ServerContext and Login, via setServerContext() and setLogin(), respectively, before using this AppServer object.

AppServer

public AppServer(String serverContextId,
                 String userLoginId,
                 String userPassword)
Constructs an AppServer object, using given ServerContext metadata-id and UserId strings.
Parameters:
serverContextId - - Metadata-Id string for AppServer ServerContext
userLoginId - - UserId string to use for Login purposes
userPassword - - User password string to use for Login purposes

AppServer

public AppServer(com.sas.metadata.MdStore owningStore,
                 String serverContextId,
                 String userLoginId,
                 String userPassword)
Constructs an AppServer object, using given ServerContext metadata-id and UserId strings.
Parameters:
serverContextId - - Metadata-Id string for AppServer ServerContext
userLoginId - - UserId string to use for Login purposes
userPassword - - User password string to use for Login purposes

AppServer

public AppServer(String serverContextId)
Constructs an AppServer object, using given ServerContext metadata-id
Parameters:
serverContextId - - Metadata-Id string for AppServer ServerContext

AppServer

public AppServer(com.sas.metadata.MdStore owningStore,
                 String serverContextId)
Constructs an AppServer object, using given ServerContext metadata-id
Parameters:
serverContextId - - Metadata-Id string for AppServer ServerContext

AppServer

public AppServer(com.sas.metadata.PhysicalTable physTable)
Deprecated. Use logical server constructor

Constructs an AppServer object, based on a PhysicalTable object.
Parameters:
physTable - - PhysicalTable which is target of AppServer access

AppServer

public AppServer(com.sas.iom.SAS.IWorkspace iWorkspace)
Method Detail

testConnection

public void testConnection()
                    throws AppServerException

testConnection

public void testConnection(String machine,
                           String port,
                           String userid,
                           String password)
                    throws AppServerException
Test given information for connecting to AppServer ServerContext Throws AppServerException if connect fails.

makeConnection

public com.sas.iom.SAS.IWorkspace makeConnection()
                                          throws AppServerException
Make connection to IOM server on current ServerContext.
Returns:
- Handle to IOM SAS Workspace (IWorkspace).

dropConnection

public void dropConnection()
Drop connection to IOM server, if active.

setStore

public void setStore(com.sas.metadata.MdObjectStore inStore)

getStore

public com.sas.metadata.MdObjectStore getStore()

termAppServer

public void termAppServer()
Terminate AppServer object.

determineStatus

public int determineStatus()
Determine current status of AppServer.
Returns:
- Integer status code: 0 is OK, non-0 is bad.

setSASLibrary

public void setSASLibrary(com.sas.metadata.SASLibrary inLibrary)
Sets the Library used for Appserver.

setPhysicalTable

public void setPhysicalTable(com.sas.metadata.PhysicalTable table)
                      throws com.sas.metadata.MdException

getSASLibrary

public com.sas.metadata.SASLibrary getSASLibrary()

getAssignedLibref

public String getAssignedLibref()

clearLibref

public void clearLibref(String strLibref)
Clear a previously assigned Libref
Parameters:
strLibref - String
Returns:
none

clearLibref

public void clearLibref(com.sas.metadata.SASLibrary iLib)
Clear a previously assigned Libref
Parameters:
iLib - SASLibrary
Returns:
none

setStatus

protected void setStatus(int newStatus)
Set new status for AppServer.
Parameters:
newStatus - - New status code.

resetStatus

public void resetStatus()
Set new status for AppServer.
Parameters:
newStatus - - New status code.

setStatus

protected void setStatus(int newStatus,
                         Object[] subStrs)
Set new status for AppServer, and build associated message.
Parameters:
newStatus - - New status code.
subStrs - - List of objects to use as status message substitutions.

setStatus

protected void setStatus(int newStatus,
                         String str2ndMsg)
Set new status for AppServer, and secondary info message.
Parameters:
newStatus - - New status code.
str2ndMsg - - Optional additional informational message.

setStatus

protected void setStatus(int newStatus,
                         Object[] subStrs,
                         String str2ndMsg)
Set new status for AppServer, build associated message, and set secondary info message.
Parameters:
newStatus - - New status code.
subStrs - - List of objects to use as status message substitutions.
str2ndMsg - - Optional additional informational message.

getStatus

public int getStatus()
Return current status of AppServer.
Returns:
- Integer status code: 0 is OK, non-0 is bad.

getFullStatusMsg

public String getFullStatusMsg()
Return full (2-level) message associated with current status of Application Server.
Returns:
- Status message string.

getStatusMsg

public String getStatusMsg()
Return message associated with current status of Application Server.
Returns:
- Status message string.

getStatusMsg2

public String getStatusMsg2()
Return any secondary message associated with current status of Application Server.
Returns:
- Secondary status message string.

postCompletion

public void postCompletion()
Post that latest operation has completed. Method is synchronized, and used in conjunction with waitForCompletion().

submitSrc

public int submitSrc(String sasStmts)
              throws AppServerException
Submit SAS source statements for execution to an IOM Application Server.
Parameters:
sasStmts - - String of SAS source statements to execute, delimited by '\n's
Returns:
- Integer status code.

setCloseOnError

public void setCloseOnError(boolean bDoTheClose)
Does the connection to the workspace need to be closed when a SAS code error occurs. The default is TRUE.
Parameters:
bDoTheClose - - Close the AppServer on Submission errors

getLogLinesHolder

public com.sas.iom.SASIOMDefs.StringSeqHolder getLogLinesHolder()
Returns container of executed source Log lines.
Returns:
- StringSeqHolder containing the Log lines from the most recent code execution.

getLogTypeHolder

public com.sas.iom.SAS.ILanguageServicePackage.LineTypeSeqHolder getLogTypeHolder()
Returns container of executed source Log line types.
Returns:
- StringSeqHolder containing the Log line types from the most recent code execution.

getLogCCHolder

public com.sas.iom.SAS.ILanguageServicePackage.CarriageControlSeqHolder getLogCCHolder()
Returns container of executed source Log line carriage controls.
Returns:
- StringSeqHolder containing the Log line CC's from the most recent code execution.

getListLinesHolder

public com.sas.iom.SASIOMDefs.StringSeqHolder getListLinesHolder()
Returns container of executed source Listing lines.
Returns:
- StringSeqHolder containing the Listing lines from the most recent code execution.

getLog

public StringBuffer getLog()
Returns log in a simple string buffer.
Returns:
- StringBuffer containing the Log lines from the most recent code execution.

getSQLConnection

public Connection getSQLConnection()
Returns the sql connection
Returns:
java.sql.Connection

getConnectionHostName

public String getConnectionHostName()

getListTypeHolder

public com.sas.iom.SAS.ILanguageServicePackage.LineTypeSeqHolder getListTypeHolder()
Returns container of executed source Listing line types.
Returns:
- StringSeqHolder containing the Listing line types from the most recent code execution.

getListCCHolder

public com.sas.iom.SAS.ILanguageServicePackage.CarriageControlSeqHolder getListCCHolder()
Returns container of executed source Listing line carriage controls.
Returns:
- StringSeqHolder containing the Listing line CC's from the most recent code execution.

getReposServerContexts

public ArrayList getReposServerContexts()
Return ordered list of ServerContexts in our repositories.
Returns:
- ArrayList of ServerContext objects.

clearReposServerContexts

public void clearReposServerContexts()
Return ordered list of ServerContexts in our repositories.
Returns:
- ArrayList of ServerContext objects.

getServerContext

public com.sas.metadata.ServerContext getServerContext()
Return current ServerContext object for AppServer.
Returns:
- Current ServerContext object for AppServer.

setServerContext

public void setServerContext(com.sas.metadata.ServerContext scObj)
                      throws AppServerException
Make given ServerContext object AppServer's current ServerContext, and populate with metadata and associations if needed.
Parameters:
scObj - - ServerContext object to make current.

setServerContext

public com.sas.metadata.ServerContext setServerContext(String strSCId)
                                                throws AppServerException
Make given ServerContext object AppServer's current ServerContext, and populate with metadata and associations if needed.
Parameters:
scObj - - ServerContext object to make current.

setServerContext

public com.sas.metadata.ServerContext setServerContext(com.sas.metadata.PhysicalTable physTable)
Determine the 'best' ServerContext for access to a given PhysicalTable object. Make this ServerContext object the AppServer's current ServerContext.
Parameters:
physTable - - PhysicalTable which is target of AppServer access

setLogin

public void setLogin(String strUserid,
                     String strPassword)
Use Userid string and (optionally) Password string to create a Login object and set as current.
Parameters:
strUserId - - UserId string used to find Login object.
strPassword - - Password string used to find Login object.
Returns:
- Created Login object.

updateMetadataAll

public void updateMetadataAll()
Update any new/changed metadata for this AppServer.

openJDBCTable

public com.sas.rio.MVAResultSet openJDBCTable(com.sas.metadata.PhysicalTable physTable)
                                       throws AppServerException
Return SQL ResultSet (via JDBC) for given table.
Parameters:
physTable - - Object representing the PhysicalTable to open.
Returns:
- SQL ResultSet (MVAResultSet) of physical table open.

getSchemaLibrary

public com.sas.metadata.SASLibrary getSchemaLibrary(com.sas.metadata.DatabaseSchema m_metadata)
Return SASLibrary associated to a schema
Parameters:
physTable - - Object representing the PhysicalTable to open.
Returns:
- SASLibrary - 1st SASLibrary associated to Schema

bldOptionString

public static String bldOptionString(com.sas.metadata.AssociationList optionList,
                                     String optionRole)
* @todo fix this to work with Property objects

makeSQLConnection

public void makeSQLConnection()
                       throws AppServerException
Make connection for SQL processing.

getTable

public com.sas.rio.MVAResultSet getTable(String strLibref,
                                         String strTable,
                                         String strMemType,
                                         String[] sasPasswords,
                                         String strOptions)
                                  throws AppServerException
Return SQL ResultSet (via JDBC) for given table.
Parameters:
strLibref - - Libref string for library.
strTable - - Table name string.
strMemType - - SAS Table membertype. Pass null or "" for no type.
sasPasswords - - Array[3] of SAS password strings, in Read, Write, Alter order. Pass null or empty array for no password information.
strOptions - - Table options, if any. Pass null or "" for no option specification.
Returns:
- SQL ResultSet (MVAResultSet) of physical table.

makeSQLConnection

public String makeSQLConnection(String tempLibRef,
                                String engine,
                                String path,
                                String strIncomingOptions)
                         throws AppServerException
Make connection (libref) to library given by path, engine, & options.
Parameters:
tempLibRef - - Libref string to use for library.
engine - - Libname engine for library. Pass null or "" for no engine specification.
path - - Path to specified library. Pass null for no path specification.
strIncomingOptions - - Libname options to use. Pass null or "" for no option specification.
Returns:
- the libref assigned

assignLibref

public String assignLibref(String strLibref0,
                           String strEngine,
                           String strPath,
                           String strOptions)
                    throws AppServerException,
                           com.sas.metadata.MdException
Make connection (libref) to library given by path, engine, & options.
Parameters:
strLibref0 - - Libref string to use for library.
strEngine - - Libname engine for library. Pass null or "" for no engine specification.
strPath - - Path to specified library. Pass null for no path specification.
strOptions - - Libname options to use. Pass null or "" for no option specification.
Returns:
- the libref assigned

isPreassignedMetaEngine

public boolean isPreassignedMetaEngine(com.sas.metadata.SASLibrary iLib)
                                throws AppServerException
isPreassignedMetaEngine used to determine if a library is preassigned and is of type META
Parameters:
iLib - - the SASLibrary object that is to be assigned
Returns:
true if library has flag isPreassigned=1 and Engine=META
Throws:
AppServerException -  

assignLibref

public String assignLibref(com.sas.metadata.SASLibrary iLib)
                    throws AppServerException
Make connection (libref) to library given the SASLibrary object.
Parameters:
iLib - - the SASLibrary object that is to be assigned
Returns:
- the libref assigned

assignLibref

public String assignLibref(String strLibref0,
                           String strEngine,
                           String strPath,
                           String strOptions,
                           boolean useOldMethod)
                    throws AppServerException,
                           com.sas.metadata.MdException
Deprecated. As of 10/8/2001, the boolean has no efect

Make connection (libref) to library given by path, engine, & options.
Parameters:
strLibref0 - - Libref string to use for library.
strEngine - - Libname engine for library. Pass null or "" for no engine specification.
strPath - - Path to specified library. Pass null for no path specification.
strOptions - - Libname options to use. Pass null or "" for no option specification.
Returns:
- the libref assigned

isLibrefAssigned

public boolean isLibrefAssigned(com.sas.metadata.SASLibrary iLib)
                         throws AppServerException

isLibrefAssigned

public boolean isLibrefAssigned(String strLibref)
                         throws AppServerException

submitSQLStatement

public com.sas.rio.MVAResultSet submitSQLStatement(String strStatement)
                                            throws AppServerException
Execute the specified query against the rio connection in this appserver
Parameters:
selectStatement - - SQL Select statement to execute.
Returns:
- SQL ResultSet (MVAResultSet) containing list of tables on given library.

submitSQLStatement

public com.sas.rio.MVAResultSet submitSQLStatement(String strStatement,
                                                   com.sas.rio.MVAStatement sqlStatement)
                                            throws AppServerException
Execute the specified query against the rio connection in this appserver
Parameters:
strStatement - - SQL Select statement to execute.
sqlStatement - - MVAStatement to use to execute the Select statement.
Returns:
- SQL ResultSet (MVAResultSet) containing list of tables on given library.

closeJDBCTable

public void closeJDBCTable()
                    throws AppServerException
Close our JDBC connection to opened PhysicalTable.

dropSQLConnection

public void dropSQLConnection()
                       throws AppServerException
Drop all JDBC access connections.

waitForCompletion

public int waitForCompletion()
                      throws AppServerException
Wait for completion of AppServer operation. Method is synchronized, and used in conjunction with postCompletion().
Returns:
- Integer status code from AppServer operation.

***  This class is subject to change   ***



Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 15:46:53