|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StoredProcess2Interface
This interface describes the second generation of the stored process service object.
It extends StoredProcessBaseInterface
which contains the methods
common to both this interface and StoredProcessInterface
. The interface
supports stored processes in the Version 1 metadata format introduced in 9.2 as well
as stored processes in the Version 2 metadata format introduced in 9.3.
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.
When this service object is constructed, the parameters of the Stored Process
are deserialized into a PromptGroupInterface
rooted hierarchy and a
new PromptValues
object is constructed using this PromptGroupInterface.
This PromptValuesInterface
is available via getPromptValues()
and
can be used for parameter manipulation. The PromptGroupInterface is available
from the PromptValuesInterface. 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.
This parameter model is based on the Prompting Framework and a good understanding of that framework is needed to to fully exploit it.
Field Summary | |
---|---|
static int |
RESULT_TYPE_NONE
No package or stream is delivered by the stored process service. |
static int |
RESULT_TYPE_PACKAGE
A package is delivered by the stored process service via the ExecutionBaseInterface.getResultPackage() method. |
static int |
RESULT_TYPE_STREAM
Results are delivered via one of more Streams. |
Fields inherited from interface com.sas.services.storedprocess.StoredProcessBaseInterface |
---|
SERVER_TYPE_STOREDPROCESS, SERVER_TYPE_WORKSPACE |
Method Summary | |
---|---|
boolean |
addInputStream(java.lang.String streamKey)
Adds an input stream definition to the stored process. |
boolean |
addOutputStream(java.lang.String streamKey,
boolean isMultiPass)
Adds an output stream definition to the stored process. |
Execution2Interface |
execute(boolean synchronous,
ExecutionStatusListener2Interface listener,
boolean createAlert,
java.lang.Object connection)
Execute the stored process. |
Execution2Interface |
executeAsynch(ExecutionStatusListener2Interface listener,
boolean createAlert)
Execute the stored process asynchronously. |
java.lang.String |
getClientName()
Returns the client name. |
ConnectionInterface |
getConnection()
Get a connection for stored process execution. |
java.util.List<GenericStream> |
getDataSources()
Returns a list of the stream data sources. |
java.util.List<GenericStream> |
getDataTargets()
Returns a list of stream data targets. |
java.lang.String[] |
getInputStreamNames()
Deprecated. Use getDataTargets() . Returns the
fileref names of the GenericStream and
XMLStream objects returned by getDataTargets(). |
OutputParameterInterface |
getOutputParameter(java.lang.String name)
Return the OutputParameterInterface object
corresponding to the name requested. |
java.util.List<OutputParameterInterface> |
getOutputParameters()
Return a list of output parameters defined in metadata as OutputParameterInterface objects. |
java.lang.String[] |
getOutputStreamNames()
Deprecated. Use getDataSources() . Returns the
fileref names of the GenericStream and
XMLStream objects returned by getDataSources(). |
com.sas.prompts.definitions.PromptDefinitionInterface[] |
getParameters()
Gets parameter descriptions. |
java.lang.Object |
getParameterValue(java.lang.String parameterName)
Gets the value of a parameter. |
com.sas.prompts.PromptValuesInterface |
getPromptValues()
Returns the PromptValuesInterface associated with this Stored Process service object. |
int |
getResultType()
Gets the type of result delivered by the service. |
LogicalServerInterface |
getServer()
Get the the logical server the stored process runs on. |
int |
getServerType()
Get the type of server that the stored process runs on. |
boolean |
isPackageCapable()
Does the stored process have the result capability of package enabled. |
boolean |
isStreamCapable()
Does the stored process have the result capability of stream enabled. |
void |
setClientName(java.lang.String clientName)
Sets the client name. |
void |
setInputDataTable(java.lang.String tableName,
java.io.InputStream inputStream,
java.lang.String memberName,
java.lang.String xmlLibraryOptions)
Specifies client side input to be used for the table via the XML libname engine. |
void |
setInputDataTable(java.lang.String tableName,
java.lang.String libref,
java.lang.String memberName)
Specifies the two level name for a server side input table. |
void |
setInputFileref(java.lang.String fileref,
java.io.InputStream inputStream)
Associates a client supplied binary file with the fileref. |
void |
setInputFileref(java.lang.String fileref,
java.io.Reader reader)
Associates a client supplied text file with the fileref. |
void |
setInputFileref(java.lang.String fileref,
java.lang.String engine,
java.lang.String path,
java.lang.String options)
Associates a path on the server with the fileref used for input. |
void |
setLogicalServerType(com.sas.services.storedprocess.metadata.StoredProcessInterface.LogicalServerType logicalServerType)
Sets the type of logical server to be used for execution. |
void |
setOutputDataTable(java.lang.String tableName,
java.io.OutputStream outputStream,
java.lang.String memberName,
java.lang.String xmlLibraryOptions)
Specifies client side output to be used for the table via the XML libname engine. |
void |
setOutputDataTable(java.lang.String tableName,
java.lang.String libref,
java.lang.String memberName)
Specifies the two level name for a server side output table. |
void |
setOutputFileref(java.lang.String fileref,
java.io.OutputStream outputStream)
Specifies the OutputStream to be used to write the output of the fileref to. |
void |
setOutputFileref(java.lang.String fileref,
java.lang.String engine,
java.lang.String path,
java.lang.String options)
Associates a path on the server with the fileref used for output. |
void |
setOutputFileref(java.lang.String fileref,
java.io.Writer writer)
Specifies the Writer to be used to write the output of the fileref to. |
com.sas.prompts.definitions.PromptDefinitionInterface |
setParameterValue(java.lang.String name,
java.lang.Object value)
Sets the value of the specified parameter on the PromptValues object associated with this stored process. |
java.util.Map |
setParameterValues(java.util.Map map)
Sets the values of the specified parameters. |
java.util.List<com.sas.prompts.definitions.PromptDefinitionInterface> |
setParameterValues(com.sas.prompts.PromptValuesInterface promptValues)
Sets values for the parameters of this Stored Process from the PromptValuesInterface supplied. |
void |
setPromptValues(com.sas.prompts.PromptValuesInterface promptValues)
Sets the PromptValuesInterface associated with this Stored Process service object. |
void |
setServerContext(ServerContextInterface serverContext)
Sets the server context to be used to execute the stored process. |
void |
validatePromptValues()
Validates prompt values. |
Methods inherited from interface com.sas.services.storedprocess.StoredProcessBaseInterface |
---|
destroy, getDescription, getDirectory, getFileName, getName, hasParameters, setDescription, setName, setPrivilegedUser, setSourceFromFile |
Field Detail |
---|
static final int RESULT_TYPE_NONE
getResultType()
,
Constant Field Valuesstatic final int RESULT_TYPE_PACKAGE
ExecutionBaseInterface.getResultPackage()
method.
getResultType()
,
Constant Field Valuesstatic final int RESULT_TYPE_STREAM
getResultType()
,
Constant Field ValuesMethod Detail |
---|
Execution2Interface execute(boolean synchronous, ExecutionStatusListener2Interface 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. Another alternative for asynchronous behavior is
executeAsynch(ExecutionStatusListener2Interface, boolean)
.
A discussion of additional input parameters generated by the service can be found here.
Depending on the type of parameter and the associated value, one or more name value pairs may be created to capture the value. Refer to the javadoc of the getMacroVariableValues method of the corresponding type in com.sas.datatypes for details.
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).
After the preliminary processing described above is done,
an Execution2Interface
is created to capture the state of
execution and provide access to results, and then execution proceeds
synchronously or asynchronously as requested. The
created Execution2Interface 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. Do note a ConnectionInterface
is not serializable or remoteable.
IWorkspace_1_1
: if the stored process executes
on a Workspace server. For 9.2 stored processes, the StoredProcess Service
obtains the ILanguageService
object from the client supplied IWorkspace_1_1. The client should not
use the ILanguageService associated with the supplied IWorkspace
during the execution of the stored process.
IStoredProcessServer_1_1
: if the
stored process executes on a StoredProcess server.
Execution2Interface
object describing
the state and the results of the execution.
Execution2Interface.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
SessionNotFoundException javadoc
).
SessionNotAvailableException javadoc
).
Also see Execution2Interface.getStatus()
and #setLogicalServerType(LogicalServerType)
.
Execution2Interface executeAsynch(ExecutionStatusListener2Interface listener, boolean createAlert) throws java.lang.IllegalStateException, ExecutionException, java.rmi.RemoteException
alert
item in the Personal Repository.
If synchronous behavior is desired see execute(boolean, ExecutionStatusListener2Interface, boolean, Object)
.
A discussion of additional input parameters generated by the service can be found here.
Depending on the type of parameter and the associated value, one or more name value pairs may be created to capture the value. Refer to the javadoc of the getMacroVariableValues method of the corresponding type in com.sas.datatypes for details.
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).
After the preliminary processing described above is done,
an Execution2Interface
is created to capture the state of
execution and provide access to results and, then, a new thread is created. The
created Execution2Interface is returned by this method. In the newly created
thread a connection is obtained and stored process execution occurs. Any exceptions
that occur in this new thread 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 executeAysnch() 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 executeAysnch() invoked again. Or, if there is no further use for the stored process object it may be destroyed.
If this method is used to execute a stored process which streams input and / or
output, stream handles via Execution2Interface.getInputStream(Object)
or Execution2Interface.getOutputStream(Object)
methods will not be available
until after a connection to the server is made. If no connection is available, those
method will block. The consumer can control blocking
behavior by using Execution2Interface.waitForConnection(long)
or
Execution2Interface.waitForConnection()
and not obtaining the streams until
a connection has been made.
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.
Execution2Interface
object describing
the state and the results of the execution.
Execution2Interface.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
Also see Execution2Interface.getStatus()
and #setLogicalServerType(LogicalServerType)
.
boolean addInputStream(java.lang.String streamKey) throws java.rmi.RemoteException, java.lang.IllegalStateException
Input streams and output streams use the same fileref name space.
If successful, a GenericStream
object is added
to the list of data targets.
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
- StoredProcessBaseInterface.SERVER_TYPE_STOREDPROCESS
for version 1 stored processesboolean addOutputStream(java.lang.String streamKey, boolean isMultiPass) throws java.rmi.RemoteException, java.lang.IllegalStateException
Input streams and output streams use the same fileref namespace.
If successful, a GenericStream
object is added
to the list of data sources.
addOutputStream
in interface StoredProcessBaseInterface
streamKey
- name of the output stream (must be a valid SAS fileref
name)isMultiPass
- whether the stream supports multi-pass reads.
Required when the stored process needs to make multiple passes over the
data.
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- StoredProcessBaseInterface.SERVER_TYPE_STOREDPROCESS
for version 1 stored processesboolean isStreamCapable() throws java.rmi.RemoteException
java.rmi.RemoteException
- if a network anomaly is encountered.boolean isPackageCapable() throws java.rmi.RemoteException
java.rmi.RemoteException
- if a network anomaly is encountered.com.sas.prompts.definitions.PromptDefinitionInterface[] getParameters() throws java.rmi.RemoteException
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.java.lang.Object getParameterValue(java.lang.String parameterName) throws java.rmi.RemoteException
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.com.sas.prompts.definitions.PromptDefinitionInterface setParameterValue(java.lang.String name, java.lang.Object value) throws java.rmi.RemoteException, ServiceException, com.sas.prompts.InvalidPromptValueException
If new, the parameter is added in an implementation defined fashion and the only allowed values are of type String or String[] - supplying a value of any other type or a null value will result in a ServiceException.
If it is desired that the parameter be added to a certain group or values of a type other than String or String[] be handled, a PromptDefinitionInterface should be appropriately created before this method is called.
name
- name of the parameter. Parameter names have the following
restrictions:value
- value of the parameter value.
java.rmi.RemoteException
- if a network anomaly is encountered.
com.sas.prompts.InvalidPromptValueException
- if thrown by the underlying Prompting
Framework
ServiceException
- if the parameter name is not valid or if the value is not of type String or String[] for a new parameter
java.lang.IllegalStateException
- if destroy() has been called.java.util.Map setParameterValues(java.util.Map map) throws java.rmi.RemoteException, ServiceException
The name is first validated. Next, the actual setting of values is
delegated to the setPromptValuesByNameValuePair
method of PromptUtil
. That method ignores any prompt definition with a
prompt name which does not exists in this Stored Process. Finally, new parameters
(those ignored by the PromptUtil
method) are added
using setParameterValue(String, Object)
.
map
- the Map
containing values -
the key is a String representing the parameter name and the value is the Object
representing the parameter value
Map
of errors that occurred. The key is the prompt name and the value is the
exception which occurred processing the prompt with that name.
java.rmi.RemoteException
- if a network anomaly is encountered.
ServiceException
- if there is an error in name validation
java.lang.IllegalArgumentException
- if any of the Map keys are not Strings.
java.lang.IllegalStateException
- if destroy() has been called.com.sas.prompts.PromptValuesInterface getPromptValues() throws java.rmi.RemoteException
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if destroy() has been called.void setPromptValues(com.sas.prompts.PromptValuesInterface promptValues) throws java.rmi.RemoteException
promptValues
- PromptValuesInterface that is to replace the PromptValuesInterface
used by this Stored Process
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if destroy() has been called.java.util.List<com.sas.prompts.definitions.PromptDefinitionInterface> setParameterValues(com.sas.prompts.PromptValuesInterface promptValues) throws java.rmi.RemoteException, ServiceException
setPromptValuesByNameValuePair
method of PromptUtil
. That method ignores
any prompt definition with a prompt name which does not
exists in this Stored Process - such PromptDefinitions are added to a list which
is returned. If there are no values in this category an empty list is returned.
If a PromptDefinition has its value cleared in the input PromptValuesInterface
an existing prompt of the same name in the Stored Process is cleared except if
it has default value different from that in the Stored Process in which case the
incoming default value will be used.
Fixed prompts are not affected by this method.
If the PromptValuesInterface supplied is the same (identical reference) as the one
used by the stored process (which is the one surfaced via getPromptValues()
),
this method is a no-op and returns an empty list.
If an Exception occurs in setting the value, the exception is captured and a Info level message containing the exception written to the log.
The intent of this method is for the stored process to be supplied with parameter
values for execution. If prompt manipulation or maintenance of UI state is desired
consumers should consider obtaining the prompts via getPromptValues()
, doing
needed manipulation and then setting them on the stored process via setPromptValues(PromptValuesInterface)
.
promptValues
- PromptValuesInterface containing parameter values that are
to be set on this Stored Process
java.rmi.RemoteException
ServiceException
java.util.List<OutputParameterInterface> getOutputParameters() throws java.rmi.RemoteException
OutputParameterInterface
objects.
java.rmi.RemoteException
- if a network anomaly is encountered.OutputParameterInterface getOutputParameter(java.lang.String name) throws java.rmi.RemoteException
OutputParameterInterface
object
corresponding to the name requested. OutputParameterInterface
objects are only available in this interface for output parameters
defined in metadata.
name
- of the output parameter requested
java.rmi.RemoteException
- if a network anomaly is encounteredjava.lang.String[] getInputStreamNames() throws java.rmi.RemoteException, java.lang.IllegalStateException
getDataTargets()
. Returns the
fileref names of the GenericStream
and
XMLStream
objects returned by getDataTargets().
StoredProcessBaseInterface
getInputStreamNames
in interface StoredProcessBaseInterface
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if the stored process runs
on a WorkspaceServer or if destroy() has been called.java.lang.String[] getOutputStreamNames() throws java.rmi.RemoteException, java.lang.IllegalStateException
getDataSources()
. Returns the
fileref names of the GenericStream
and
XMLStream
objects returned by getDataSources().
StoredProcessBaseInterface
getOutputStreamNames
in interface StoredProcessBaseInterface
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if the stored process runs
on a WorkspaceServer or if destroy() has been called.java.util.List<GenericStream> getDataSources() throws java.rmi.RemoteException
This method returns the types of data sources that can be present in a 9.2 stored process and does not return the types of data sources introduced post 9.2.
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if destroy() has been called.java.util.List<GenericStream> getDataTargets() throws java.rmi.RemoteException
This method returns the types of data sources that can be present in a 9.2 stored process and does not return the types of data sources introduced post 9.2.
java.rmi.RemoteException
- if a network anomaly is encountered.
java.lang.IllegalStateException
- if destroy() has been called.void setClientName(java.lang.String clientName) throws java.rmi.RemoteException
StoredProcessServiceInterface.getClientName()
)
at construction time.
clientName
- client name
java.rmi.RemoteException
java.lang.String getClientName() throws java.rmi.RemoteException
setClientName(String)
for more information.
java.rmi.RemoteException
int getResultType() throws ServiceException, java.rmi.RemoteException
RESULT_TYPE_NONE
, RESULT_TYPE_PACKAGE
or RESULT_TYPE_STREAM
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.
ServiceException
- if there are inconsistencies among the capabilities
of the stored process, the parameter values and the type of server the stored process
is running onvoid validatePromptValues() throws java.lang.IllegalStateException, com.sas.prompts.InvalidPromptValueException, java.rmi.RemoteException
If there is a validation error the exception message contains the reason.
com.sas.prompts.InvalidPromptValueException
- if there is a validation error
java.lang.IllegalStateException
- if the object bound to the SessionContext using "com.sas.prompts.dataProviderKey" is not an instance of DataProviderInterface
java.rmi.RemoteException
- if a network anomaly is encountered.void setInputFileref(java.lang.String fileref, java.io.InputStream inputStream) throws ServiceException, java.rmi.RemoteException
If this method is invoked on a remote object, a serializable extension of
InputStream, e.g., InputStreamAdapter
should be supplied.
fileref
- inputStream
-
ServiceException
- if the fileref is not defined or the fileref is used for output
java.rmi.RemoteException
void setInputFileref(java.lang.String fileref, java.io.Reader reader) throws ServiceException, java.rmi.RemoteException
If this method is invoked on a remote object, a serializable extension of
Reader, e.g., ReaderAdapter
should be supplied.
fileref
- inputStream
-
ServiceException
- if the fileref is not defined or the fileref is used for output
java.rmi.RemoteException
void setInputFileref(java.lang.String fileref, java.lang.String engine, java.lang.String path, java.lang.String options) throws ServiceException, java.rmi.RemoteException
fileref
- inputStream
-
ServiceException
- if the fileref is not defined or the fileref is used for output
java.rmi.RemoteException
void setOutputFileref(java.lang.String fileref, java.io.OutputStream outputStream) throws ServiceException, java.rmi.RemoteException
If this method is invoked on a remote object, a serializable extension of
OutputStream, e.g., OutputStreamProxy
should be supplied.
fileref
- inputStream
-
ServiceException
- if the fileref is not defined or the fileref is used for input
java.rmi.RemoteException
void setOutputFileref(java.lang.String fileref, java.io.Writer writer) throws ServiceException, java.rmi.RemoteException
If this method is invoked on a remote object, a serializable extension of
Writer, e.g., WriterProxy
should be supplied.
fileref
- inputStream
-
ServiceException
- if the fileref is not defined or the fileref is used for input
java.rmi.RemoteException
void setOutputFileref(java.lang.String fileref, java.lang.String engine, java.lang.String path, java.lang.String options) throws ServiceException, java.rmi.RemoteException
fileref
- inputStream
-
ServiceException
- if the fileref is not defined or the fileref is used for input
java.rmi.RemoteException
void setInputDataTable(java.lang.String tableName, java.lang.String libref, java.lang.String memberName) throws ServiceException, java.rmi.RemoteException
If null or an empty string is specified for libref a one level name results.
If null or an empty string is specified for memberName, a value is obtained from the template table if a template table was assigned. If there is no template table, then the table parameter name is used.
tableName
- the table parameter name of a data table in metadatalibref
- name of the librefmemberName
- name of the dataset in the libref
ServiceException
java.rmi.RemoteException
void setInputDataTable(java.lang.String tableName, java.io.InputStream inputStream, java.lang.String memberName, java.lang.String xmlLibraryOptions) throws ServiceException, java.rmi.RemoteException
If null or an empty string is specified for memberName, a value is obtained from the template table if a template table was assigned. If there is no template table, then the table parameter name is used.
tableName
- the table parameter name of a data table in metadatainputStream
- which provides the (binary) input to the stored processmemberName
- name of the dataset in the librefxmlLibraryOptions
- options to be used when the LIBNAME statement using the XML libname engine is issued
ServiceException
java.rmi.RemoteException
void setOutputDataTable(java.lang.String tableName, java.lang.String libref, java.lang.String memberName) throws ServiceException, java.rmi.RemoteException
If null or an empty string is specified for libref a one level name results.
If null or an empty string is specified for memberName, a value is obtained from the template table if a template table was assigned. If there is no template table, then the table parameter name is used.
tableName
- the table parameter name of a data table in metadatalibref
- name of the librefmemberName
- name of the dataset in the libref
ServiceException
java.rmi.RemoteException
void setOutputDataTable(java.lang.String tableName, java.io.OutputStream outputStream, java.lang.String memberName, java.lang.String xmlLibraryOptions) throws ServiceException, java.rmi.RemoteException
If null or an empty string is specified for memberName, a value is obtained from the template table if a template table was assigned. If there is no template table, then the table parameter name is used.
tableName
- the table parameter name of a data table in metadataoutputStream
- which provides the output from the stored processmemberName
- name of the dataset in the librefxmlLibraryOptions
- options to be used when the LIBNAME statement using the XML libname engine is issued
ServiceException
java.rmi.RemoteException
void setServerContext(ServerContextInterface serverContext) throws ServiceException, java.rmi.RemoteException
StoredProcessInterface.isOtherServerContextAllowed()
returns true.
For stored process defined with a logical server type of
StoredProcessInterface.LogicalServerType.WORKSPACE
or StoredProcessInterface.LogicalServerType.STORED_PROCESS
,
this method checks to see if a server of that type exists and will throw a
ServiceException if it does not.
For stored process defined with a logical server type of StoredProcessInterface.LogicalServerType.ANY
this method checks to see if a server of either supported type exists and will throw
a ServiceException if one cannot be found.
If both this method and #setLogicalServerType(LogicalServerType)
are to be
called, this method should be called first and then setLogicalServerType() should be called
as setLogicalServerType() checks metadata to ensure that a server of the desired type
is defined. If this method is called after setLogicalServerType() the value set by
setLogicalServerType() will be ignored as this method uses the value defined in metadata.
Calls to getServer()
and getServerType()
should not be made until calls
to both this method and setLogicalServerType() are complete.
This method is invalid for 9.2 stored processes or manually created stored processes
and will throw an UnsupportedOperationException if invoked on one.
serverContext
- to be used for execution
ServiceException
- if the stored process does not permit execution on other server contexts,
if there is a metadata error, or for the reasons described above
java.rmi.RemoteException
void setLogicalServerType(com.sas.services.storedprocess.metadata.StoredProcessInterface.LogicalServerType logicalServerType) throws ServiceException, java.rmi.RemoteException
StoredProcessInterface.getLogicalServerType()
returns StoredProcessInterface.LogicalServerType.ANY
.
If a stored process is defined with StoredProcessInterface.LogicalServerType.ANY
, an attempt is made
to first get a connection to a Stored Process server. If the attempt is successful that
connection is used; if unsuccessful, an attempt is next made to obtain a connection to a
Workspace server. Invoking this method restricts the connection attempt to the type
of server specified; if no connection can be made to the specified type of server,
no additional attempt is made to connect to a different type of server.
The only valid arguments are StoredProcessInterface.LogicalServerType.STORED_PROCESS
and StoredProcessInterface.LogicalServerType.WORKSPACE
.
If both this method and setServerContext() are to be called, setServerContext() should be
called first and then this method should be called.
See setServerContext(ServerContextInterface)
for more information.
This method checks metadata to ensure that a server of the desired type is defined for the server context in effect.
This method is invalid for 9.2 stored processes or manually created stored processes and will throw an UnsupportedOperationException if invoked on one.
logicalServerType
- the type of server to connect to
ServiceException
- if the stored process does not permit execution on any logical server type,
if the argument is not valid, if a server of the type desired is
not defined in metadata or if there is a metadata exception
java.rmi.RemoteException
LogicalServerInterface getServer() throws java.rmi.RemoteException
For 9.2 stored processes this method returns the LogicalServer associated with the stored process.
For other stored processes, the LogicalServer returned
depends on the Logical Servers attached to the Server Context and the logical server type
defined in metadata and any prior calls to #setLogicalServerType(LogicalServerType)
and
setServerContext(ServerContextInterface)
. See setServerContext(ServerContextInterface)
for additional information. The LogicalServer returned is based on metadata and
the various settings previously described and not on whether the server is actually
running.
getServer
in interface StoredProcessBaseInterface
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.int getServerType() throws java.rmi.RemoteException
For other stored processes, the type returned
depends on the Logical Servers attached to the Server Context and the logical server type
defined in metadata and any prior calls to #setLogicalServerType(LogicalServerType)
and
setServerContext(ServerContextInterface)
. See setServerContext(ServerContextInterface)
for additional information. The type returned is based on metadata and
the various settings previously described and not on whether the server is actually
running.
getServerType
in interface StoredProcessBaseInterface
StoredProcessBaseInterface.SERVER_TYPE_STOREDPROCESS
or
StoredProcessBaseInterface.SERVER_TYPE_WORKSPACE
java.lang.IllegalStateException
- if destroy() has been called.
java.rmi.RemoteException
- if a network anomaly is encountered.ConnectionInterface getConnection() throws ServiceException, java.rmi.RemoteException
execute(boolean, ExecutionStatusListener2Interface, boolean, Object)
.
If the consumer calls this method, the consumer is responsible for managing the life-cycle
of the connection. The returned connection can be closed using
ConnectionInterface.close()
and the returned connection should be closed after
Execution2Interface.destroy()
has been called.
If the stored process supports it, the method will honor any prior call to
setServerContext(ServerContextInterface)
and #setLogicalServerType(LogicalServerType)
.
The method uses the same algorithm to obtain a connection as used by the
stored process service when the execute method is called without a supplied connection.
Do note that ConnectionInterface, the type returned by this method, is not serializable or remoteable.
ServiceException
- if a connection could not be obtained
java.lang.UnsupportedOperationException
- if the method is called on a manually created stored process
java.rmi.RemoteException
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |