|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
StoredProcess2Interface
instead.
public interface StoredProcessInterface
This is the original interface of the Stored Process service object.
It inherits from
com.sas.entities.RemoteEntityInterface
and a good understanding of the various
interfaces provided by com.sas.entities
is important to fully exploit this
interface. The interface only
supports Stored Processes in the Version 0 metadata format.
Stored process objects are either created by the
Information Service
from metadata or manually by the user using
methods provided by StoredProcessServiceInterface
If the stored process is created by the Information Service from metadata, setters cannot be used to modify most properties of the stored process. If a setter is invoked an IllegalStateException will be thrown - the doc on each setter describes whether this is applicable to the setter. If there are required parameters their values must be supplied and the service enforces this requirement.
If manually created, setters to set the file name, directory and connection must be invoked. If there are required parameters their values should be supplied. However, the service has no way of enforcing this requirement.
In version 9.2, Version 2 Stored Process service objects (StoredProcess2Interface
)
were introduced and methods common to both this interface and StoredProcess2Interface were moved
to StoredProcessBaseInterface
, which this interface now extends.
There was no change to set of methods supported by this interface in this refactoring.
Field Summary | |
---|---|
static int |
RESULT_TYPE_NONE
Deprecated. No package or stream is delivered by the stored process service. |
static int |
RESULT_TYPE_PERMANENT_FILE_PACKAGE
Deprecated. A permanent package (with backing in the file system) is delivered by the stored process service. |
static int |
RESULT_TYPE_PERMANENT_WEBDAV_PACKAGE
Deprecated. A permanent package (with WebDAV backing) is delivered by the stored process service. |
static int |
RESULT_TYPE_STREAM
Deprecated. Results are delivered via one of more Streams. |
static int |
RESULT_TYPE_TRANSIENT_PACKAGE
Deprecated. A transient package (with no backing) is delivered by the stored process service. |
Fields inherited from interface com.sas.services.storedprocess.StoredProcessBaseInterface |
---|
SERVER_TYPE_STOREDPROCESS, SERVER_TYPE_WORKSPACE |
Method Summary | |
---|---|
boolean |
addInputStream(java.lang.String streamKey)
Deprecated. Adds an input stream definition to the stored process. |
ExecutionInterface |
execute(boolean synchronous,
ExecutionStatusListenerInterface listener,
boolean createAlert,
java.lang.Object connection)
Deprecated. Execute the stored process. |
com.sas.entities.AttributeDescriptorInterface[] |
getParameters()
Deprecated. Get parameter descriptions. |
ResultHints |
getResultHintsInstance(int hintSubType)
Deprecated. Get a ResultHints object for specifying result hints for this stored process. |
int |
getResultType()
Deprecated. Gets the type of result. |
boolean |
isResultPackageReturned()
Deprecated. Determines whether a package is returned. |
void |
setParameterValue(java.lang.String name,
java.lang.Object value)
Deprecated. Sets the value of the specified parameter. |
void |
setParameterValues(java.util.Map map)
Deprecated. Sets the values of the specified parameters. |
void |
setResultHints(ResultHints resultHints)
Deprecated. Set hints for the result of the stored process. |
void |
setResultType(int resultType)
Deprecated. Sets the type of result. |
Methods inherited from interface com.sas.services.storedprocess.StoredProcessBaseInterface |
---|
addOutputStream, destroy, getDescription, getDirectory, getFileName, getInputStreamNames, getName, getOutputStreamNames, getServer, getServerType, hasParameters, setDescription, setName, setPrivilegedUser, setSourceFromFile |
Field Detail |
---|
static final int RESULT_TYPE_NONE
getResultType()
and the
newStoredProcess(SessionContextInterface, int, int)
method of StoredProcessServiceInterface.
static final int RESULT_TYPE_TRANSIENT_PACKAGE
getResultType()
and the
newStoredProcess(SessionContextInterface, int, int)
method of StoredProcessServiceInterface.
static final int RESULT_TYPE_PERMANENT_FILE_PACKAGE
getResultType()
and the
newStoredProcess(SessionContextInterface, int, int)
method of StoredProcessServiceInterface.
static final int RESULT_TYPE_PERMANENT_WEBDAV_PACKAGE
getResultType()
and the
newStoredProcess(SessionContextInterface, int, int)
method of StoredProcessServiceInterface.
static final int RESULT_TYPE_STREAM
getResultType()
and the
newStoredProcess(SessionContextInterface, int, int)
method of StoredProcessServiceInterface.
Method Detail |
---|
ExecutionInterface execute(boolean synchronous, ExecutionStatusListenerInterface listener, boolean createAlert, java.lang.Object connection) throws java.lang.IllegalStateException, ExecutionException, java.rmi.RemoteException
alert
item in the Personal Repository.
Execution of the stored process can be synchronous or asynchronous. In the synchronous case the method blocks until execution is complete. In the asynchronous case the method returns and the stored process is executed in a separate thread.
In both the synchronous and asynchronous cases this method does some preliminary processing synchronously and there is the potential for exceptions being thrown in this processing. These exceptions are listed in the throws clause and may occur when:
alert
is
created (if requested).
RESULT_TYPE_PERMANENT_WEBDAV_PACKAGE
.
After the preliminary processing described above is done,
an ExecutionInterface
is created to capture the state of
execution and provide access to results, and then execution proceeds
synchronously or asynchronously as requested. The
created ExecutionInterface is returned by this method. If there are any
exceptions from this point onward, they can be obtained via ExecutionBaseInterface.getExceptions()
. It is possible that multiple
exceptions have occurred and the following is a list of specializations
of ExecutionException
that may be present in the list:
Note: the execute() method may be called multiple times with different sets of parameters. On invocation all relevant information is copied before the method returns. Once the method returns the StoredProcessInterface object may be modified and execute() invoked again. Or, if there is no further use for the stored process object it may be destroyed.
synchronous
- true: execute synchronously; false: execute
asynchronously.listener
- specifies the listener that gets control when
execution completes; can be null.createAlert
- true: capture results by creating an
alert
item; false: do not capture results.connection
- This argument should be null if the service is to
obtain a connection. If a connection is supplied the following are valid
argument types:
String
: id of the session in which the stored
process is to be executed. This argument is specific to stored prcesses
executing on StoredProcess servers and is used to execute the stored
process in an existing session. If execution of a previous stored
process resulted in the creation of a session, a subsequent stored
process can use this method to connect to that session by specifying the
sessionID of that session.
ConnectionInterface
: the
underlying connection object should be appropriate to the type of server
on which the stored process executes.
IWorkspace
: if the stored process executes
on a Workspace server. The StoredProcess Service obtains the ILanguageService
object from the client supplied IWorkspace. The client should not
use the ILanguageService associated with the supplied IWorkspace
during the execution of the stored process.
IStoredProcessServer
: if the
stored process executes on a StoredProcess server.
ExecutionInterface
object describing
the state and the results of the execution.
ExecutionInterface.getStatus()
provides information about different
completion codes generated by the execute() method.
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if there is no session or user context or
if destroy() has been called.
ExecutionException
- or one of its specializations.
The following specializations can be thrown
InvalidParameterValueException javadoc
).
SessionNotFoundException javadoc
).
SessionNotAvailableException javadoc
).
Also see ExecutionInterface.getStatus()
boolean addInputStream(java.lang.String streamKey) throws java.rmi.RemoteException, java.lang.IllegalStateException
Input streams and output streams use the same fileref name space.
addInputStream
in interface StoredProcessBaseInterface
streamKey
- name of the input stream (must be a valid SAS fileref
name) Stream names have the following
restrictions:java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- setResultType(int)
has been invokedStoredProcessBaseInterface.SERVER_TYPE_STOREDPROCESS
int getResultType() throws java.rmi.RemoteException
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.void setResultType(int resultType) throws java.lang.IllegalStateException, java.rmi.RemoteException
newStoredProcess(SessionContextInterface, int, int)
method of StoredProcessServiceInterface for
a list of result types which are valid for this server type. The result type
can be set to any of the other result types that are valid for the server.
If the result type specified is the same as the current
result type no changes are made.
If the result type is changed, a subsequent call to getResultHintsInstance(int)
will
return a newly constructed ResultHints
sub-classed object which is appropriate
for the new result type. If result metadata associated with the old result type
is desired, getResultHintsInstance(int)
should be called before setResultType() is called.
Any streams that supply input to the stored process are not affected by this call.
If the result type is switched to RESULT_TYPE_STREAM
, it is the
responsibility of the client to add streams (see addInputStream(java.lang.String)
) the stored process can output to. Also, if
the result type is switched from RESULT_TYPE_STREAM
the streams
the stored process wrote output to (typically, one named "_WEBOUT") are deleted.
resultType
- specifies the type of result.
java.lang.IllegalStateException
- java.rmi.RemoteException
- if a network anomaly is encountered.boolean isResultPackageReturned() throws java.rmi.RemoteException
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.void setResultHints(ResultHints resultHints) throws ServiceException, java.rmi.RemoteException
getResultHintsInstance(int)
.
java.rmi.RemoteException
- if a network anomaly is encountered.
ServiceException
- if there is an error validating the hints specified.
The text of the exception should provide additional information.
java.lang.IllegalStateException
- ResultHints getResultHintsInstance(int hintSubType) throws java.rmi.RemoteException
setResultHints()
can be used to direct the output of a stored process to
a location other than that already defined. Do note that this mechanism
does not allow the type of the result (e.g., package to non-package) to be changed.
Hints objects are returned for all stored processes with one of the result package result types.
If a hints object is already associated with this stored process and it
is of the same type as that requested, a clone of the object is returned.
For stored processes created from metadata, the hints object is associated with the
stored process when the stored process is created from metadata and
reflects the type and location of the results; for manually created stored processes,
a hints object is associated after a call to setResultHints()
following a call to this method.
hintSubType
- this depends on the type of the result specified when this stored
process was created. For
TransientPackageResultHints
PermanentPackageResultHints
WebDAVPackageURLResultHints
if hintSubType is ResultHints.HINT_SUBTYPE_WEBDAV_URL
WebDAVPackageDAVServerResultHints
if hintSubType is ResultHints.HINT_SUBTYPE_WEBDAV_DAVSERVER
WebDAVPackagePRResultHints
if hintSubType is ResultHints.HINT_SUBTYPE_WEBDAV_USER_PR
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if the hintSubType is not appropriate for
the resultType of the stored process created from metadata or destroy() has been called or
hintSubType is ResultHints.HINT_SUBTYPE_SET and there are no associated hints.com.sas.entities.AttributeDescriptorInterface[] getParameters() throws java.rmi.RemoteException
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.void setParameterValue(java.lang.String name, java.lang.Object value) throws java.rmi.RemoteException, com.sas.entities.AttributeSetException
If the parameter has an Object[] value, what is set on the stored process object (i.e., on the underlying Entity object which implements it) is not the reference passed in but a newly created String object. The toString() method is called on each element of the array and the values are concatenated - separated by the Unit Separator (hex 1f) character - to construct this newly created String object. For stored processes running on a Workspace server only one value is permitted per parameter and if a Object[] is specified it must have only one value. The Unit Separator character used by the Stored Process Service is intended to be transparent to the client. However, clients intending to manipulate the Entity after the call to this method need to be aware of this implementation detail. And, use of this character by the client in the value String can have unintended consequences and is therefore not recommended. How multi-valued parameters are made visible to the SAS stored process code is discussed in the Input Parameters section of the Developer's Guide.
name
- name of the parameter. Parameter names have the following
restrictions:value
- value of the parameter value. It is recommended that the value not
contain the Unit Separator (hex 1f) character for the reasons described above.
java.rmi.RemoteException
- if a network anomaly is encountered.
com.sas.entities.AttributeSetException
- - if the type of the value parameter is
not appropriate (for reasons as described in the
setAttribute()
method of the base class) or if an array of more than one element is supplied
to a stored process running on the Workspace Server.
java.lang.IllegalStateException
- if destroy() has been called.void setParameterValues(java.util.Map map) throws java.rmi.RemoteException, com.sas.entities.AttributeSetException
setParameterValue(String,
Object)
.
map
- the Map
contains parameter
name (String) value (Object) pairs.
java.rmi.RemoteException
- if a network anomaly is encountered.
com.sas.entities.AttributeSetException
- - if the type of the value parameter is not
supported.
java.lang.IllegalStateException
- if destroy() has been called.
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |