*** This interface provides Binary Compatibility only, not Source Compatibility ***
Interface StoredProcessInterface
- All Superinterfaces:
MetadataInterface,PublicObjectInterface,Remote, com.sas.services.util.UpgradeInterface
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.
- Since:
- 9.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.sas.util.UsageVersionThe usage version corresponding to version of stored processes that are considered current in this release.static final com.sas.util.UsageVersionThe usage version corresponding to version of stored processes that were introduced in 9.3.static final com.sas.util.UsageVersionThe 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
Modifier and TypeMethodDescriptionvoidconvertToVersion(com.sas.util.UsageVersion version) Converts the stored process to the version specified.List<DataSourceOrTarget> Returns the list of data sources and data targets.StoredProcessInterface.LogicalServerTypeGets the type of logical server the stored process runs on.List<OutputParameter> Returns the list of output parameters.com.sas.prompts.PromptValuesInterfaceConvenience method to obtain a PromptValues object containing stored process prompts.Gets the the logical server smart object the stored process is designed to run on.Gets the server context smart object associated with the stored process.StringReturns the source code of the stored process.StoredProcessInterface.SourceCodeLocationGets the location type of the source code.Gets the the source code repository smart object associated with the stored process.StringGets the the source code file name of the stored process.List<GenericStream> Returns the list of data sources and data targets.booleanDetermines whether the stored process can run on a different server context.booleanDescribes whether the stored process has the result capability of package enabled.booleanDescribes whether the stored process has the result capability of stream enabled.ObjectObtains a service object used to execute the Stored Process.newServiceObject(SessionContextInterface sessionContext) Deprecated.ObjectnewServiceObject(StoredProcessOptions options) Obtains a service object used to execute the Stored Process.voidsetDataSourcesAndTargets(List<? extends DataSourceOrTarget> dataSourcesAndTargets) Sets the list of data sources and data targets.voidsetLogicalServerType(StoredProcessInterface.LogicalServerType logicalServerType) Sets the type of logical server the stored process runs on.voidsetOtherServerContextAllowed(boolean isOtherServerContextAllowed) Sets whether the stored process can run on a different server context.voidsetOutputParameters(List<OutputParameter> outputParameters) Sets the list of output parameters.voidsetResultCapabilities(boolean isPackageCapable, boolean isStreamCapable) Sets the result capabilities of the stored process.voidsetServer(LogicalServerInterface logicalServer) Sets the logical server smart object the stored process runs on.voidsetServerContext(ServerContextInterface serverContext) Sets the server context smart object the stored process runs on.voidsetSourceCode(String sourceCode) Sets the source code of the stored process.voidsetSourceCodeLocation(StoredProcessInterface.SourceCodeLocation sourceCodeLocation) Sets the location type of the source code.voidsetSourceCodeRepository(DirectoryInterface sourceCodeRepository) Sets the source code repository associated with the stored process.voidsetSourceFileName(String sourceFileName) Sets the the source code file name of the stored process.voidsetStreams(List<? extends GenericStream> streams) Sets the list of data sources and data targets.voidupdate()Persists the stored process after performing validation by invokingvalidate().voidvalidate()Validates the stored process.Methods inherited from interface com.sas.services.information.metadata.MetadataInterface
add, addAccessControl, addAttribute, addAttributes, addDocument, addExtension, addGroup, addImplementor, addKeyword, addNoteTextStore, addNoteTextStore, addObjectProperty, addObjectProperty, addPermissions, addPrompt, addPropertySet, addRemark, addResponsibleParty, addTransactionListener, addUsedByPrototype, checkin, checkout, commit, copyTo, countAssociatedObjects, delete, deleteAttribute, deleteAttributes, destroy, getAccessControls, getAttribute, getAttributes, getAuthorizationUtil, getCreateDate, getCreatedBy, getDescription, getDocuments, getEntityKey, getEntityURL, getExtensions, getGroups, getGUID, getIdentities, getImplementors, getKeywords, getLockedBy, getModifiedBy, getModifyDate, getNoteTextStore, getNoteTextStores, getNoteTextStoresByRole, getObjectProperties, getParent, getParentPath, getParents, getPath, getPaths, getPermission, getPermissions, getPermissions, getPreviousVersionNames, getPrimaryPropertyGroup, getPrompt, getPrompts, getPropertyBag, getPropertySets, getRemarksList, getReposId, getRepository, getRepositoryEntity, getRepositoryName, getReposKey, getResponsibleParties, getState, getTrackingId, getType, getUsageVersion, getUsedByPrototypes, getUsingPrototype, getVersion, isAuthorized, isCompatible, isDeleted, isDestroyed, isObjectAlive, isReadCompatible, mapNameToFilesystem, mapUrlToFilesystem, moveTo, refresh, removeAccessControl, removeDocument, removeExtension, removeGroup, removeImplementor, removeKeyword, removeNoteTextStore, removeObjectProperty, removePermissions, removePrompt, removePropertySet, removeResponsibleParty, removeResponsiblePartyByIdentity, removeUsedByPrototype, rollback, setAttribute, setAttributes, setDeleted, setDescription, setDocuments, setExtensions, setGroups, setGUID, setKeywords, setName, setNoteTextStores, setObjectProperties, setPermission, setPrimaryPropertyGroup, setPrompt, setPrompts, setRemarksList, setRepository, setUsingPrototype, startTransaction, toByteArray, transactionEvent, uncheckout, updateFromBag, versionMethods inherited from interface com.sas.services.information.publicobject.PublicObjectInterface
addProcessorInterface, getContainer, getIdentifier, getName, getObjectURI, getPathUrl, getProcessorInterface, getTypeDescriptorMethods inherited from interface com.sas.services.util.UpgradeInterface
upgradeFromPreviousVersion
-
Field Details
-
NINETWO_VERSION
static final com.sas.util.UsageVersion NINETWO_VERSIONThe usage version corresponding to version of stored processes that were introduced in 9.2. This version number is 1.0.- Since:
- 9.3
-
NINETHREE_VERSION
static final com.sas.util.UsageVersion NINETHREE_VERSIONThe usage version corresponding to version of stored processes that were introduced in 9.3. This version number is 2.0.- Since:
- 9.3
-
CURRENT_VERSION
static final com.sas.util.UsageVersion CURRENT_VERSIONThe usage version corresponding to version of stored processes that are considered current in this release. Do note that older versions may also be supported in a release.In 9.3 this value is the same as
NINETHREE_VERSION.- Since:
- 9.3
-
-
Method Details
-
newServiceObject
StoredProcessInterface newServiceObject(SessionContextInterface sessionContext) throws ServiceException, RemoteException Deprecated.TheStoredProcessInterfaceservice object returned by this method cannot be used to avail of features introduced in 9.2 or later. SeenewServiceObject().Obtains aStoredProcessInterfaceservice 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 byStoredProcessInterface. Its behavior on a 9.3 format stored process is undefined.- Parameters:
sessionContext-SessionContextInterfaceto be used for the execution of the Stored Process- Returns:
- a
StoredProcessInterfaceservice object - Throws:
RemoteException- if a network anomaly is encounteredServiceException
-
newServiceObject
Obtains a service object used to execute the Stored Process.This method is equivalent to calling
StoredProcessServiceInterface.newStoredProcess(StoredProcessInterface, StoredProcessOptions)with this smart object and the specifiedStoredProcessOptionsparameter and the javadoc for that method provides complete details of the effects of the options parameter.- Parameters:
options- to control the service object- Returns:
- a Stored Process service object.
- Throws:
RemoteException- if a network anomaly is encounteredServiceException- Since:
- 9.2
-
newServiceObject
Obtains a service object used to execute the Stored Process. This method returns an interface corresponding to the current version of the service object. In this release it's aStoredProcess2Interface. 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).- Specified by:
newServiceObjectin interfaceMetadataInterface- Returns:
- the current version of a Stored Process service object
- Throws:
RemoteException- if a network anomaly is encounteredServiceException- if an error occurs
-
setServer
Sets the logical server smart object the stored process runs on.This method is only valid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on other stored processes.
- Parameters:
logicalServer- the server to run the stored process on; if null is specified a NullPointerException is thrown- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered
-
setServerContext
void setServerContext(ServerContextInterface serverContext) throws ServiceException, RemoteException Sets the server context smart object the stored process runs on.This method is invalid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on one.
- Parameters:
logicalServer- the server context to run the stored process on; if null is specified a NullPointerException is thrown- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered- Since:
- 9.3
-
setSourceCode
Sets the source code of the stored process.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.- Parameters:
sourceCode- SAS source code, lines are separated using the '\n' character- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered- Since:
- 9.3
-
getSourceCode
Returns the source code of the stored process.At the current time this method is only supported if the source code location is
StoredProcessInterface.SourceCodeLocation.METADATAand will return UnsupportedOperationException if the source code location isStoredProcessInterface.SourceCodeLocation.FILE_SYSTEM.- Returns:
- SAS source code, lines are separated using the '\n' character
- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered- Since:
- 9.3
-
setLogicalServerType
void setLogicalServerType(StoredProcessInterface.LogicalServerType logicalServerType) throws ServiceException, RemoteException Sets the type of logical server the stored process runs on.This method is invalid for 9.2 stored processes and will throw an UnsupportedOperationException if invoked on one.
- Parameters:
logicalServerType- one of the values fromStoredProcessInterface.LogicalServerType- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered- Since:
- 9.3
-
getLogicalServerType
StoredProcessInterface.LogicalServerType getLogicalServerType() throws ServiceException, RemoteExceptionGets the type of logical server the stored process runs on.For 9.2 stored processes the value returned is either
StoredProcessInterface.LogicalServerType.WORKSPACEorStoredProcessInterface.LogicalServerType.STORED_PROCESS. Will return null if there is no logical server associated with the stored process which should not happen under normal circumstances.- Returns:
- one of the values from
StoredProcessInterface.LogicalServerType - Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered- Since:
- 9.3
-
setOtherServerContextAllowed
void setOtherServerContextAllowed(boolean isOtherServerContextAllowed) throws ServiceException, RemoteException Sets whether the stored process can run on a different server context. The metadata definition of a stored process specifies a default server context for the stored process to run on. If this method is called with a true argument, a different server context may be specified at execution time.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.
- Parameters:
isOtherServerContextAllowed- whether a different server context to run the stored process can be specified at execution time- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered- Since:
- 9.3
-
isOtherServerContextAllowed
Determines whether the stored process can run on a different server context.- Returns:
- whether a different server context to run the stored process can be specified at execution time
- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered- Since:
- 9.3
- See Also:
-
setSourceCodeLocation
void setSourceCodeLocation(StoredProcessInterface.SourceCodeLocation sourceCodeLocation) throws ServiceException, RemoteException Sets the location type of the source code.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 withStoredProcessInterface.SourceCodeLocation.METADATA. If other server contexts are not to be allowed, this method can be called with eitherStoredProcessInterface.SourceCodeLocationvalue. If the method is not called for a new stored process the default setting will beStoredProcessInterface.SourceCodeLocation.FILE_SYSTEM.- Parameters:
sourceCodeLocation- one ofStoredProcessInterface.SourceCodeLocation.METADATAorStoredProcessInterface.SourceCodeLocation.FILE_SYSTEM; if null is specified a NullPointerException is thrown- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered- Since:
- 9.3
-
getSourceCodeLocation
StoredProcessInterface.SourceCodeLocation getSourceCodeLocation() throws ServiceException, RemoteExceptionGets the location type of the source code.See
setSourceCodeLocation(SourceCodeLocation)for more details.This method returns
StoredProcessInterface.SourceCodeLocation.FILE_SYSTEMfor 9.2 stored processes.- Returns:
- one of
StoredProcessInterface.SourceCodeLocation.METADATAorStoredProcessInterface.SourceCodeLocation.FILE_SYSTEM - Throws:
ServiceException- if there's an exception getting the valueRemoteException- if a network anomaly is encountered.- Since:
- 9.3
-
setSourceCodeRepository
void setSourceCodeRepository(DirectoryInterface sourceCodeRepository) throws ServiceException, RemoteException Sets the source code repository associated with the stored process.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.- Parameters:
sourceCodeRepository- the source code repository associated with the stored process; if null is specified a NullPointerException is thrown- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered
-
setSourceFileName
Sets the the source code file name of the stored process.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.- Parameters:
sourceFileName- the source code file name of the stored process; if null is specified a NullPointerException is thrown- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered
-
setResultCapabilities
void setResultCapabilities(boolean isPackageCapable, boolean isStreamCapable) throws ServiceException, RemoteException Sets the result capabilities of the stored process. For a new stored process no capability is set by default. Package capability is supported on both types of servers (Workspace and Stored Process). Stream capability is supported only on Stored Process servers in 9.2 and on both types of servers in 9.3.- Parameters:
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- Throws:
ServiceException- if there's an exception setting the valueRemoteException- if a network anomaly is encountered
-
getServer
Gets the the logical server smart object the stored process is designed to run on. A null is returned if one is not available, which should not happen under normal circumstances.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 isStoredProcessInterface.LogicalServerType.WORKSPACEorStoredProcessInterface.LogicalServerType.STORED_PROCESSit 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 isStoredProcessInterface.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.- Throws:
ServiceException- if there's an exception getting the valueRemoteException- if a network anomaly is encountered.
-
getServerContext
Gets the server context smart object associated with the stored process.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.
- Throws:
ServiceException- if there's an exception getting the valueRemoteException- if a network anomaly is encountered.
-
getSourceCodeRepository
Gets the the source code repository smart object associated with the stored process. A null is returned if one is not available.- Throws:
ServiceException- if there's an exception getting the valueRemoteException- if a network anomaly is encountered.
-
getSourceFileName
Gets the the source code file name of the stored process. A null is returned if one is not available.- Throws:
ServiceException- if there's an exception getting the valueRemoteException- if a network anomaly is encountered.
-
isPackageCapable
Describes whether the stored process has the result capability of package enabled.- Returns:
- true if the stored process is capable of package output; false, if not capable
- Throws:
ServiceException- if there's an exception determining the valueRemoteException- if a network anomaly is encountered.
-
isStreamCapable
Describes whether the stored process has the result capability of stream enabled.- Returns:
- true if the stored process is capable of streaming output; false, if not capable
- Throws:
ServiceException- if there's an exception determining the valueRemoteException- if a network anomaly is encountered.
-
getOutputParameters
Returns the list of output parameters. The list containsOutputParameterobjects. If there are no output parameters an empty list is returned.- Returns:
- as described above
- Throws:
ServiceException- if there's an exception getting the valueRemoteException- if a network anomaly is encountered.
-
setOutputParameters
void setOutputParameters(List<OutputParameter> outputParameters) throws ServiceException, RemoteException Sets the list of output parameters. Specifying a null argument is similar to specifying an empty list. Output parameters should not be set on a 9.2 stored process running on a Workspace server.- Parameters:
outputParameters- list ofOutputParameterobjects.- Throws:
ServiceException- if there are inconsistencies in the list of output parametersRemoteException- if a network anomaly is encountered
-
getStreams
Returns the list of data sources and data targets. The list containsGenericStreamandXMLStreamobjects and theDataSourceOrTarget.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
DataTablesupport was added to the list of data sources and targets. This method only returns theGenericStreamandXMLStreamobjects present and will not return anyDataTableobjects that are present.- Returns:
- as described above
- Throws:
ServiceException- if there's an exception getting the valueRemoteException- if a network anomaly is encountered.- See Also:
-
setStreams
Sets the list of data sources and data targets. The list containsGenericStreamandXMLStreamobjects and theDataSourceOrTarget.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.
- Parameters:
streams- list ofGenericStreamandXMLStreamobjects- Throws:
ServiceException- if there are inconsistencies in the list of streamsRemoteException- if a network anomaly is encountered- See Also:
-
getDataSourcesAndTargets
Returns the list of data sources and data targets. The list may contain a mix ofGenericStream,XMLStreamandDataTableobjects. TheDataSourceOrTarget.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
DataTableobjects this method will not return any DataTable objects for a 9.2 stored process.- Returns:
- as described above
- Throws:
ServiceException- if there's an exception getting the valueRemoteException- if a network anomaly is encountered.- Since:
- 9.3
-
setDataSourcesAndTargets
void setDataSourcesAndTargets(List<? extends DataSourceOrTarget> dataSourcesAndTargets) throws ServiceException, RemoteException Sets the list of data sources and data targets. The list may contain a mix ofGenericStream,XMLStreamandDataTableobjects and theDataSourceOrTarget.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.
- Parameters:
dataSourcesAndTargets- list of data sources and targets objects- Throws:
ServiceException- if there are inconsistencies in the list of streamsRemoteException- if a network anomaly is encountered- Since:
- 9.3
-
validate
Validates the stored process. Minimal validation is done when individual setters are called and the bulk of the validation is done when this method is invoked. There is no requirement for consumer code to call this method. This method is automatically called when theupdate()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
- a source code repository has been set.
- a source file name has been set.
- a server has been set.
- the server context associated with the server is the same as the server context associated with the source code repository.
- if run on a Workspace server
- streaming capability is not set.
- output parameters are not set.
- data streams or data targets are not set.
- that prompt names are unique.
For a 9.3 stored process, this method checks that
- a source code repository has been set if the source code is on the file system.
- a source file name has been set if the source code is on the file system.
- a server context has been set.
- the server context associated is the same as the server context associated with the source code repository if the source code repository is set.
- if other server contexts are allowed the source code is in metadata.
- that prompt names are unique.
- Throws:
ServiceException- if an inconsistent set of values has been setRemoteException- if a network anomaly is encountered
-
update
Persists the stored process after performing validation by invokingvalidate(). 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 viavalidate()) and an inconsistent set of metadata may be persisted.- Specified by:
updatein interfaceMetadataInterface- Throws:
ServiceException- if an exception was thrown while updatingRemoteException- if a network anomaly is encountered
-
convertToVersion
Converts the stored process to the version specified. Throws anVersionIncompatibleExceptionif 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.
- Parameters:
version- the version to convert to; one ofNINETWO_VERSION,NINETHREE_VERSIONorCURRENT_VERSION.- Throws:
ServiceExceptionRemoteException- Since:
- 9.3
-
getPromptValues
Convenience method to obtain a PromptValues object containing stored process prompts.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.
- Returns:
- PromptValuesInterface
- Throws:
ServiceExceptionRemoteException- Since:
- 9.3
-
StoredProcessInterfaceservice object returned by this method cannot be used to avail of features introduced in 9.2 or later.