### *** This interface provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.storedprocess

# Interface StoredProcessBaseInterface

All Superinterfaces:
  `Remote`

All Known Subinterfaces:
  `StoredProcess2Interface`, `StoredProcessInterface`

@SASScope("ALL") @BinaryCompatibilityOnly public interface StoredProcessBaseInterface extends Remote
This interface describes various common aspects of the stored process service object.

Since:
  9.2

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `SERVER_TYPE_STOREDPROCESS`
  Stored Process Server.
  `static final int`
  `SERVER_TYPE_WORKSPACE`
  Workspace Server.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `addInputStream(String streamKey)`
  Adds an input stream definition to the stored process.
  `boolean`
  `addOutputStream(String streamKey, boolean isMultiPass)`
  Adds an output stream definition to the stored process.
  `void`
  `destroy()`
  Free resources allocated by the service.
  `String`
  `getDescription()`
  Get the description of the stored process.
  `String`
  `getDirectory()`
  Get the name of the directory containing the stored process.
  `String`
  `getFileName()`
  Get the name of the stored process file - the name of the instance within the directory.
  `String[]`
  `getInputStreamNames()`
  Return an array of input stream names for this stored process.
  `String`
  `getName()`
  Get the name of the stored process.
  `String[]`
  `getOutputStreamNames()`
  Return an array of output stream names for this stored process.
  `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`
  `hasParameters()`
  Does the stored process have parameters?
  `void`
  `setDescription(String name)`
  Set the description of the stored process.
  `void`
  `setName(String name)`
  Set the name of the stored process.
  `void`
  `setPrivilegedUser(String privilegedUser)`
  Set the name or key of the privileged user.
  `void`
  `setSourceFromFile(String directory, String fileName)`
  Set the name of the directory containing the stored process and the name of the file within the directory.

- ## Field Details

  - ### SERVER_TYPE_STOREDPROCESS

    static final int SERVER_TYPE_STOREDPROCESS
    Stored Process Server. Also see `getServerType()` and the `newStoredProcess(SessionContextInterface, int, int)` method of StoredProcessServiceInterface.
    See Also:
      - Constant Field Values

  - ### SERVER_TYPE_WORKSPACE

    static final int SERVER_TYPE_WORKSPACE
    Workspace Server. Also see `getServerType()` and the `newStoredProcess(SessionContextInterface, int, int)` method of StoredProcessServiceInterface.
    See Also:
      - Constant Field Values

