Class OMIServerRepository

java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.sas.services.information.OMIServerRepository
All Implemented Interfaces:
com.sas.metadata.remote.MdObjectListener, com.sas.services.information.InformationServiceTimerClient, MetadataChangeListener, OMIRepositoryInterface, RepositoryInterface, Serializable, Remote, EventListener
Direct Known Subclasses:
OMIServerChildRepository

public class OMIServerRepository extends UnicastRemoteObject implements OMIRepositoryInterface, com.sas.metadata.remote.MdObjectListener, MetadataChangeListener, InformationServiceTimerClient
This class interfaces with an OMI repository using the jOMA classes (com.sas.metadata.remote) as the repository-specific layer.
Since:
1.0
See Also:
  • Field Details

    • ROOT_CLASSIDENTIFIER

      public static final String ROOT_CLASSIDENTIFIER
      The ClassIdentifier attribute value for the SoftwareComponent that's the root of the tree structures used by SAS applications.
      See Also:
    • BIP_COMPONENTNAME

      public static final String BIP_COMPONENTNAME
      The name of the SoftwareComponent object that used as the root of the tree structures used by SAS applications.
      See Also:
    • BIP_ROOTNAME

      public static final String BIP_ROOTNAME
      The name of the Tree object that's the default base Tree for BIP applications.
      See Also:
    • _url

      protected String _url
    • _defaultRepository

      protected String _defaultRepository
    • _defaultName

      protected String _defaultName
    • _defaultId

      protected String _defaultId
    • _desc

      protected String _desc
    • _path

      protected String _path
    • _access

      protected String _access
    • _engine

      protected String _engine
    • _options

      protected String _options
    • _effectiveAccess

      protected String _effectiveAccess
    • _format

      protected String _format
    • _state

      protected String _state
    • _metadataCreated

      protected Date _metadataCreated
    • _metadataUpdated

      protected Date _metadataUpdated
    • _isConnected

      protected boolean _isConnected
    • _isDestroyed

      protected boolean _isDestroyed
    • _subNum

      protected String _subNum
    • _myType

      protected String _myType
    • _omiServer

      protected MetadataServerInterface _omiServer
  • Constructor Details

    • OMIServerRepository

      public OMIServerRepository() throws RemoteException
      The default constructor.

      Initialize the instance. Make sure the Factory is configured.

      Throws:
      RemoteException - if unable to export the remote object.
    • OMIServerRepository

      protected OMIServerRepository(Class theClass) throws RemoteException
      Constructs an instance exporting a remote object that employs RMI socket factories appropriate for the specified class.

      Initialize the instance. Make sure the Factory is configured.

      Parameters:
      theClass - Class which will be used to determine the appropriate RMI socket factories.
      Throws:
      RemoteException - if unable to export the remote object.
  • Method Details

    • getInformationService

      public static InformationServiceInterface getInformationService()
      Return a handle to the Information Service. If necessary, use the Discovery Service to get it.

      Returns:
      an instance of the Information Service.
    • clearInformationService

      public static void clearInformationService()
    • setUserContext

      public void setUserContext(UserContextInterface user) throws RemoteException
      Set the UserContext that this repository belongs to. This will be used to retrieve a logging interface as well as a session when necessary.

      Specified by:
      setUserContext in interface RepositoryInterface
      Parameters:
      user - The UserContext this repository was connected for.
      Throws:
      RemoteException - In the event of network failure.
    • getUserContext

      public UserContextInterface getUserContext() throws RemoteException
      Get the UserContext this repository was connected for. This may be null if none was set.

      Specified by:
      getUserContext in interface RepositoryInterface
      Returns:
      The UserContext this repostiory is connected for.
      Throws:
      RemoteException - in the event of network failure.
    • setUser

      public void setUser(PersonInterface person) throws RemoteException
      Set the entity that represents the user that is connected to the repository.

      Specified by:
      setUser in interface RepositoryInterface
      Parameters:
      person - The Person entity that represents the user who is connected. This can only be set once, and if non-null, will throw an IllegalStateException.
      Throws:
      IllegalStateException - if called when the person has already been set.
      RemoteException - in the event of remote access errors.
    • setISName

      public void setISName(String name) throws RemoteException
      Set the name that was used to connect to the repository. This method should be used by the InformationService connect methods. If this is used by client applications, certain functions may not work correctly.
      Specified by:
      setISName in interface RepositoryInterface
      Parameters:
      name - The name that was used to connect to the repository. This name should match the Information Service RepositoryDef name.
      Throws:
      RemoteException
    • getISName

      public String getISName() throws RemoteException
      Get the Information Service configuration name for this repository if it exists. It looks through the ReposDefs for the best match and returns the name.

      Specified by:
      getISName in interface RepositoryInterface
      Returns:
      The ReposDef name for this repository.
      Throws:
      RemoteException - in the event of remote object failure.
    • getUser

      public PersonInterface getUser() throws RemoteException
      Get the person entity that represents the user that is connected to the repository.

      Specified by:
      getUser in interface RepositoryInterface
      Returns:
      The person entity. This may be null if no Person entity for the user exists in the repository, or hasn't been set.
      Throws:
      RemoteException - in the event of remote access errors.
    • getIdentity

      public IdentityInterface getIdentity() throws ServiceException, RemoteException
      Description copied from interface: RepositoryInterface
      Get the authenticated user identity. This will either be a PersonInterface object or an IdentityGroupInterface object.
      Specified by:
      getIdentity in interface RepositoryInterface
      Returns:
      The user identity.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • getIOMI

      public com.sas.meta.SASOMI.IOMI getIOMI() throws IllegalStateException, RemoteException
      Deprecated.
      This method will not work across a remote connection.
      Make the IOMI connection available.

      Specified by:
      getIOMI in interface OMIRepositoryInterface
      Returns:
      The IOMI interface being used by this repository instance.
      Throws:
      IllegalStateException - If this instance isn't currently connected.
      RemoteException - in the event of remote object failure.
    • getISecurity

      public com.sas.meta.SASOMI.ISecurity getISecurity() throws IllegalStateException, RemoteException
      Deprecated.
      This method will not work across a remote connection.
      Make the ISecurity interface available.

      Specified by:
      getISecurity in interface OMIRepositoryInterface
      Returns:
      the ISecurity interface being used by this repository instance.
      Throws:
      IllegalStateException - If this instance isn't currently connected.
      RemoteException - in the event of remote object failure.
    • connect

      public boolean connect(com.sas.meta.SASOMI.IOMI connection, String base) throws ServiceException, RemoteException
      Set up to use an existing IOMI connection.

      Specified by:
      connect in interface OMIRepositoryInterface
      Parameters:
      connection - The IOMI connection to use to communicate with the OMR server.
      base - The default repository name to use.
      Returns:
      True if the connect is successful, false otherwise.
      Throws:
      ServiceException - on repository errors.
      RemoteException - in the event of remote object failure.
    • connectWithProxy

      public boolean connectWithProxy(String host, int port, String id, String password, String base, String proxy, boolean isSecure) throws ServiceException, RemoteException
      Establish a connection to a repository server.

      Specified by:
      connectWithProxy in interface RepositoryInterface
      Parameters:
      host - The host DNS name to connect to.
      port - The port number the server is listening on.
      id - The user id to use to authenticate to the server.
      password - The password to use to authenticate.
      base - The FQID of the default repository to use for operations against the server.
      proxy - A URL for a proxy server to use for the connection.
      isSecure - A flag indicating if this is to be a secure connection.
      Returns:
      true if the connection was successful, false otherwise.
      Throws:
      RemoteException - in the event of network problems.
      ServiceException - if a repository error occurs.
    • connect

      public boolean connect(String user, String password, RepositoryDef config) throws ServiceException, RemoteException
      Description copied from interface: RepositoryInterface
      Connect to a repository using the configuration provided in a RepositoryDef object.
      Specified by:
      connect in interface RepositoryInterface
      Parameters:
      user - The UserId for authentication to the repository server.
      password - The password for authentication to the repository server.
      config - The RepositoryDef object with the configuration information.
      Returns:
      true if the connection was successful, false otherwise.
      Throws:
      ServiceException - If a service level error occurred.
      RemoteException - In the event of remote object failure.
    • connect

      public boolean connect(String host, int port, String id, String password, String base) throws ServiceException, RemoteException
      Establish a connection to a repository server.

      Specified by:
      connect in interface RepositoryInterface
      Parameters:
      host - The host DNS name to connect to.
      port - The port number the server is listening on.
      id - The user id to use to authenticate to the server.
      password - The password to use to authenticate.
      base - The FQID of the default repository to use for operations against the server.
      Returns:
      true if the connection was successful, false otherwise.
      Throws:
      RemoteException - in the event of network problems.
      ServiceException - if a repository error occurs.
    • finalize

      protected void finalize() throws RemoteException
      Before the object is garbage collected, make sure we close the connection.

      Overrides:
      finalize in class Object
      Throws:
      RemoteException - in the event of remote object failure.
    • toString

      public String toString()
      Return a string to represent this instance.

      Overrides:
      toString in class RemoteObject
      Returns:
      the URL string for this instance.
    • close

      public void close() throws RemoteException
      Close the connection to the OMR server and clean up any resources. Repository event listeners will be notified of the closure.

      Specified by:
      close in interface RepositoryInterface
      Throws:
      RemoteException - in the event of remote object failure.
    • newMetadata

      public MetadataInterface newMetadata(String reposId, String name, String type) throws ServiceException, RemoteException
      Create a new metadata entity. It isn't stored in the repository until the addEntity() method is called. This is just a convenient way to get a new metadata object created.

      Specified by:
      newMetadata in interface RepositoryInterface
      Parameters:
      reposId - The ID of the new item in the repository or the repository itself. The meaning of this is repository-specific.
      name - The name of the new metadata entity.
      type - The repository-specific type to create.
      Returns:
      a new MetadataInterface object.
      Throws:
      ServiceException - In the event of a parameter or configuration error.
      RemoteException - in the event of a network error.
    • newMetadata

      public MetadataInterface newMetadata(MetadataInterface model, String name) throws ServiceException, RemoteException
      Deprecated.
      in favor of newMetadataByModel.
      Create a new metadata entity. It isn't stored in the repository until the addEntity() method is called. This is just a convenient way to get a new metadata object created.

      Specified by:
      newMetadata in interface RepositoryInterface
      Parameters:
      model - A Metadata object to use as a "model" for the new item. The new metadata will have the same type, same repository, and may use the repository ID of the model as a basis for its own.
      name - The name of the new repository entity.
      Returns:
      a new MetadataInterface object.
      Throws:
      ServiceException - In the event of a parameter or configuration error.
      RemoteException - in the event of a network error.
    • newMetadataByModel

      public MetadataInterface newMetadataByModel(MetadataInterface model, String name) throws ServiceException, RemoteException
      Create a new metadata entity. It isn't stored in the repository until the addEntity() method is called. This is just a convenient way to get a new metadata object created.

      Specified by:
      newMetadataByModel in interface RepositoryInterface
      Parameters:
      model - A Metadata object to use as a "model" for the new item. The new metadata will have the same type, same repository, and may use the repository ID of the model as a basis for its own.
      name - The name of the new repository entity.
      Returns:
      a new MetadataInterface object.
      Throws:
      ServiceException - In the event of a parameter or configuration error.
      RemoteException - in the event of a network error.
    • fetch

      public MetadataInterface fetch(String repositoryKey) throws ServiceException, RemoteException
      Fetch an object from the repository given the repository key.

      Specified by:
      fetch in interface RepositoryInterface
      Parameters:
      repositoryKey - The identifier for the object from the repository. This should be formatted as the repository ID followed by a slash, then the repository specific type. This string can be obtained using the Metadata.getReposKey method.
      Returns:
      The object matching the repository ID, or null.
      Throws:
      RemoteException - in the event of network errors.
      ServiceException - if a repository error occurs.
    • fetchByUrl

      public MetadataInterface fetchByUrl(String entityURL, boolean bypassCache) throws ServiceException, RemoteException
      Description copied from interface: RepositoryInterface
      Fetch an object from the repository given the URL. If the URL doesn't match this repository instance, a ServiceException is thrown.
      Specified by:
      fetchByUrl in interface RepositoryInterface
      Parameters:
      entityURL - The URL string of the object to fetch.
      bypassCache - If true, the repository cache is bypassed and a trip to the persistent store is forced.
      Returns:
      The fetched object if found, null otherwise.
      Throws:
      ServiceException - If the URL doesn't match the instance.
      RemoteException - In the event of remote object failure.
    • fetch

      public MetadataInterface fetch(String repositoryKey, boolean bypassCache) throws ServiceException, RemoteException
      Fetch an object from the repository given the repository key. If the bypassCache flag is set then the cache will not be checked before retrieving the object from the server. If the flag is not set, then the behaviour is the same as the fetch method.

      Specified by:
      fetch in interface RepositoryInterface
      Parameters:
      repositoryKey - The identifier for the object from the repository. This should be formatted as the repository ID followed by a slash, then the repository specific type. This string can be obtained using the Metadata.getReposKey method.
      bypassCache - Boolean flag determines whether the cache should be checked for the object before forcing a trip to the server or not.
      Returns:
      The object matching the repository ID, or null.
      Throws:
      RemoteException - in the event of network errors.
      ServiceException - if a repository error occurs.
    • search

      public List search(FilterInterface filter) throws ServiceException, RemoteException
      Search the repository using the provided filter.

      Specified by:
      search in interface RepositoryInterface
      Parameters:
      filter - A filter to use to limit the returned data.
      Returns:
      A List of MetadataInterface objects found in the repository that match the filter.
      Throws:
      ServiceException - If repository errors occur.
      RemoteException - in the event of remote object failure.
    • updateEntity

      public void updateEntity(Object reposId, Object input) throws ServiceException, RemoteException
      Update an existing entity in the repository. This method shouldn't be called directly. Instead, call the MetadataInterface.update() method.

      Parameters:
      reposId - The repository identifier for the object to update.
      input - The object to update.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of remote object failure.
    • deleteEntity

      public void deleteEntity(MetadataInterface input) throws ServiceException, RemoteException
      Delete an entity in the repository. This method shouldn't be called directly by clients. Instead, use the MetadataInterface.delete() method which may also clean up dependent objects.

      Specified by:
      deleteEntity in interface RepositoryInterface
      Parameters:
      input - The object to delete.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of remote object failure.
    • deleteEntity

      public void deleteEntity(com.sas.metadata.remote.CMetadata metadata) throws ServiceException, RemoteException
      Allow a CMetadata object to be passed in to be deleted.

      Specified by:
      deleteEntity in interface OMIRepositoryInterface
      Parameters:
      metadata - The CMetadata object to be deleted.
      Throws:
      ServiceException - in the event of back end repository failure.
      RemoteException - in the event of remote object failure.
    • deleteEntities

      public void deleteEntities(List metadataObjects) throws ServiceException, RemoteException
      Delete a collection of CMetadata objects. The entire list is passed to the jOMA classes for processing at one time. This prevents multiple calls to the server when deleting several objects at once.

      Specified by:
      deleteEntities in interface OMIRepositoryInterface
      Parameters:
      metadataObjects - a List of CMetadata objects to be deleted.
      Throws:
      ServiceException - in the event of back end repository failure.
      RemoteException - in the event of remote object failure.
    • addEntity

      public void addEntity(MetadataInterface input) throws ServiceException, RemoteException
      Add an entity to the repository. This method shouldn't be called directly by client code. Instead, use the MetadataInterface.add() method.

      Specified by:
      addEntity in interface RepositoryInterface
      Parameters:
      input - The object to add to the repository.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of remote object failure.
    • getUrl

      public String getUrl() throws RemoteException
      Return the string that represents the specific instance of this repository.

      Specified by:
      getUrl in interface RepositoryInterface
      Returns:
      The URL representing this repository instance. The URL string includes the protocol, host, and port.
      Throws:
      RemoteException - in the event of network errors.
    • getDomain

      public String getDomain() throws RemoteException
      Get the domain for this repository. This is the security domain that this service runs in.

      Specified by:
      getDomain in interface RepositoryInterface
      Returns:
      The security domain this server is authenticated in.
      Throws:
      RemoteException - in the event of remote object failure.
    • setDomain

      public void setDomain(String domain) throws RemoteException
      Set the security domain for this repository.

      Specified by:
      setDomain in interface RepositoryInterface
      Parameters:
      domain - The security domain this server instance uses for authentication.
      Throws:
      RemoteException - if a networking issue is encountered.
    • isEqual

      public boolean isEqual(Object o) throws RemoteException
      Test another object to see if it's equal to this one.

      Specified by:
      isEqual in interface RepositoryInterface
      Parameters:
      o - The object to test against.
      Returns:
      true if the objects are equal, false otherwise
      Throws:
      RemoteException
    • getHost

      public String getHost() throws RemoteException
      Get the name of the host this repository is running on.

      Specified by:
      getHost in interface RepositoryInterface
      Returns:
      The host name.
      Throws:
      RemoteException - in the event of remote object failure.
    • getPort

      public int getPort() throws RemoteException
      Get the port number of the server this repository is using.
      Specified by:
      getPort in interface RepositoryInterface
      Returns:
      The port number.
      Throws:
      RemoteException - in the event of remote object failure.
    • getBase

      public String getBase() throws RemoteException
      Get the search base.
      Specified by:
      getBase in interface RepositoryInterface
      Returns:
      The default search base for this repository instance.
      Throws:
      RemoteException - in the event of a network failure.
    • getPrincipal

      public String getPrincipal() throws RemoteException
      Get the principal name this instance connected with.
      Specified by:
      getPrincipal in interface RepositoryInterface
      Returns:
      The principal string.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositories

      public List getRepositories() throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Get a List of MetadataInterface objects that enumerate the Repositories contained in the OMR server we're currently connected to. The name and ID of the repositories can be obtained using the getName() and getReposId() methods respectively.

      Specified by:
      getRepositories in interface OMIRepositoryInterface
      Returns:
      A List of MetadataInterface objects representing the repositories.
      Throws:
      ServiceException - in the event of repository failure.
      RemoteException - in the event of remote object failure.
    • getTrackedObject

      public MetadataInterface getTrackedObject(int trackingId) throws RemoteException
      Deprecated.
      Get an object from the tracking list. We only keep a weak reference so it could have been garbage collected, but we keep enough information to get it back from the repository if necessary.

      Specified by:
      getTrackedObject in interface RepositoryInterface
      Parameters:
      trackingId - The tracking ID of the object to get.
      Returns:
      The tracked object, or null if it's not in the tracking list.
      Throws:
      RemoteException - in the event of remote object failure.
    • narrow

      public Object narrow(RepositoryData entity) throws ServiceException, RemoteException
      Narrow a set of raw repository data to a specific object based on the type. For OMI, this isn't implemented since the data comes from the jOMA classes already in a specific class.
      Specified by:
      narrow in interface RepositoryInterface
      Throws:
      ServiceException
      RemoteException
    • addRootFolder

      public void addRootFolder(FolderInterface folder) throws ServiceException, RemoteException
      Make a folder a root folder of this repository. This operation will remove any existing parent trees from folder, and associate it with the BIP root SoftwareComponent.
      Specified by:
      addRootFolder in interface RepositoryInterface
      Parameters:
      folder - The folder to make a root folder.
      Throws:
      ServiceException - In the event of a repository error.
      RemoteException - In the event of remote object failure.
    • removeRootFolder

      public FolderInterface removeRootFolder(String folderName) throws ServiceException, RemoteException
      Remove a folder as a root folder for the repository, but don't delete it. If the folder is found and removed, return it;
      Specified by:
      removeRootFolder in interface RepositoryInterface
      Parameters:
      folderName - The name of the folder to remove as a root.
      Returns:
      The folder that was removed, if found. Null otherwise.
      Throws:
      ServiceException - In the event of repository error.
      RemoteException - In the event of remote object failure.
    • makeRootFolder

      public FolderInterface makeRootFolder(String name) throws ServiceException, RemoteException
      Makes a root folder in the repository.

      Root folders are uniquely identified by a string name. makeRootFolder will return the FolderInterface to an existing root folder of the same name, if any.

      Specified by:
      makeRootFolder in interface RepositoryInterface
      Parameters:
      name - Root folder's name.
      Returns:
      Newly created root folder.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of remote object failure.
    • getRootFolder

      public FolderInterface getRootFolder(String name) throws ServiceException, RemoteException
      Get a root folder in the default repository.

      Root folders are uniquely identified by a string name. If the name is null, the default BIP root tree is returned.

      Specified by:
      getRootFolder in interface RepositoryInterface
      Parameters:
      name - The name of the folder to return.
      Returns:
      The requested root folder, or null if it wasn't found.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of remote object failure.
    • getRootFolder

      public FolderInterface getRootFolder(String name, String repository) throws ServiceException, RemoteException
      Get a root folder in a specific repository. If null is passed for the name, the default BIP root folder is returned.

      Parameters:
      name - The name of the root folder to return.
      repository - The repository to get the folder from. This can be a repository ID or name.
      Returns:
      The named root folder, or null if it doesn't exist.
      Throws:
      ServiceException - in the event of service object failure.
      RemoteException - in the event of remote object failure.
    • getRootFolders

      public List getRootFolders() throws ServiceException, RemoteException
      Get all the root folders in the default repository.

      Specified by:
      getRootFolders in interface RepositoryInterface
      Returns:
      a List of FolderInterface objects representing the root folders.
      Throws:
      ServiceException - in the event of repository failures.
      RemoteException - in the event of RMI failures.
    • getRootFolders

      public List getRootFolders(String repository) throws ServiceException, RemoteException
      Gets all the root folders in a specific repository.

      Parameters:
      repository - The repository to get root folders for. This can be a repository ID, or name.
      Returns:
      a List of FolderInterface objects representing the root folders.
      Throws:
      ServiceException - in the event of repository failures.
      RemoteException - in the event of RMI failures.
    • getObjectByPath

      public MetadataInterface getObjectByPath(PathUrl url) throws ServiceException, RemoteException
      Get an object in the BIP tree using a PathUrl to find it.

      Specified by:
      getObjectByPath in interface RepositoryInterface
      Parameters:
      url - The PathUrl that designates the object to retrieve.
      Returns:
      The object matching the path, or null if none was found.
      Throws:
      ServiceException - in the event of service object failure
      RemoteException - in the event of remote object failure.
    • getObjectByPath

      public MetadataInterface getObjectByPath(String rootFolderName, String path, Class type) throws ServiceException, RemoteException
      Deprecated.
      Use getObjectByPath( String, String, String )
      Get an object by path.

      This method will return an arbitrary matching object if multiple objects exist in the repository. The path is a sequence of names separated by forward or back slashes. The method must return the same object if called again with the same parameters and the repository has not been modified.

      Note: Should we allow relative path names? We could implement a getObjectByPath(FolderInterface currentFolder, String path, Class type) version of this method.

      We probably should support "dot" (current folder) and "dot dot" (parent folder) notation in paths, especially if we allow relative paths.

      Specified by:
      getObjectByPath in interface RepositoryInterface
      Parameters:
      rootFolderName - The name of the root folder to start the search in.
      path - The path to the desired object.
      type - The Java class of the desired object.
      Returns:
      the metadata object matching the provided information.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of network errors.
    • getObjectByPath

      public MetadataInterface getObjectByPath(String rootFolderName, String path, String type) throws ServiceException, RemoteException
      Deprecated.
      in favor of getObjectByPathString.
      Get an object from the repository given a root folder, path and type. If multiple matching objects exist, an arbitrary one is returned.

      Specified by:
      getObjectByPath in interface RepositoryInterface
      Parameters:
      rootFolderName - The root folder to start the search for the object.
      path - A slash separated list of folder names ending with the name of the item to return.
      type - The type string of the item to return. This is the output from the MetadataInterface.getType() method.
      Returns:
      The MetadataInterface object that matches the path and type, or null if none could be found.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of remote object failure.
    • getObjectByPathString

      public MetadataInterface getObjectByPathString(String rootFolderName, String path, String type) throws ServiceException, RemoteException
      Get an object from the repository given a root folder, path and type. If multiple matching objects exist, an arbitrary one is returned.

      Specified by:
      getObjectByPathString in interface RepositoryInterface
      Parameters:
      rootFolderName - The root folder to start the search for the object.
      path - A slash separated list of folder names ending with the name of the item to return.
      type - The type string of the item to return. This is the output from the MetadataInterface.getType() method.
      Returns:
      The MetadataInterface object that matches the path and type, or null if none could be found.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of remote object failure.
    • searchTree

      public FilteredFolderInterface searchTree(String rootFolderName, FilterInterface filter) throws ServiceException, RemoteException
      Search the specified folder tree in the repository using the provided filter.

      Specified by:
      searchTree in interface RepositoryInterface
      Parameters:
      rootFolderName - Name of the root folder. If this is null, the default BIP root folder is used.
      filter - A filter to use to limit the returned data.
      Returns:
      A FilteredFolderInterface containing the objects that match the filter criteria.
      Throws:
      RemoteException - in the event of network errors.
      ServiceException - if a repository error occurs.
    • searchTree

      public FilteredFolderInterface searchTree(FolderInterface baseFolder, FilterInterface filter) throws ServiceException, RemoteException
      Deprecated.
      in favor of searchTreeFromBase.
      Search the specified folder tree in the repository using the provided filter.

      Specified by:
      searchTree in interface RepositoryInterface
      Parameters:
      baseFolder - The Folder to start the search in.
      filter - A filter to use to limit the returned data.
      Returns:
      A FilteredFolderInterface containing the objects that match the filter criteria.
      Throws:
      RemoteException - in the event of network errors.
      ServiceException - if a repository error occurs.
    • searchTreeFromBase

      public FilteredFolderInterface searchTreeFromBase(FolderInterface baseFolder, FilterInterface filter) throws ServiceException, RemoteException
      Search the specified folder tree in the repository using the provided filter.

      Specified by:
      searchTreeFromBase in interface RepositoryInterface
      Parameters:
      baseFolder - The Folder to start the search in.
      filter - A filter to use to limit the returned data.
      Returns:
      A FilteredFolderInterface containing the objects that match the filter criteria.
      Throws:
      RemoteException - in the event of network errors.
      ServiceException - if a repository error occurs.
    • searchTreeFromBaseWithScope

      public FilteredFolderInterface searchTreeFromBaseWithScope(FolderInterface baseFolder, FilterInterface filter, int levels) throws ServiceException, RemoteException
      Search the specified folder tree in the repository using the provided filter.

      Specified by:
      searchTreeFromBaseWithScope in interface RepositoryInterface
      Parameters:
      baseFolder - The Folder to start the search in.
      filter - A filter to use to limit the returned data.
      levels - The number of levels to search.
      Returns:
      A FilteredFolderInterface containing the objects that match the filter criteria.
      Throws:
      RemoteException - in the event of network errors.
      ServiceException - if a repository error occurs.
    • addListener

      public void addListener(RepositoryListenerInterface listener) throws ServiceException, RemoteException
      Add a listener to receive event notifications from the repository instance. Events include disconnect, reconnect, and close. Other events may be added.
      Specified by:
      addListener in interface RepositoryInterface
      Parameters:
      listener - The object to add to the repository's list of event listeners.
      Throws:
      RemoteException - in the event of network errors.
      ServiceException - if a repository error occurs.
    • removeListener

      public void removeListener(RepositoryListenerInterface listener) throws ServiceException, RemoteException
      Remove a listener from the list of active event listeners for this repository.
      Specified by:
      removeListener in interface RepositoryInterface
      Parameters:
      listener - The object to remove from the repository's list of event listeners.
      Throws:
      RemoteException - in the event of network errors.
      ServiceException - if a repository error occurs.
    • metadataChange

      public void metadataChange(MetadataChangeEvent event) throws RemoteException
      Process a metadata change event from the Information Service.

      Specified by:
      metadataChange in interface MetadataChangeListener
      Parameters:
      event - The change event.
      Throws:
      RemoteException - in the event of remote object failure.
    • refreshEntity

      public void refreshEntity(MetadataInterface mi) throws ServiceException, RemoteException
      Refresh an entity from the data in the server.
      Specified by:
      refreshEntity in interface RepositoryInterface
      Parameters:
      mi - The metadata object whose data needs refreshing.
      Throws:
      RemoteException - in the event of network errors.
      ServiceException - if a repository error occurs.
    • MdObjectModified

      public void MdObjectModified(com.sas.metadata.remote.MdEvent e) throws RemoteException
      Receive a notification that data has changed that we may have in our cache.
      Specified by:
      MdObjectModified in interface com.sas.metadata.remote.MdObjectListener
      Throws:
      RemoteException
    • trackEntity

      public int trackEntity(MetadataInterface entity) throws RemoteException
      Deprecated.
      Tracking ids are no longer supported.
      Add a new object to the tracking cache. This is called from the Metadata.setRepository() method. Other client code shouldn't need to call this method.
      Specified by:
      trackEntity in interface OMIRepositoryInterface
      Parameters:
      entity - The entity to add to the tracking cache.
      Returns:
      The new tracking ID for the object.
      Throws:
      RemoteException - in the event of remote object failure.
    • getDefaultRepositoryName

      public String getDefaultRepositoryName() throws RemoteException
      Get the name of the default repository.

      Specified by:
      getDefaultRepositoryName in interface OMIRepositoryInterface
      Returns:
      The default repository name, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • getDefaultRepositoryId

      public String getDefaultRepositoryId() throws RemoteException
      Get the FQID of the default repository.

      Specified by:
      getDefaultRepositoryId in interface OMIRepositoryInterface
      Returns:
      The FQID of the default repository, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryDescription

      public String getRepositoryDescription() throws RemoteException
      Get the Description of the default repository.

      Returns:
      The default repository description, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryPath

      public String getRepositoryPath() throws RemoteException
      Get the Path of the default repository.

      Returns:
      The default repository path, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryAccess

      public String getRepositoryAccess() throws RemoteException
      Get the access of the default repository.

      Returns:
      The default repository access, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryEngine

      public String getRepositoryEngine() throws RemoteException
      Get the engine of the default repository.

      Returns:
      The default repository engine, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryOptions

      public String getRepositoryOptions() throws RemoteException
      Get the options of the default repository.

      Returns:
      The default repository options, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryEffectiveAccess

      public String getRepositoryEffectiveAccess() throws RemoteException
      Get the effective access of the default repository.

      Returns:
      The default repository effective access, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryFormat

      public String getRepositoryFormat() throws RemoteException
      Get the format value of the default repository.

      Returns:
      The default repository format value.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryState

      public String getRepositoryState() throws RemoteException
      Get the state of the default repository.

      Returns:
      The default repository state, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryCreatedDate

      public Date getRepositoryCreatedDate() throws RemoteException
      Get the metadata created date of the default repository.

      Returns:
      The default repository created dated, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • getRepositoryUpdatedDate

      public Date getRepositoryUpdatedDate() throws RemoteException
      Get the metadata updated date of the default repository.

      Returns:
      The default repository updated date, or null if it wasn't set.
      Throws:
      RemoteException - in the event of remote object failure.
    • newChild

      public ChildRepositoryInterface newChild() throws ServiceException, RemoteException
      Create a child repository instance with its own cache, which can be used to perform a group of updates transaction-style.
      Specified by:
      newChild in interface RepositoryInterface
      Returns:
      A new object of type ChildRepositoryInterface.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of remote object failure.
    • flush

      protected void flush() throws ServiceException, RemoteException
      Throws:
      ServiceException
      RemoteException
    • getSubNum

      protected String getSubNum() throws RemoteException
      Throws:
      RemoteException
    • getReposKey

      public String getReposKey(com.sas.metadata.remote.Root reposObject) throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Take a jOMA object and return the repository key that can be used to fetch it. This is used for getting an object that's in a main repository into a child repository.
      Specified by:
      getReposKey in interface OMIRepositoryInterface
      Parameters:
      reposObject - A Root object whose repository key is to be returned.
      Returns:
      A repository key that can be used in a fetch call.
      Throws:
      ServiceException - in the event of repository errors.
      RemoteException - in the event of remote object failure.
    • createMetadata

      public com.sas.metadata.remote.Root createMetadata(String name, String type) throws RemoteException, ServiceException
      Create a new metadata object. This is specific to the OMIRepository because it deals with CMetadat objects. I have to surface this method because I don't provide access to the MdFactory, which is used to create new objects.
      Specified by:
      createMetadata in interface OMIRepositoryInterface
      Parameters:
      name - A String for the name of the new object.
      type - The Type for the new object. Should be a field from MetadataObjects.
      Returns:
      A new CMetadata object which can be cast to the correct type.
      Throws:
      RemoteException - in the event of remote object failure.
      ServiceException - If a service level error occurs.
    • browseSearch

      public List browseSearch(FilterInterface filter) throws ServiceException, RemoteException
      Search the repository, the objects that are returned are not cached, and are in a generic container that is not remotable, doesn't go to the server for data that wasn't originally retrieved, and not persistable. This allows applications that are only displaying basic object information to perform much more lightweight and efficient operations, and only get "real" objects that can be manipulated and persisted when needed.

      It's generally a good idea when using this method to use a template. Otherwise, a basic template will be used that will get keywords, and responsible parties but no other associated objects.

      Specified by:
      browseSearch in interface RepositoryInterface
      Parameters:
      filter - A Filter to limit the objects returned to those the client is interested in.
      Returns:
      A List of BrowseMetadataInterface objects.
      Throws:
      ServiceException - In the event of repository errors.
      RemoteException - In the event of remote object failure.
    • browseFetch

      public BrowseMetadataInterface browseFetch(String entityKey, FilterInterface filter) throws ServiceException, RemoteException
      Fetch a single object from the repository using the key. A template can be supplied that will pull in other objects that are interesting when viewing the one requested. If no template is provided, All of the object's simple attributes and immediate associations are retrieved.
      Specified by:
      browseFetch in interface RepositoryInterface
      Parameters:
      entityKey - The Information Services entity key, or the repository key of the object desired.
      filter - A Filter to provide flags, template, or other controls.
      Returns:
      A BrowseMetadataInterface object with the requested information.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • browseFolder

      public List browseFolder(String folderISEntityKey, FilterInterface filter) throws ServiceException, RemoteException
      Get information about a specific folder. If a filter is provided, it's applied to the members of the folder, and the matching members are returned in the result List. If no filter is specified (it's null or no filter information is provided), all of the members and subfolders are retrieved and returned as BrowseMetadataInterface objects in the result List.
      Specified by:
      browseFolder in interface RepositoryInterface
      Parameters:
      folderISEntityKey - The Information Service entity key of the Folder to retrieve information for.
      filter - A Filter used to limit the items returned.
      Returns:
      A List of BrowseMetadataInterface objects. These will be either the matching members, if a filter is provided, or all the members and subfolders if no filter is provided.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - in the event of remote object failure.
    • browseFolderRecursive

      public List browseFolderRecursive(String folderISEntityKey, FilterInterface filter) throws ServiceException, RemoteException
      Search a folder tree recursively using the filter. If the filter is provided, the members of all the trees from the one specified, through all of its subordinates will be searched and the matching objects will be returned in the results List. If no filter is specified, all the members and subfolders of the requested folder will be returned in the result List, with their members and subfolders included in their Maps. This is potentially a very expensive operation, so use it cautiously. Providing a filter with no type set, but including a template can give undesirable results. Be sure that if you do provide a template, you understand that it will be applied against the Tree object specified by folderISEntityKey, and provide the appropriate elements. If you want a subset of the associations of the Tree, consider using the browseFetch method, and provide a template to get what you want from that method.
      Specified by:
      browseFolderRecursive in interface RepositoryInterface
      Parameters:
      folderISEntityKey - The Entity key of the requested folder.
      filter - A Filter to limit the results.
      Returns:
      A List of BrowseMetadataInterface objects.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • browseObjectByPath

      public BrowseMetadataInterface browseObjectByPath(PathUrl pathurl, FilterInterface filter) throws ServiceException, RemoteException
      Retrieve an object based on its PathUrl. This method will require retrieving more information than the user wants in order to get the one he/she does want. The reason is that the PathUrl has the smart object type, but not the repository native type. That means I can't do a direct search for the object we want. So what I do is search for the folder that contains the object, and then look for members in that folder that match the name and type. If the parent folder of the desired object has a lot of members, this could be very inefficient, but there's just no other way to do it. Using the Information Service entity key is a much better course, if it's available. If you do provide a template on the filter, then make sure it's sufficient for the operation. That means if you have a section for Tree, it needs to include the Members association if you're looking for a non-folder object. If you are looking for a folder, and don't want the members then including a Tree template that does not include the members association will make the operation more efficient.
      Specified by:
      browseObjectByPath in interface RepositoryInterface
      Parameters:
      pathurl - A PathUrl object that represents the object to be retrieved.
      filter - Filter used to pass template and flag information to the retrieval code.
      Returns:
      A BrowseMetadataInterface with the requested object, or null if it couldn't be located.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • runInformationServiceTimer

      public void runInformationServiceTimer() throws RemoteException
      Specified by:
      runInformationServiceTimer in interface InformationServiceTimerClient
      Throws:
      RemoteException
    • getCredentials

      public String getCredentials(String subject) throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      See the ISecurity interface documentation for a description of this method.
      Specified by:
      getCredentials in interface OMIRepositoryInterface
      Parameters:
      subject - The subject for which to get a credential handle.
      Returns:
      A credential handle for the requested subject.
      Throws:
      ServiceException - in the event of repository errors.
      RemoteException - in the event of remote object failure.
    • freeCredentials

      public void freeCredentials(String credential) throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Free a credential handle. See the ISecurity interface documentation for a description of this method. This method must be called for any credential retrieved with a getCredentials call.
      Specified by:
      freeCredentials in interface OMIRepositoryInterface
      Parameters:
      credential - The credential to free.
      Throws:
      ServiceException - in the event of repository errors.
      RemoteException - in the event of remote object failure.
    • isAuthorized

      public boolean isAuthorized(String credential, String resource, String permission) throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Check authorization status for a given credential, resource, and permission.
      Specified by:
      isAuthorized in interface OMIRepositoryInterface
      Parameters:
      credential - A credential handle. If this is null, the current authenticated user is checked for permission.
      resource - A resource string of the form OMSOBJ:type/FQID which represents the object whose permissions are being checked.
      permission - A permission or comma-separated list of permissions to check against the user's authorized permissions for the resource.
      Returns:
      true if the user is granted the requested permissions, false otherwise.
      Throws:
      ServiceException - in the event of repository errors.
      RemoteException - in the event of remote object failure.
    • getAuthorizationsOnObj

      public List getAuthorizationsOnObj(String resource, List identities, List permissions, int flags) throws ServiceException, RemoteException
      Get the authorizations on an object for the given identities and permissions.
      Specified by:
      getAuthorizationsOnObj in interface OMIRepositoryInterface
      Parameters:
      resource - The resource string of the object to test. A resource string should be of the form OMSOBJ:obj_type/obj_ID (e.g., OMSOBJ:PhysicalTable/A5DRX6L4.AJ00001Z).
      identities - A List of IdentityInterface objects for the users to test permissions for. If left null, all identities are returned.
      permissions - A List of Permission objects specifying the permissions to check. If null, all permissions for all specified identities on the object are returned.
      flags - Flags which control the return values. Valid flags are: ISecurityAdmin.SECAD_ACT_CONTENTS and ISecurityAdmin.SECAD_DO_NOT_RETURN_PERMCOND. See the documentation for ISecurityAdmin.GetAuthorizationsOnObj for more details.
      Returns:
      A List of Authorization objects with the resulting authorization data.
      Throws:
      ServiceException - if a service level error occurs.
      RemoteException - in the event of remote object failure.
    • setAuthorizationsOnObj

      public void setAuthorizationsOnObj(String resource, List authorizations, int flags) throws ServiceException, RemoteException
      Set authorizations on a metadata object.
      Specified by:
      setAuthorizationsOnObj in interface OMIRepositoryInterface
      Parameters:
      resource - The resource string of the object to modify. A resource string should be of the form OMSOBJ:obj_type/obj_ID (e.g., OMSOBJ:PhysicalTable/A5DRX6L4.AJ00001Z).
      authorizations - A List of Authorization objects defining the authorizations to set on the object.
      flags - Controls the behavior of the method. The only valid flag as of this writing is ISecurityAdmin.SECAD_ACT_CONTENTS. Check the documentation for the ISecurityAdmin interface for details.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • getIdentitiesOnObj

      public List getIdentitiesOnObj(String resource, int flags) throws ServiceException, RemoteException
      Get a List of identities associated with an object through authorizations.
      Specified by:
      getIdentitiesOnObj in interface OMIRepositoryInterface
      Parameters:
      resource - The resource string of the object to test. A resource string should be of the form OMSOBJ:obj_type/obj_ID (e.g., OMSOBJ:PhysicalTable/A5DRX6L4.AJ00001Z).
      flags - Zero or ISecurityAdmin.SECAD_ACT_CONTENTS. See the javadoc for ISecurityAdmin for more information.
      Returns:
      A List of identities as Strings in the form of type/name.

      examples:
      Person/Gary Williams IdentityGroup/PUBLIC

      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • getACTsOnObj

      public List getACTsOnObj(String resource) throws ServiceException, RemoteException
      Get the AccessControlTemplates that are associated to an object.
      Specified by:
      getACTsOnObj in interface OMIRepositoryInterface
      Parameters:
      resource - The resource string of the object to test. A resource string should be of the form OMSOBJ:obj_type/obj_ID (e.g., OMSOBJ:PhysicalTable/A5DRX6L4.AJ00001Z).
      Returns:
      A List of ACTEntry objects describing the ACT's associated to the object.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of a remote object failure.
    • appyACTToObj

      public void appyACTToObj(String resource, String act) throws ServiceException, RemoteException
      Apply an AccessControlTemplate to a metadata object.
      Specified by:
      appyACTToObj in interface OMIRepositoryInterface
      Parameters:
      resource - The resource string of the object to modify. A resource string should be of the form OMSOBJ:obj_type/obj_ID (e.g., OMSOBJ:PhysicalTable/A5DRX6L4.AJ00001Z).
      act - The resource string representing the AccessControlTemplate. It's the same format as the resource parameter.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of a remote object failure.
    • removeACTFromObj

      public void removeACTFromObj(String resource, String act) throws ServiceException, RemoteException
      Remove an AccessControlTemplate from a metadata object.
      Specified by:
      removeACTFromObj in interface OMIRepositoryInterface
      Parameters:
      resource - The resource string of the object to modify. A resource string should be of the form OMSOBJ:obj_type/obj_ID (e.g., OMSOBJ:PhysicalTable/A5DRX6L4.AJ00001Z).
      act - The resource string representing the AccessControlTemplate. It's the same format as the resource parameter.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of a remote object failure.
    • getAccessControlTemplateList

      public List getAccessControlTemplateList(int flags) throws ServiceException, RemoteException
      Get the list of AccessControlTemplates for this repository.
      Specified by:
      getAccessControlTemplateList in interface OMIRepositoryInterface
      Parameters:
      flags - zero or ISecurityAdmin.SECAD_REPOSITORY_DEPENDENCY_USES to get AccessControlTemplates for repositories up the dependency chain from this one.
      Returns:
      A List of ACTEntry objects with the information about the ACTs in this repository.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • createAccessControTemplate

      public void createAccessControTemplate(ACTEntry act) throws ServiceException, RemoteException
      Create a new AccessControlTemplate in this repository.
      Specified by:
      createAccessControTemplate in interface OMIRepositoryInterface
      Parameters:
      act - An ACTEntry describing the new entry. The name must be set. The description may be set, and the use parameter should be left null, or set to "REPOS" if this is to become the new repository default ACT (if you have permission to perform that operation).
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • destroyAccessControlTemplate

      public void destroyAccessControlTemplate(String act) throws ServiceException, RemoteException
      Destroy an AccessControlTemplate in the repository.
      Specified by:
      destroyAccessControlTemplate in interface OMIRepositoryInterface
      Parameters:
      act - The resource ID of the ACT. A resource string should be of the form OMSOBJ:obj_type/obj_ID (e.g., OMSOBJ:AccessControlTemplate/A5DRX6L4.AJ00001Z).
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • setAccessControlTemplateAttribs

      public void setAccessControlTemplateAttribs(ACTEntry act) throws ServiceException, RemoteException
      Set attributes on an AccessControlTemplate. I'm assuming that ACT names and descriptions don't really change that much, so I guess the main use for this method is to make an existing ACT the repository default;
      Specified by:
      setAccessControlTemplateAttribs in interface OMIRepositoryInterface
      Parameters:
      act - An ACTEntry object with the new information about the ACT. Set the use parameter in the ACTEntry to "REPOS" to make it the repository default, and be sure you have the necessary permissions to do it or expect an exception.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • getAccessControlTemplateAttribs

      public ACTEntry getAccessControlTemplateAttribs(String act) throws ServiceException, RemoteException
      Get attributes for an AccessControlTemplate.
      Specified by:
      getAccessControlTemplateAttribs in interface OMIRepositoryInterface
      Parameters:
      act - The resource ID of the ACT. A resource string should be of the form OMSOBJ:obj_type/obj_ID (e.g., OMSOBJ:AccessControlTemplate/A5DRX6L4.AJ00001Z).
      Returns:
      An ACTEntry with the information about the ACT.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • isAuthorizedWithConditions

      public AuthResult isAuthorizedWithConditions(String credential, String resource, String permission) throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Check authorization status for a given credential, resource, and permission. See the ISecurity interface documentation for a more complete description.
      Specified by:
      isAuthorizedWithConditions in interface OMIRepositoryInterface
      Parameters:
      credential - A credential handle. If this is null, the current authenticated user is checked for permission.
      resource - A resource string of the form OMSOBJ:type/FQID which represents the object whose permissions are being checked.
      permission - A permission or comma-separated list of permissions to check against the user's authorized permissions for the resource.
      Returns:
      An AuthResult object with a boolean indicating whether the user has the requested permissions granted, and possibly a condition string.
      Throws:
      ServiceException - in the event of repository errors.
      RemoteException - in the event of remote object failure.
    • getAuthorizations

      public String[][] getAuthorizations(String authType, String credHandle, String resource, String permission) throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Get the authorization information for a metadata resource. See the ISecurity interface documentation for a more complete description.
      Specified by:
      getAuthorizations in interface OMIRepositoryInterface
      Parameters:
      authType - The type of authorization check to perform.
      credHandle - A credential handle. If null, the current user's authorizations for the resource are checked.
      resource - A string of the form OMSOBJ:type/FQID representing the metadata object to be checked.
      permission - A permission string, or a comma-separated list of permissions to check.
      Returns:
      A two-dimensional array of strings. The exact layout and meaning of the of the result array depends on the value of authType.
      Throws:
      ServiceException - in the event of repository errors.
      RemoteException - in the event of remote object failure.
    • getCreateDate

      public Date getCreateDate(MetadataInterface mi) throws ServiceException, RemoteException
      Specified by:
      getCreateDate in interface OMIRepositoryInterface
      Throws:
      ServiceException
      RemoteException
    • getModifiedDate

      public Date getModifiedDate(MetadataInterface mi) throws ServiceException, RemoteException
      Specified by:
      getModifiedDate in interface OMIRepositoryInterface
      Throws:
      ServiceException
      RemoteException
    • getRepositoryType

      public String getRepositoryType() throws RemoteException
      Get the type of this repository. For SAS Metadata servers, this is FOUNDATION, CUSTOM, or PROJECT.
      Specified by:
      getRepositoryType in interface OMIRepositoryInterface
      Returns:
      The type of this repository (FOUNDATION, CUSTOM, or PROJECT). This call is only valid if the default repository has been set. Returns null if there's no default repository.
      Throws:
      RemoteException - in the event of remote object failure.
    • isChild

      public boolean isChild(String repositoryID) throws RemoteException
      Return a flag indicating if the repository specified by repositoryID is a dependent child of the default repository.
      Specified by:
      isChild in interface OMIRepositoryInterface
      Parameters:
      repositoryID - The ID of the repository to check.
      Returns:
      True if the repository is a dependent child, false otherwise.
      Throws:
      RemoteException - In the event of remote object failure.
    • isChild

      public boolean isChild(RepositoryInterface repos) throws RemoteException
      Return a flag indicating if the repository provided is a child of the default repository.
      Specified by:
      isChild in interface OMIRepositoryInterface
      Parameters:
      repos - The repository to check.
      Returns:
      True if the repository is a child of this one, false otherwise.
      Throws:
      RemoteException - In the event of remote object failure.
    • isInChild

      public boolean isInChild(MetadataInterface metadata) throws RemoteException
      Return a flag indicating if the metadata object is in a dependent child repository to the default one.
      Specified by:
      isInChild in interface OMIRepositoryInterface
      Parameters:
      metadata - The metadata object to check.
      Returns:
      True if the object is in a dependent child repository, false otherwise.
      Throws:
      RemoteException - In the event of remote object failure.
    • isParent

      public boolean isParent(String repositoryID) throws RemoteException
      Return a flag indicating if the repository specified by repositoryID is a parent of the default repository.
      Specified by:
      isParent in interface OMIRepositoryInterface
      Parameters:
      repositoryID - The ID of the repository to check.
      Returns:
      True if the repository is a parent, false otherwise.
      Throws:
      RemoteException - In the event of remote object failure.
    • isParent

      public boolean isParent(RepositoryInterface repos) throws RemoteException
      Return a flag indicating if the repository provided is a parent of the default repository.
      Specified by:
      isParent in interface OMIRepositoryInterface
      Parameters:
      repos - The repository to check.
      Returns:
      True if the repository is a parent of this one, false otherwise.
      Throws:
      RemoteException - In the event of remote object failure.
    • isInParent

      public boolean isInParent(MetadataInterface metadata) throws RemoteException
      Return a flag indicating if the metadata object is in a parent repository to the default one.
      Specified by:
      isInParent in interface OMIRepositoryInterface
      Parameters:
      metadata - The metadata object to check.
      Returns:
      True if the object is in a parent repository, false otherwise.
      Throws:
      RemoteException - In the event of remote object failure.
    • isInProject

      public boolean isInProject(MetadataInterface metadata) throws RemoteException
      Description copied from interface: OMIRepositoryInterface
      Returns a flag indicating if the object came from a project repository. This is used when searches are made "down" the dependency chain to prevent returning project data.
      Specified by:
      isInProject in interface OMIRepositoryInterface
      Parameters:
      metadata - The object to check for project membership.
      Returns:
      true if the object is in a project repository, false otherwise.
      Throws:
      RemoteException - In the event of remote object failure.
    • getParents

      public List getParents() throws RemoteException
      Description copied from interface: OMIRepositoryInterface
      Get the list of repository id's that are "up" the dependency chain from the default repository.
      Specified by:
      getParents in interface OMIRepositoryInterface
      Returns:
      a List of repository id's that are parents of the default repository.
      Throws:
      RemoteException - In the event of remote object failure.
    • getChildren

      public List getChildren() throws RemoteException
      Description copied from interface: OMIRepositoryInterface
      Get the list of repository id's that are "down" the dependency chain from the default repository.
      Specified by:
      getChildren in interface OMIRepositoryInterface
      Returns:
      A List of repository id's that are children of the default repository.
      Throws:
      RemoteException - In the event of remote object failure.
    • getUniqueId

      public String getUniqueId() throws RemoteException
      Description copied from interface: RepositoryInterface
      Get a unique identifier for this repository instance.
      Specified by:
      getUniqueId in interface RepositoryInterface
      Returns:
      A unique identifier.
      Throws:
      RemoteException - In the event of remote object failure.
    • setFolderItemRefreshInterval

      public void setFolderItemRefreshInterval(long msecInterval) throws RemoteException
      Description copied from interface: OMIRepositoryInterface
      Set the interval for refreshing the folder's item list for objects retrieved through this repository instance.
      Specified by:
      setFolderItemRefreshInterval in interface OMIRepositoryInterface
      Parameters:
      msecInterval - The interval in milliseconds after which a folder's item information is considered stale.
      Throws:
      RemoteException - In the event of remote object failure.
    • getFolderItemRefreshInterval

      public long getFolderItemRefreshInterval() throws RemoteException
      Description copied from interface: OMIRepositoryInterface
      Get the interval for refreshing the folder's item list for objects retrieved through this repository instance.
      Specified by:
      getFolderItemRefreshInterval in interface OMIRepositoryInterface
      Returns:
      The interval in milliseconds after which a folder's item information is considered stale.
      Throws:
      RemoteException - In the event of remote object failure.
    • setFolderSubfolderRefreshInterval

      public void setFolderSubfolderRefreshInterval(long msecInterval) throws RemoteException
      Description copied from interface: OMIRepositoryInterface
      Set the interval for refreshing a folder's subfolder list for objects retrieved through this repository instance.
      Specified by:
      setFolderSubfolderRefreshInterval in interface OMIRepositoryInterface
      Parameters:
      msecInterval - The interval in milliseconds after which a folder's subfolder information is considered stale.
      Throws:
      RemoteException - In the event of remote object failure.
    • getFolderSubfolderRefreshInterval

      public long getFolderSubfolderRefreshInterval() throws RemoteException
      Description copied from interface: OMIRepositoryInterface
      Get the interval for refreshing a folder's subfolder list for objects retrieved through this repository instance.
      Specified by:
      getFolderSubfolderRefreshInterval in interface OMIRepositoryInterface
      Returns:
      The interval in milliseconds after which a folder's subfolder information is considered stale.
      Throws:
      RemoteException - In the event of remote object failure.
    • setParentRefreshInterval

      public void setParentRefreshInterval(long msecInterval) throws RemoteException
      Description copied from interface: OMIRepositoryInterface
      Set the interval for refreshing an object's parent path information.
      Specified by:
      setParentRefreshInterval in interface OMIRepositoryInterface
      Parameters:
      msecInterval - The interval in milliseconds after which an object's parent information is considered stale.
      Throws:
      RemoteException - In the event of remote object failure.
    • getParentRefreshInterval

      public long getParentRefreshInterval() throws RemoteException
      Description copied from interface: OMIRepositoryInterface
      Get the interval for refreshing an object's parent path information.
      Specified by:
      getParentRefreshInterval in interface OMIRepositoryInterface
      Returns:
      The interval in milliseconds after which an object's parent folder information is considered stale.
      Throws:
      RemoteException - In the event of remote object failure.
    • getCountNoSecurity

      public int getCountNoSecurity(Filter filter, String association) throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Perform a search operation against the metadata repository which will return a count of the matching objects, rather than the objects themselves. The search is done with security off. In this way, an application can determine if objects exist even if they can't read those objects.
      Specified by:
      getCountNoSecurity in interface OMIRepositoryInterface
      Parameters:
      filter - A Filter specifying the selection criteria as well as any template that's desired for the operation.
      association - An optional parameter that requests that a specific association be counted rather than the top level objects. If this is used, only one top level object can be returned by the filter, and a template must be supplied to return the association to count.
      Returns:
      The count of matching objects.
      Throws:
      ServiceException - In the event of a server error.
      RemoteException - In the event of remote object failure.
    • getInheritedPermissions

      public String[][] getInheritedPermissions(IdentityInterface identity, MetadataInterface metadata, List permissions) throws ServiceException, RemoteException
      Specified by:
      getInheritedPermissions in interface OMIRepositoryInterface
      Throws:
      ServiceException
      RemoteException
    • getInheritedIdentities

      public String[][] getInheritedIdentities(MetadataInterface mi) throws ServiceException, RemoteException
      Specified by:
      getInheritedIdentities in interface OMIRepositoryInterface
      Throws:
      ServiceException
      RemoteException
    • isAuthorized

      public boolean isAuthorized(MetadataInterface mi, String permission) throws ServiceException, RemoteException
      Specified by:
      isAuthorized in interface OMIRepositoryInterface
      Throws:
      ServiceException
      RemoteException
    • factoryProcess

      public MetadataInterface factoryProcess(Object o) throws ServiceException, RemoteException
      Description copied from interface: RepositoryInterface
      Process a raw repository object into a smart object. Going through the repository rather than directly against the Factory allows for better cache control.
      Specified by:
      factoryProcess in interface RepositoryInterface
      Parameters:
      o - The repository object that needs to be processed into a smart object.
      Returns:
      The smart object representation of the repository entity.
      Throws:
      ServiceException - If a factory error or repository error occurs.
      RemoteException - In the event of remote object failure.
    • addToCache

      public void addToCache(MetadataInterface newMetadata) throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Add a MetadataInterface object to a repository's cache. This will normally be called only from a smart object's constructor, not by client code.
      Specified by:
      addToCache in interface OMIRepositoryInterface
      Parameters:
      newMetadata - The new metadata object to add to the cache.
      Throws:
      ServiceException - If an error occurs while adding the new object to the cache.
      RemoteException - In the event of remote object failure.
    • pulseCheck

      protected final void pulseCheck() throws ServiceException
      Throws:
      ServiceException
    • MdObjectCreated

      public void MdObjectCreated(com.sas.metadata.remote.MdEvent e, String id) throws RemoteException
      Throws:
      RemoteException
    • MdObjectDeleted

      public void MdObjectDeleted(com.sas.metadata.remote.MdEvent e, String id) throws RemoteException
      Throws:
      RemoteException
    • MdObjectsCreated

      public void MdObjectsCreated(com.sas.metadata.remote.MdEvent e, List ids) throws RemoteException
      Throws:
      RemoteException
    • toByteArray

      public byte[] toByteArray() throws RemoteException, ServiceException
      Description copied from interface: RepositoryInterface
      Write the current state of the repository to a byte array.
      Specified by:
      toByteArray in interface RepositoryInterface
      Returns:
      The byte array containing the current repository state.
      Throws:
      RemoteException - In the event of remote object failure.
      ServiceException - If a factory error or repository error occurs.
    • fromByteArry

      public void fromByteArry(UserContextInterface uci, byte[] data) throws RemoteException, ServiceException
      Description copied from interface: RepositoryInterface
      Initialize an instance of a repository from state saved in a byte array.
      Specified by:
      fromByteArry in interface RepositoryInterface
      Parameters:
      uci - A UserContext to use to get credentials and other information.
      data - The data array with the repository state.
      Throws:
      RemoteException - In the event of remote object failure.
      ServiceException - If a factory error or repository error occurs.
    • isDestroyed

      public boolean isDestroyed() throws RemoteException
      Description copied from interface: RepositoryInterface
      Check if the repostiory instance has been closed.
      Specified by:
      isDestroyed in interface RepositoryInterface
      Returns:
      true if the repository has been closed, false otherwise.
      Throws:
      RemoteException - In the event of remote object failure.
    • getCacheStatistics

      public com.sas.services.cache.CacheStatistics getCacheStatistics() throws ServiceException, RemoteException
      Description copied from interface: RepositoryInterface
      Get the cache statistics for the repository cache.
      Specified by:
      getCacheStatistics in interface RepositoryInterface
      Returns:
      A CacheStatistics object.
      Throws:
      ServiceException - If a factory error or repository error occurs.
      RemoteException - In the event of remote object failure.
    • getFactoryKey

      public String getFactoryKey(Object o) throws ServiceException, RemoteException
      Description copied from interface: RepositoryInterface
      Get the factory key for objects from this repository. This method should only be used internally to the Information Service.
      Specified by:
      getFactoryKey in interface RepositoryInterface
      Parameters:
      o - The object to return the factory key for.
      Returns:
      The factory key string for this object.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • produceDefaultMetadata

      public MetadataInterface produceDefaultMetadata(Object o) throws RemoteException, ServiceException
      Description copied from interface: RepositoryInterface
      Return the default metadata object for this repository. Some repository instances return a Metadata, others a Folder, others subclasses of those. This method should only be used internally by the Information Service.
      Specified by:
      produceDefaultMetadata in interface RepositoryInterface
      Parameters:
      o - The data layer object to return a default smart object for.
      Returns:
      A default smart object for this repository, and the provided data layer object.
      Throws:
      RemoteException - In the event of remote object failure.
      ServiceException - If a repository or service level error occurs.
    • factoryTest

      public boolean factoryTest(Object testObject, String filterString) throws RemoteException, ServiceException
      Description copied from interface: RepositoryInterface
      Test an object against a Factory filter. Return true if the filter string matches, false otherwise.
      Specified by:
      factoryTest in interface RepositoryInterface
      Parameters:
      testObject - The data layer object to test.
      filterString - The Factory filter string.
      Returns:
      true if the test object matches the filter string, false otherwise.
      Throws:
      RemoteException - In the event of remote object failure.
      ServiceException - If a repository or service level error occurs.
    • getEvaluator

      public EvaluatorInterface getEvaluator(Object o)
      Description copied from interface: RepositoryInterface
      This method is used by the Factory to get an evaluator that will evaluate factory rules against an object's data to determine if it matches the rule.
      Specified by:
      getEvaluator in interface RepositoryInterface
      Parameters:
      o - The object to test against the rule.
      Returns:
      A new evaluator for this object.
    • isProfileRepository

      public int isProfileRepository(String url) throws RemoteException
      Description copied from interface: RepositoryInterface
      Returns true if this repository supports profile storage.
      Specified by:
      isProfileRepository in interface RepositoryInterface
      Parameters:
      url - The URL of the configured repository. This may be null.
      Returns:
      One of the defined values PROFILE_NO, PROFILE_POSSIBLE, or PROFILE_BEST.
      Throws:
      RemoteException - In the event of remote object failure.
    • getOMRVersion

      public int getOMRVersion() throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Get the version of the Metadata Server we're taking to. It should be an int of the form: major * 1000 + minor * 100 + patch * 10 + SP So 9.1.3 SP3 is 9133 and 9.2 is 9200.
      Specified by:
      getOMRVersion in interface OMIRepositoryInterface
      Returns:
      An integer representing the metadata server version.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • getPermissions

      public List getPermissions() throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Get a List of Permission objects from the metadata server. This method's only purpose for existing is to support the method that adds permissions on a metadata object. Since the permissions are quite static, if the Repository instance reads them and saves them, it can save a lot of trips to the server.
      Specified by:
      getPermissions in interface OMIRepositoryInterface
      Returns:
      A List of MetadataInterface objects representing the Permissions in the metadata server.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • getPredefinedPropertyTypes

      public List getPredefinedPropertyTypes() throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Get the PropertyType objects from the "Entity Property Types" group. This group has, as its members, a set of commonly used property types for shared use.
      Specified by:
      getPredefinedPropertyTypes in interface OMIRepositoryInterface
      Returns:
      A List of MetadataInterface objects representing the defined property types.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • MdObjectsCreated

      public void MdObjectsCreated(com.sas.metadata.remote.MdFactoryEvent e)
    • MdObjectsDeleted

      public void MdObjectsDeleted(com.sas.metadata.remote.MdFactoryEvent e)
    • MdObjectsModified

      public void MdObjectsModified(com.sas.metadata.remote.MdFactoryEvent e)
    • MdObjectsAdded

      public void MdObjectsAdded(com.sas.metadata.remote.MdEvent e, List items) throws RemoteException
      Throws:
      RemoteException
    • MdObjectsRemoved

      public void MdObjectsRemoved(com.sas.metadata.remote.MdEvent e, List items) throws RemoteException
      Throws:
      RemoteException
    • MdObjectsModified

      public void MdObjectsModified(com.sas.metadata.remote.MdEvent e, List items) throws RemoteException
      Throws:
      RemoteException
    • getServer

      public ServerInterface getServer() throws ServiceException, RemoteException
      Description copied from interface: RepositoryInterface
      Get the ServerInterface that controls this repository. For repositories that do not have servers, this may return null.
      Specified by:
      getServer in interface RepositoryInterface
      Returns:
      The ServerInterface that controls this repository.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • refreshAllData

      public void refreshAllData() throws ServiceException, RemoteException
      Description copied from interface: RepositoryInterface
      Refresh all of the data that's in the cache.
      Specified by:
      refreshAllData in interface RepositoryInterface
      Throws:
      ServiceException - If a repository error occurs during the refresh.
      RemoteException - In the event of remote object failure.
    • isUserAuthorizedInRepository

      public boolean isUserAuthorizedInRepository(String permission) throws ServiceException, RemoteException
      Description copied from interface: OMIRepositoryInterface
      Checks repository permissions for the user. This checks the permission provided for the current user and returns true if they are granted the permission, and false if it's denied. This is most useful for determining if the user has WriteMetadata in the repository, which allows them to create new objects. This cannot make determinations of objects in folders, etc. if the user has permission on the folder to create a new member or subfolder.
      Specified by:
      isUserAuthorizedInRepository in interface OMIRepositoryInterface
      Parameters:
      permission - The permission to check. Usually "WriteMetadata" or PermissionInterface.PERMISSION_WRITEMETADATA.
      Returns:
      true if the permission is granted in the repository, or false otherwise.
      Throws:
      ServiceException - If the permission string is invalid, or a server error occurs.
      RemoteException - In the event of remote object failure.
    • populateAttributes

      public void populateAttributes(String id, String name, String type, String desc, String path, String engine, String options, String access, String effectiveAccess, String format, String state, Date metadataCreated, Date metadataUpdated)
      Description copied from interface: OMIRepositoryInterface
      populate the omi repository attributes
      Specified by:
      populateAttributes in interface OMIRepositoryInterface
      Parameters:
      id -
      name -
      type -
      desc -
      path -
      engine -
      options -
      access -
      effectiveAccess -
      format -
      state -
      metadataCreated -
      metadataUpdated -