|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExecutionBaseInterface
This interface describes various common aspects associated with the execution of a stored process.
Field Summary | |
---|---|
static int |
LOG_ALL_LINES
Get all lines of the log. |
static int |
LOG_FORMAT_HTML
Format the log as "html". |
static int |
LOG_FORMAT_TEXT
Format the log as "text". |
static int |
STATUS_COMPLETED_WITHOUT_EXCEPTION
The stored process has completed execution without any exception. |
static int |
STATUS_DESTROYED
The destroy method has been called. |
static int |
STATUS_EXCEPTION_OCCURRED
The execution of the stored process resulted in an exception. |
static int |
STATUS_EXECUTING
The stored process is executing. |
static int |
STATUS_SAS_EXCEPTION_OCCURRED
An exception occurred during the setup or execution stage of the stored process. |
Method Summary | |
---|---|
void |
destroy()
Free resources allocated by the service for this execution. |
ExecutionException[] |
getExceptions()
Get the exceptions which caused the stored process to complete with a status of STATUS_SAS_EXCEPTION_OCCURRED or
STATUS_EXCEPTION_OCCURRED . |
java.io.InputStream |
getInputStream(java.lang.Object streamKey)
Get an input stream. |
com.sas.io.InputStreamHeaderInterface |
getInputStreamHeader(java.lang.String streamKey)
Get the stream header for an input stream. |
java.io.OutputStream |
getOutputStream(java.lang.Object streamKey)
Get an output stream. |
com.sas.io.OutputStreamHeaderInterface |
getOutputStreamHeader(java.lang.String streamKey)
Get the stream header for an output stream. |
ResultPackageInterface |
getResultPackage()
Get the package produced by the execution of the stored process. |
int |
getSASConditionCode()
Get the SAS condition code associated with the execution of the stored process. |
java.lang.String |
getSessionID()
Get the session id associated with this execution. |
int |
getStatus()
Get the status of this execution. |
StoredProcessAlertItemInterface |
getStoredProcessAlert()
Get the stored process alert item associated with this execution. |
boolean |
isSynchronous()
Is the stored process being executed synchronously? |
java.lang.String |
readSASLog(int flag,
int maxLines)
Read the SAS log associated with this execution. |
int |
waitForCompletion()
Wait until the stored process completes execution. |
int |
waitForCompletion(long milliSecondTimeout)
Wait until the stored process completes execution or until the time specified has elapsed. |
Field Detail |
---|
static final int STATUS_EXECUTING
getStatus()
.
static final int STATUS_SAS_EXCEPTION_OCCURRED
getStatus()
.
Setting of this code implies the stored process did not complete
execution.
The exception can be obtained using getExceptions()
.
static final int STATUS_COMPLETED_WITHOUT_EXCEPTION
getStatus()
.
static final int STATUS_EXCEPTION_OCCURRED
getStatus()
.
The exception can be obtained using getExceptions()
.
The SAS log can be be obtained by invoking readSASLog(int, int)
.
static final int STATUS_DESTROYED
waitForCompletion()
or waitForCompletion(long)
. This
value is only returned if destroy()
gets called before
waitForCompletion
returns.
static final int LOG_ALL_LINES
readSASLog(int, int)
.
static final int LOG_FORMAT_TEXT
readSASLog(int, int)
.
static final int LOG_FORMAT_HTML
readSASLog(int, int)
. Log lines will be marked up with
HTML tags to indicate the type of log line.
NOTE, INFO, WARNING and ERROR messages are highlighted.
Method Detail |
---|
ResultPackageInterface getResultPackage() throws java.lang.IllegalStateException, java.rmi.RemoteException
See the sub-interface method (Execution2Interface.getResultPackage()
or
ExecutionInterface.getResultPackage()
for more details.
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
int getStatus() throws java.rmi.RemoteException
See the sub-interface method (Execution2Interface.getStatus()
or
ExecutionInterface.getStatus()
for more details.
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.boolean isSynchronous() throws java.rmi.RemoteException
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.ExecutionException[] getExceptions() throws java.rmi.RemoteException
STATUS_SAS_EXCEPTION_OCCURRED
or
STATUS_EXCEPTION_OCCURRED
.
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.java.lang.String readSASLog(int flag, int maxLines) throws java.rmi.RemoteException, java.lang.IllegalStateException, TransportException
LOG_ALL_LINES
.
If a call does not return all lines available, subsequent calls
to this method return lines in the log after those previously returned.
Once all lines have been returned, any subsequent calls will return an empty string.
System.getProperty("line.separator")
is used to obtain the newline character sequence that is inserted
after each line in the returned string. If LOG_FORMAT_HTML
type output is requested
the returned string is enclosed by "PRE" tags and another newline
character sequence appended after the closing "PRE" tag.
flag
- one of LOG_FORMAT_TEXT
or LOG_FORMAT_HTML
maxLines
- the maximum number of lines to get or
LOG_ALL_LINES
if all lines are needed
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if the status is STATUS_EXECUTING
or if destroy() has been called.
TransportException
- if there is a problem communicating with the SAS server.int waitForCompletion() throws java.lang.InterruptedException, java.rmi.RemoteException
getStatus()
.
java.lang.IllegalStateException
- if destroy() has been called.
java.lang.InterruptedException
- if the thread executing the method is interrupted
java.rmi.RemoteException
- if a network anomaly is encountered.int waitForCompletion(long milliSecondTimeout) throws java.lang.InterruptedException, java.rmi.RemoteException
milliSecondTimeout
- - the maximum time to wait in milliseconds
getStatus()
.
java.lang.IllegalStateException
- if destroy() has been called.
java.lang.InterruptedException
- if the thread executing the method is interrupted
java.rmi.RemoteException
- if a network anomaly is encountered.void destroy() throws java.rmi.RemoteException, java.lang.IllegalStateException, ConnectionFactoryException, TransportException
If the stored process is executed asynchronously and this method is called while
the stored process is still executing an IllegalStateException will be thrown by this method.
For such use cases, it's recommended that waitForCompletion()
be called before
the call to this method.
ConnectionFactoryException
- if thrown by the Connection Service
when closing the connection
java.lang.IllegalStateException
- if the status is STATUS_EXECUTING
or this method is called a second time.
TransportException
- if there is a problem communicating with the SAS server.
java.rmi.RemoteException
- if a network anomaly is encountered.java.lang.String getSessionID() throws java.lang.IllegalStateException, java.rmi.RemoteException
See the sub-interface method (Execution2Interface.getSessionID()
or
ExecutionInterface.getSessionID()
for more details.
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
StoredProcessAlertItemInterface getStoredProcessAlert() throws java.rmi.RemoteException
StoredProcessInterface's execute method
was called with its createAlert
parameter set to true.
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.java.io.InputStream getInputStream(java.lang.Object streamKey) throws java.lang.IllegalStateException, java.rmi.RemoteException
StoredProcessBaseInterface.SERVER_TYPE_STOREDPROCESS
.
See the sub-interface method (Execution2Interface.getInputStream(Object)
or
ExecutionInterface.getInputStream(Object)
for more details.
streamKey
- an object whose toString method provides the stream name.
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.java.io.OutputStream getOutputStream(java.lang.Object streamKey) throws java.lang.IllegalStateException, java.rmi.RemoteException
StoredProcessBaseInterface.SERVER_TYPE_STOREDPROCESS
.
streamKey
- an object whose toString method provides the stream name.
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.com.sas.io.InputStreamHeaderInterface getInputStreamHeader(java.lang.String streamKey) throws java.rmi.RemoteException
streamKey
- names the input stream.
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.com.sas.io.OutputStreamHeaderInterface getOutputStreamHeader(java.lang.String streamKey) throws java.rmi.RemoteException
streamKey
- names the output stream.
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.int getSASConditionCode() throws java.rmi.RemoteException
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if the status is STATUS_EXECUTING
or
STATUS_SAS_EXCEPTION_OCCURRED
, or if destroy() has been called.
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |