Package com.sas.services.storedprocess.metadata

# Class SourceCodeRepositoryUtil

java.lang.Object
com.sas.services.storedprocess.metadata.SourceCodeRepositoryUtil

public class SourceCodeRepositoryUtil extends Object
A utility class that provides methods to manipulate source code repositories. A source code repository is a location on the application server that contains stored process source code and is represented by `DirectoryInterface`. Source code repositories are linked to a ServerContextInterface. This class is used by constructing a SourceCodeRepositoryUtil with either a `LogicalServerInterface` or a `ServerContextInterface` of interest and then invoking the appropriate method(s). Methods exist to obtain a list of source code repositories, locate an existing source code repository by name and create a new source code repository. An existing source code repository can be deleted by calling delete() on DirectoryInterface.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SourceCodeRepositoryUtil(LogicalServerInterface logicalServer)`
  Constructs a SourceCodeRepositoryUtil by obtaining the ServerContextInterface from the supplied LogicalServerInterface.
  `SourceCodeRepositoryUtil(ServerContextInterface serverContext)`
  Constructs a SourceCodeRepositoryUtil using the supplied ServerContextInterface.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DirectoryInterface`
  `createSourceCodeRepository(String path, String description)`
  Create a new source code repository.
  `List<DirectoryInterface>`
  `getSourceCodeRepositories()`
  Obtain a list of source code repositories.
  `DirectoryInterface`
  `locateSourceCodeRepository(String name)`
  Locate an existing source code repository.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SourceCodeRepositoryUtil

    public SourceCodeRepositoryUtil(ServerContextInterface serverContext) throws RemoteException
    Constructs a SourceCodeRepositoryUtil using the supplied ServerContextInterface.
    Throws:
      `RemoteException`

  - ### SourceCodeRepositoryUtil

    public SourceCodeRepositoryUtil(LogicalServerInterface logicalServer) throws RemoteException, ServiceException
    Constructs a SourceCodeRepositoryUtil by obtaining the ServerContextInterface from the supplied LogicalServerInterface.
    Throws:
      `RemoteException`
      `ServiceException`

- ## Method Details

  - ### createSourceCodeRepository

    public DirectoryInterface createSourceCodeRepository(String path, String description) throws ServiceException, RemoteException
    Create a new source code repository. The new repository is linked to the server context used to create this SourceCodeRepositoryUtil object. Do note the same Joma factory and store associated with the server context is used to create and persist the new source code repository.
    Parameters:
      `path` - of the source code repository to be created
      `description` - an optional description of the source code repository to be created
    Returns:
      the `DirectoryInterface` corresponding to the created source code repository
    Throws:
      `ServiceException` - if a source code repository of the same name exists or if there is a metadata access exception
      `RemoteException`

  - ### locateSourceCodeRepository

    public DirectoryInterface locateSourceCodeRepository(String name) throws ServiceException, RemoteException
    Locate an existing source code repository. The list of source code repositories linked to server context used to create this SourceCodeRepositoryUtil object is searched.
    Parameters:
      `name` - of the source code repository to be located
    Returns:
      the `DirectoryInterface` corresponding to the located source code repository; null, if not found
    Throws:
      `ServiceException` - if there is a metadata access exception
      `RemoteException`

  - ### getSourceCodeRepositories

    public List<DirectoryInterface> getSourceCodeRepositories() throws ServiceException, RemoteException
    Obtain a list of source code repositories. The list of source code repositories linked to server context used to create this SourceCodeRepositoryUtil object is returned. Each element of the list is a `DirectoryInterface`.
    Returns:
      the list of source code repositories
    Throws:
      `ServiceException` - if there is a metadata access exception
      `RemoteException`