- ## Method Details

  - ### setSourceFromFile

    void setSourceFromFile(String directory, String fileName) throws IllegalStateException, RemoteException
    Set the name of the directory containing the stored process and the name of the file within the directory. The directory should be on a file system which is accessible to the SAS server which executes the stored process.
    Throws:
      `RemoteException` - if a network anomaly is encountered.
      `IllegalStateException` -
      - if called on a stored process created from metadata
      - if destroy() has been called

  - ### getDirectory

    String getDirectory() throws RemoteException
    Get the name of the directory containing the stored process. This is the directory containing the stored process on the file system accessible to the SAS server which executes the stored process.
    Throws:
      `IllegalStateException` - if destroy() has been called.
      `RemoteException` - if a network anomaly is encountered.

  - ### getServerType

    int getServerType() throws RemoteException
    Get the type of server that the stored process runs on.
    Returns:
      `SERVER_TYPE_STOREDPROCESS` or `SERVER_TYPE_WORKSPACE`
    Throws:
      `IllegalStateException` - if destroy() has been called.
      `RemoteException` - if a network anomaly is encountered.

  - ### getServer

    LogicalServerInterface getServer() throws RemoteException
    Get the the logical server the stored process runs on.
    Throws:
      `IllegalStateException` - if destroy() has been called.
      `RemoteException` - if a network anomaly is encountered.

  - ### getFileName

    String getFileName() throws RemoteException
    Get the name of the stored process file - the name of the instance within the directory. Also see `getDirectory()`.
    Throws:
      `IllegalStateException` - if destroy() has been called.
      `RemoteException` - if a network anomaly is encountered.

  - ### setName

    void setName(String name) throws IllegalStateException, RemoteException
    Set the name of the stored process.
    Throws:
      `RemoteException` - if a network anomaly is encountered.
      `IllegalStateException` -
      - if called on a stored process created from metadata
      - if destroy() has been called

  - ### getName

    String getName() throws RemoteException
    Get the name of the stored process.
    Throws:
      `IllegalStateException` - if destroy() has been called.
      `RemoteException` - if a network anomaly is encountered.

  - ### setDescription

    void setDescription(String name) throws IllegalStateException, RemoteException
    Set the description of the stored process.
    Throws:
      `RemoteException` - if a network anomaly is encountered.
      `IllegalStateException` -
      - if called on a stored process created from metadata
      - if destroy() has been called

  - ### getDescription

    String getDescription() throws RemoteException
    Get the description of the stored process.
    Throws:
      `IllegalStateException` - if destroy() has been called.
      `RemoteException` - if a network anomaly is encountered.

  - ### setPrivilegedUser

    void setPrivilegedUser(String privilegedUser) throws RemoteException
    Set the name or key of the privileged user. If set, the privileged user name is passed to the Connection Service to configure a connection factory.
    Throws:
      `IllegalStateException` - if destroy() has been called.
      `RemoteException` - if a network anomaly is encountered.

  - ### hasParameters

    boolean hasParameters() throws RemoteException
    Does the stored process have parameters?
    Returns:
      true if the stored process has parameters; false if it does not
    Throws:
      `IllegalStateException` - if destroy() has been called.
      `RemoteException` - if a network anomaly is encountered.

  - ### addInputStream

    boolean addInputStream(String streamKey) throws RemoteException, IllegalStateException
    Adds an input stream definition to the stored process. The client reads from the input stream which provides a channel for the output of the stored process.

    Input streams and output streams use the same fileref namespace.

    Parameters:
      `streamKey` - see sub-class for detailed information.
    Returns:
      true if the name was not present; false if it was with the same options.
    Throws:
      `RemoteException`
      `IllegalStateException`

  - ### getInputStreamNames

    String[] getInputStreamNames() throws RemoteException, IllegalStateException
    Return an array of input stream names for this stored process.
    Throws:
      `RemoteException` - if a network anomaly is encountered.
      `IllegalStateException` - if the stored process runs on a WorkspaceServer or if destroy() has been called.

  - ### addOutputStream

    boolean addOutputStream(String streamKey, boolean isMultiPass) throws RemoteException, IllegalStateException
    Adds an output stream definition to the stored process. The client writes to the output stream thereby providing input to the stored process.

    Input streams and output streams use the same fileref namespace.

    Parameters:
      `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.
    Returns:
      true if the name was not present; false if it was with the same options.
    Throws:
      `RemoteException` - if a network anomaly is encountered.
      `IllegalStateException` -
      - if the name is not a valid SAS fileref name
      - if the name has been specified before with a different set of options
      - if the name has already been defined as an input stream
      - if the server type is not `SERVER_TYPE_STOREDPROCESS`
      - if destroy() has been called

  - ### getOutputStreamNames

    String[] getOutputStreamNames() throws RemoteException, IllegalStateException
    Return an array of output stream names for this stored process.
    Throws:
      `RemoteException` - if a network anomaly is encountered.
      `IllegalStateException` - if the stored process runs on a WorkspaceServer or if destroy() has been called.

  - ### destroy

    void destroy() throws RemoteException
    Free resources allocated by the service. This method is called after there is no further use for this object and results in resource cleanup. If the execute() method is called on a sub-class of this interface, this method may be called any time after the call to execute returns and there is no need to wait for execution to complete. Once destroy() is called, calling any other methods of this interface will result in an `IllegalStateException`.
    Throws:
      `RemoteException` - if a network anomaly is encountered.
      `IllegalStateException` - if this method is called a second time.