|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StoredProcessInterface
This is a generic interface for interacting with a repository entry that represents a SAS stored process object. An object implemented by this interface is also known as a stored process smart object.
This interface can also be used to create a new stored process in metadata. Sample code which creates a new stored process can be found in the description section of this package.
Consumers querying metadata are encouraged to use the model of stored processes introduced in 9.3. Using those getters will work for both styles of stored processes and there should be no need to make version specific tests.
Consumers modifying metadata will need to use version dependent code. Version dependent setters typically throw an UnsupportedOperationException if called on the wrong version of stored process and this is described in the method documentation.
Field Summary | |
---|---|
static com.sas.util.UsageVersion |
CURRENT_VERSION
The usage version corresponding to version of stored processes that are considered current in this release. |
static com.sas.util.UsageVersion |
NINETHREE_VERSION
The usage version corresponding to version of stored processes that were introduced in 9.3. |
static com.sas.util.UsageVersion |
NINETWO_VERSION
The usage version corresponding to version of stored processes that were introduced in 9.2. |
Fields inherited from interface com.sas.services.information.metadata.MetadataInterface |
---|
METADATA_STATE_DELETED, METADATA_STATE_DESTROYED, METADATA_STATE_NEW, METADATA_STATE_NORMAL, PERMISSION_READMETADATA, PERMISSION_WRITEMETADATA |
Method Summary | |
---|---|
void |
convertToVersion(com.sas.util.UsageVersion version)
Converts the stored process to the version specified. |
java.util.List<com.sas.services.storedprocess.metadata.DataSourceOrTarget> |
getDataSourcesAndTargets()
Returns the list of data sources and data targets. |
com.sas.services.storedprocess.metadata.StoredProcessInterface.LogicalServerType |
getLogicalServerType()
Gets the type of logical server the stored process runs on. |
java.util.List<OutputParameter> |
getOutputParameters()
Returns the list of output parameters. |
com.sas.prompts.PromptValuesInterface |
getPromptValues()
Convenience method to obtain a PromptValues object containing stored process prompts. |
LogicalServerInterface |
getServer()
Gets the the logical server smart object the stored process is designed to run on. |
ServerContextInterface |
getServerContext()
Gets the server context smart object associated with the stored process. |
java.lang.String |
getSourceCode()
Returns the source code of the stored process. |
com.sas.services.storedprocess.metadata.StoredProcessInterface.SourceCodeLocation |
getSourceCodeLocation()
Gets the location type of the source code. |
DirectoryInterface |
getSourceCodeRepository()
Gets the the source code repository smart object associated with the stored process. |
java.lang.String |
getSourceFileName()
Gets the the source code file name of the stored process. |
java.util.List<GenericStream> |
getStreams()
Returns the list of data sources and data targets. |
boolean |
isOtherServerContextAllowed()
Determines whether the stored process can run on a different server context. |
boolean |
isPackageCapable()
Describes whether the stored process has the result capability of package enabled. |
boolean |
isStreamCapable()
Describes whether the stored process has the result capability of stream enabled. |
java.lang.Object |
newServiceObject()
Obtains a service object used to execute the Stored Process. |
StoredProcessInterface |
newServiceObject(SessionContextInterface sessionContext)
Deprecated. The StoredProcessInterface
service object returned by this method cannot be used to avail of features introduced
in 9.2 or later.
See newServiceObject() . |
java.lang.Object |
newServiceObject(StoredProcessOptions options)
Obtains a service object used to execute the Stored Process. |
void |
setDataSourcesAndTargets(java.util.List<? extends com.sas.services.storedprocess.metadata.DataSourceOrTarget> dataSourcesAndTargets)
Sets the list of data sources and data targets. |
void |
setLogicalServerType(com.sas.services.storedprocess.metadata.StoredProcessInterface.LogicalServerType logicalServerType)
Sets the type of logical server the stored process runs on. |
void |
setOtherServerContextAllowed(boolean isOtherServerContextAllowed)
Sets whether the stored process can run on a different server context. |
void |
setOutputParameters(java.util.List<OutputParameter> outputParameters)
Sets the list of output parameters. |
void |
setResultCapabilities(boolean isPackageCapable,
boolean isStreamCapable)
Sets the result capabilities of the stored process. |
void |
setServer(LogicalServerInterface logicalServer)
Sets the logical server smart object the stored process runs on. |
void |
setServerContext(ServerContextInterface serverContext)
Sets the server context smart object the stored process runs on. |
void |
setSourceCode(java.lang.String sourceCode)
Sets the source code of the stored process. |
void |
setSourceCodeLocation(com.sas.services.storedprocess.metadata.StoredProcessInterface.SourceCodeLocation sourceCodeLocation)
Sets the location type of the source code. |
void |
setSourceCodeRepository(DirectoryInterface sourceCodeRepository)
Sets the source code repository associated with the stored process. |
void |
setSourceFileName(java.lang.String sourceFileName)
Sets the the source code file name of the stored process. |
void |
setStreams(java.util.List<? extends GenericStream> streams)
Sets the list of data sources and data targets. |
void |
update()
Persists the stored process after performing validation by invoking validate() . |
void |
validate()
Validates the stored process. |
Methods inherited from interface com.sas.services.information.publicobject.PublicObjectInterface |
---|
addProcessorInterface, getContainer, getIdentifier, getName, getObjectURI, getPathUrl, getProcessorInterface, getTypeDescriptor |
Field Detail |
---|
static final com.sas.util.UsageVersion NINETWO_VERSION
static final com.sas.util.UsageVersion NINETHREE_VERSION
static final com.sas.util.UsageVersion CURRENT_VERSION
In 9.3 this value is the same as NINETHREE_VERSION
.
Method Detail |
---|
StoredProcessInterface newServiceObject(SessionContextInterface sessionContext) throws ServiceException, java.rmi.RemoteException
StoredProcessInterface
service object returned by this method cannot be used to avail of features introduced
in 9.2 or later.
See newServiceObject()
.
StoredProcessInterface
service object used to execute the Stored Process. This is a legacy method used
to handle stored processes in pre-9.2 format. It will also "back-convert" 9.2 format
stored processes so that they can be executed by
StoredProcessInterface
. Its
behavior on a 9.3 format stored process is undefined.
sessionContext
- SessionContextInterface
to be used for the execution of the Stored Process
StoredProcessInterface
service object
java.rmi.RemoteException
- if a network anomaly is encountered
ServiceException
java.lang.Object newServiceObject(StoredProcessOptions options) throws ServiceException, java.rmi.RemoteException
This method is equivalent to calling
StoredProcessServiceInterface.newStoredProcess(StoredProcessInterface, StoredProcessOptions)
with this smart object and the specified StoredProcessOptions
parameter and the javadoc for
that method provides complete details of the effects of the options
parameter.
options
- to control the service object
java.rmi.RemoteException
- if a network anomaly is encountered
ServiceException
java.lang.Object newServiceObject() throws ServiceException, java.rmi.RemoteException
StoredProcess2Interface
.
If the smart object does not correspond to the version supported by
this service object a ServiceException will be thrown.
More specialized behavior
can be obtained by calling newServiceObject(StoredProcessOptions)
.
newServiceObject
in interface MetadataInterface
java.rmi.RemoteException
- if a network anomaly is encountered
ServiceException
- if an error occursvoid setServer(LogicalServerInterface logicalServer) throws ServiceException, java.rmi.RemoteException
This method is only valid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on other stored processes.
logicalServer
- the server to run the stored process on; if null is specified a NullPointerException is thrown
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredvoid setServerContext(ServerContextInterface serverContext) throws ServiceException, java.rmi.RemoteException
This method is invalid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on one.
logicalServer
- the server context to run the stored process on; if null is specified a NullPointerException is thrown
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredvoid setSourceCode(java.lang.String sourceCode) throws ServiceException, java.rmi.RemoteException
This method is invalid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on one.
At the current time this method is only supported if the source code location is
StoredProcessInterface.SourceCodeLocation.METADATA
.
sourceCode
- SAS source code, lines are separated using the '\n' character
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredjava.lang.String getSourceCode() throws ServiceException, java.rmi.RemoteException
At the current time this method is only supported if the source code location is
StoredProcessInterface.SourceCodeLocation.METADATA
and will return UnsupportedOperationException
if the source code location is StoredProcessInterface.SourceCodeLocation.FILE_SYSTEM
.
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredvoid setLogicalServerType(com.sas.services.storedprocess.metadata.StoredProcessInterface.LogicalServerType logicalServerType) throws ServiceException, java.rmi.RemoteException
This method is invalid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on one.
logicalServerType
- one of the values from StoredProcessInterface.LogicalServerType
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredcom.sas.services.storedprocess.metadata.StoredProcessInterface.LogicalServerType getLogicalServerType() throws ServiceException, java.rmi.RemoteException
For 9.2 stored processes the value returned is either StoredProcessInterface.LogicalServerType.WORKSPACE
or StoredProcessInterface.LogicalServerType.STORED_PROCESS
StoredProcessInterface.LogicalServerType
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredvoid setOtherServerContextAllowed(boolean isOtherServerContextAllowed) throws ServiceException, java.rmi.RemoteException
Stored processes which are defined to run on more than one server context are required to store their source code in metadata.
This method is invalid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on one.
isOtherServerContextAllowed
- whether a different server context to run the stored process can be specified at
execution time
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredboolean isOtherServerContextAllowed() throws ServiceException, java.rmi.RemoteException
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredfor additional information
This method returns false for 9.2 stored processes.
void setSourceCodeLocation(com.sas.services.storedprocess.metadata.StoredProcessInterface.SourceCodeLocation sourceCodeLocation) throws ServiceException, java.rmi.RemoteException
This method is invalid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on one.
If other servers contexts are to be allowed (set by calling setOtherServerContextAllowed(boolean)
with a true argument), this method should be called with StoredProcessInterface.SourceCodeLocation.METADATA
.
If other server contexts are not to be allowed, this method can be called with either
StoredProcessInterface.SourceCodeLocation
value. If the method is not called for a new stored process the
default setting will be StoredProcessInterface.SourceCodeLocation.FILE_SYSTEM
.
sourceCodeLocation
- one of StoredProcessInterface.SourceCodeLocation.METADATA
or StoredProcessInterface.SourceCodeLocation.FILE_SYSTEM
; if null is specified a NullPointerException is thrown
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredcom.sas.services.storedprocess.metadata.StoredProcessInterface.SourceCodeLocation getSourceCodeLocation() throws ServiceException, java.rmi.RemoteException
See setSourceCodeLocation(SourceCodeLocation)
for more details.
This method returns StoredProcessInterface.SourceCodeLocation.FILE_SYSTEM
for 9.2 stored processes.
StoredProcessInterface.SourceCodeLocation.METADATA
or StoredProcessInterface.SourceCodeLocation.FILE_SYSTEM
ServiceException
- if there's an exception getting the value
java.rmi.RemoteException
- if a network anomaly is encountered.void setSourceCodeRepository(DirectoryInterface sourceCodeRepository) throws ServiceException, java.rmi.RemoteException
9.2 stored processes only support source code in the file system.
For other stored processes this method will throw a ServiceException if the source code location
is not StoredProcessInterface.SourceCodeLocation.FILE_SYSTEM
.
sourceCodeRepository
- the source code repository associated with the stored process; if null is specified a NullPointerException is thrown
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredvoid setSourceFileName(java.lang.String sourceFileName) throws ServiceException, java.rmi.RemoteException
9.2 stored processes only support source code in the file system.
For other stored processes this method will throw a ServiceException if the source code location
is not StoredProcessInterface.SourceCodeLocation.FILE_SYSTEM
.
sourceFileName
- the source code file name of the stored process; if null is specified a NullPointerException is thrown
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredvoid setResultCapabilities(boolean isPackageCapable, boolean isStreamCapable) throws ServiceException, java.rmi.RemoteException
isPackageCapable
- true, if package capability is desired; false, if package capability is not desiredisStreamCapable
- true, if stream capability is desired; false, if stream capability is not desired
ServiceException
- if there's an exception setting the value
java.rmi.RemoteException
- if a network anomaly is encounteredLogicalServerInterface getServer() throws ServiceException, java.rmi.RemoteException
For 9.2 stored processes it returns the logical server that the stored process is associated with.
For other stored processes the value returned depends on the value returned by
getLogicalServerType()
. If that value is StoredProcessInterface.LogicalServerType.WORKSPACE
or StoredProcessInterface.LogicalServerType.STORED_PROCESS
it returns the Workspace server or
Stored Process server connected to the Server Context if that type of server exists and
null otherwise. If the value is StoredProcessInterface.LogicalServerType.ANY
, it first attempt to find
a Stored Process logical server definition attached to the Server Context and returns that
if it exists; if that does not exist, it looks for a Workspace logical server definition
attached to the same Server Context returning that if it exists; if neither is present,
a null is returned. Do note that the value returned is based on metadata definitions and
not on the presence of a running server.
ServiceException
- if there's an exception getting the value
java.rmi.RemoteException
- if a network anomaly is encountered.ServerContextInterface getServerContext() throws ServiceException, java.rmi.RemoteException
For 9.2 stored processes: a stored
process is associated with a logical server (the corresponding smart object is
returned by getServer()
). The logical server is associated with
a server context and the corresponding smart object for this server context is returned
by this method.
For other stored processes: a stored process is associated with a server context and this method returns the corresponding server context smart object.
A null is returned if one is not available, which should not happen under normal circumstances.
ServiceException
- if there's an exception getting the value
java.rmi.RemoteException
- if a network anomaly is encountered.DirectoryInterface getSourceCodeRepository() throws ServiceException, java.rmi.RemoteException
ServiceException
- if there's an exception getting the value
java.rmi.RemoteException
- if a network anomaly is encountered.java.lang.String getSourceFileName() throws ServiceException, java.rmi.RemoteException
ServiceException
- if there's an exception getting the value
java.rmi.RemoteException
- if a network anomaly is encountered.boolean isPackageCapable() throws ServiceException, java.rmi.RemoteException
ServiceException
- if there's an exception determining the value
java.rmi.RemoteException
- if a network anomaly is encountered.boolean isStreamCapable() throws ServiceException, java.rmi.RemoteException
ServiceException
- if there's an exception determining the value
java.rmi.RemoteException
- if a network anomaly is encountered.java.util.List<OutputParameter> getOutputParameters() throws ServiceException, java.rmi.RemoteException
OutputParameter
objects.
If there are no output parameters an empty list is returned.
ServiceException
- if there's an exception getting the value
java.rmi.RemoteException
- if a network anomaly is encountered.void setOutputParameters(java.util.List<OutputParameter> outputParameters) throws ServiceException, java.rmi.RemoteException
outputParameters
- list of OutputParameter
objects.
ServiceException
- if there are inconsistencies in the list of output parameters
java.rmi.RemoteException
- if a network anomaly is encounteredjava.util.List<GenericStream> getStreams() throws ServiceException, java.rmi.RemoteException
GenericStream
and XMLStream
objects and the DataSourceOrTarget.isSource()
method can be used to determine whether an object is a data source or data target.
If there are no data sources or data targets an empty list is returned.
Do note post 9.2 DataTable
support was added to the list of data sources
and targets. This method only returns the GenericStream
and XMLStream
objects present and will not return any DataTable
objects that are present.
ServiceException
- if there's an exception getting the value
java.rmi.RemoteException
- if a network anomaly is encountered.getDataSourcesAndTargets()
void setStreams(java.util.List<? extends GenericStream> streams) throws ServiceException, java.rmi.RemoteException
GenericStream
and XMLStream
objects and the DataSourceOrTarget.isSource()
method determines whether an object is a data source or data target.
Data sources and data targets are only supported for stored
processes which run on Stored Process servers in 9.2 stored processes;
for other stored processes, both Stored Process servers and Workspace servers support data sources
and data targets.
Specifying a null argument is equivalent to specifying an empty list.
This method is only valid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on other stored processes.
streams
- list of GenericStream
and XMLStream
objects
ServiceException
- if there are inconsistencies in the list of streams
java.rmi.RemoteException
- if a network anomaly is encounteredsetDataSourcesAndTargets(List)
java.util.List<com.sas.services.storedprocess.metadata.DataSourceOrTarget> getDataSourcesAndTargets() throws ServiceException, java.rmi.RemoteException
GenericStream
, XMLStream
and DataTable
objects.
The DataSourceOrTarget.isSource()
method can be used to determine whether an object is a data source or a data target.
If there are no data sources or data targets an empty list is returned.
Since 9.2 stored processes did not support DataTable
objects this method will
not return any DataTable objects for a 9.2 stored process.
ServiceException
- if there's an exception getting the value
java.rmi.RemoteException
- if a network anomaly is encountered.void setDataSourcesAndTargets(java.util.List<? extends com.sas.services.storedprocess.metadata.DataSourceOrTarget> dataSourcesAndTargets) throws ServiceException, java.rmi.RemoteException
GenericStream
, XMLStream
and DataTable
objects and
the DataSourceOrTarget.isSource()
method determines whether an object is a data source or data target.
This method is invalid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on one.
Specifying a null argument is equivalent to specifying an empty list.
dataSourcesAndTargets
- list of data sources and targets objects
ServiceException
- if there are inconsistencies in the list of streams
java.rmi.RemoteException
- if a network anomaly is encounteredvoid validate() throws ServiceException, java.rmi.RemoteException
update()
method is called to ensure that the
values set on the stored process are consistent.
For a 9.2 stored process, this method checks that
For a 9.3 stored process, this method checks that
ServiceException
- if an inconsistent set of values has been set
java.rmi.RemoteException
- if a network anomaly is encounteredvoid update() throws ServiceException, java.rmi.RemoteException
validate()
.
If validation is not successful, the stored process is not persisted. Do notice if
persistence is done through a mechanism other than invoking the update method,
validation will not be done (unless explicitly invoked via validate()
)
and an inconsistent set of metadata may be persisted.
update
in interface MetadataInterface
ServiceException
- if an exception was thrown while updating
java.rmi.RemoteException
- if a network anomaly is encounteredMetadataInterface.update().
void convertToVersion(com.sas.util.UsageVersion version) throws ServiceException, java.rmi.RemoteException
VersionIncompatibleException
if the conversion cannot be performed. After this method is called, update()
should be
called to persist the changes to the metadata server.
This method should only be called
on a well-formed stored process with one exception. If the
InformationServiceInterface.newMetadataInFolder(com.sas.services.information.metadata.FolderInterface, com.sas.services.information.RepositoryInterface, String, String)
method is called to create a new stored process, a version 1 stored process is created. In that
case, if a different version is desired this method should be called immediately - before
any other setters are called.
If an existing stored process is to be modified and converted it is recommended that this method first be called to perform the conversion, setters then be called to modify the stored process and finally update() be called to write out the stored process to the metadata repository. Alternatively, if the setters are called first, validate() must be called before the call to this method and update().
If the above "best practices" are not followed, results may be unpredictable and a ServiceException may be thrown.
version
- the version to convert to; one of NINETWO_VERSION
, NINETHREE_VERSION
or CURRENT_VERSION
.
ServiceException
java.rmi.RemoteException
com.sas.prompts.PromptValuesInterface getPromptValues() throws ServiceException, java.rmi.RemoteException
Do note the returned object is for client use. The underlying PromptGroup should not be modified as it belongs to this smart object; if modified, the results are undefined.
ServiceException
java.rmi.RemoteException
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |