Class OMIServer

java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.sas.services.information.OMIServer
All Implemented Interfaces:
com.sas.metadata.remote.MdConnectionListener, com.sas.metadata.remote.MdFactoryListener, com.sas.metadata.remote.MdObjectListener, com.sas.metadata.remote.MdStoreIDChangeListener, com.sas.metadata.remote.MdStoreListener, MetadataServerInterface, ServerInterface, Serializable, Remote, EventListener
Direct Known Subclasses:
OMIChildServer

public class OMIServer extends UnicastRemoteObject implements MetadataServerInterface, com.sas.metadata.remote.MdStoreIDChangeListener, com.sas.metadata.remote.MdFactoryListener, com.sas.metadata.remote.MdObjectListener, com.sas.metadata.remote.MdConnectionListener
This class is the OMI implementation of the ServerInterface. In order to be useful, the Information Service should be configured with a ServerDefinition that provides a name for a given host/port/domain, which can then be referenced by applications. Generally, this class will be created by the Information Service when a user authenticates.
Since:
9.2
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:
    • _typeMap

      protected Map _typeMap
    • _explicitIdGrpsMap

      protected Map _explicitIdGrpsMap
    • _isDestroyed

      protected boolean _isDestroyed
    • _repositories

      protected Map _repositories
    • _id2NameMap

      protected Map _id2NameMap
    • _logger

      protected org.apache.logging.log4j.Logger _logger
    • _mdfactory

      protected com.sas.metadata.remote.MdFactory _mdfactory
    • _mdstore

      protected com.sas.metadata.remote.MdObjectStore _mdstore
    • _cache

      protected RepositoryCache _cache
    • _url

      protected String _url
    • _name

      protected String _name
    • _person

      protected IdentityInterface _person
    • _cnxnHandle

      protected ConnectionInterface _cnxnHandle
    • _cnxnAdmin

      protected ConnectionFactoryAdminInterface _cnxnAdmin
    • _cnxnSync

      protected Object _cnxnSync
    • _foundationReposName

      protected String _foundationReposName
    • _subNum

      protected String _subNum
  • Constructor Details

    • OMIServer

      public OMIServer() throws RemoteException
      Throws:
      RemoteException
    • OMIServer

      protected OMIServer(Class theClass) throws RemoteException
      Throws:
      RemoteException
  • Method Details

    • connect

      public void connect(com.sas.meta.SASOMI.IOMI cnxn, ServerDef def, UserContextInterface user, Cluster cluster) throws ServiceException, RemoteException
      Construct an OMIServer with the connection already established.
      Specified by:
      connect in interface ServerInterface
      Parameters:
      cnxn - The IOMI connection to the server.
      def - The server definition. This is still needed for the name, and the host and port are useful in the event of a reconnect try.
      user - The user this instance belongs to.
      cluster - the cluster definition to use for the connection
      host - metadata server host name. Use currently connected host for a cluster.
      port - metadata server port. Use currently connected port for a cluster.
      factoryConfig - The connection factory configuration used to create the connection. This configuration will be used if a reconnect is necessary.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • connect

      public void connect(com.sas.meta.SASOMI.IOMI cnxn, ServerDef def, UserContextInterface user) throws ServiceException, RemoteException
      Construct an OMIServer with the connection already established.
      Specified by:
      connect in interface ServerInterface
      Parameters:
      cnxn - The IOMI connection to the server.
      def - The server definition. Seem stupid to have both? I still need the name, and the host and port are useful in the event of a reconnect try.
      user - The user this instance belongs to.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • connect

      public void connect(ServerDef def, UserContextInterface user) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Connect a user to an InformationService server.
      Specified by:
      connect in interface ServerInterface
      Parameters:
      def - The repository definition with the connection parameters.
      user - The user for whom the connection is being established.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • connect

      public void connect(ServerDef def, UserContextInterface user, Cluster cluster) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Connect a user to an InformationService server.
      Specified by:
      connect in interface ServerInterface
      Parameters:
      def - The repository definition with the connection parameters.
      user - The user for whom the connection is being established.
      cluster - the cluster definition to use for the connection
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • flushAllCachedObjects

      public void flushAllCachedObjects() throws RemoteException, ServiceException
      Throws:
      RemoteException
      ServiceException
    • loadRepositoryData

      public void loadRepositoryData()
    • reloadRepositoryData

      public void reloadRepositoryData()
    • destroy

      public void destroy() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Close the connections and release all resources in use by this server instance.
      Specified by:
      destroy in interface ServerInterface
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • isConnected

      public boolean isConnected() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Returns whether or not the server instance has a valid connection already established.
      Specified by:
      isConnected in interface ServerInterface
      Returns:
      true if connected, false otherwise
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • getSubNum

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

      public com.sas.metadata.remote.MdFactory getMdFactory()
    • getObjectStore

      public com.sas.metadata.remote.MdObjectStore getObjectStore()
    • getName

      public String getName() throws RemoteException
      Description copied from interface: ServerInterface
      Get the server's configured definition name.
      Specified by:
      getName in interface ServerInterface
      Returns:
      The server's configured definition name.
      Throws:
      RemoteException - In the event of remote object failure.
    • getPerson

      public PersonInterface getPerson() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get the PersonInterface representing the connected user.
      Specified by:
      getPerson in interface ServerInterface
      Returns:
      A PersonInterface that represents the connected user in the metadata server. Null if the user has no metadata presence (a "public" user). Also null if a group login was used.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • getIdentity

      public IdentityInterface getIdentity() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get the IdentityInterface representing the connected user.
      Specified by:
      getIdentity in interface ServerInterface
      Returns:
      A IdentityInterface that represents the connected user in the metadata server. Null if the user has no metadata presence (a "public" user).
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • getRepositoryNames

      public List getRepositoryNames() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get a list of the repository names managed by this server.
      Specified by:
      getRepositoryNames in interface ServerInterface
      Returns:
      A List of Strings with the names of the repositories that are managed by this server.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • getRepositoryId

      public String getRepositoryId(String name) throws RemoteException
      Throws:
      RemoteException
    • getRepositoryName

      public String getRepositoryName(String fqid) throws RemoteException
      Description copied from interface: ServerInterface
      Get a repository name given the FQID of the repository. It needs to be the "A0000001.xxxxxxxx" id.
      Specified by:
      getRepositoryName in interface ServerInterface
      Parameters:
      fqid - The fully qualified Id of the desired repository.
      Returns:
      The name of the repository matching the id, or null if none was found.
      Throws:
      RemoteException - In the event of remote object failure.
    • getUrl

      public String getUrl() throws ServiceException, RemoteException
      Throws:
      ServiceException
      RemoteException
    • getUserContext

      public UserContextInterface getUserContext() throws RemoteException
      Description copied from interface: ServerInterface
      Get the UserContext that this server was created on behalf of.
      Specified by:
      getUserContext in interface ServerInterface
      Returns:
      The UserContext that was used to create this server instance.
      Throws:
      RemoteException - In the event of remote object failure.
    • getRepositoryInfo

      public List getRepositoryInfo() throws RemoteException
      Description copied from interface: ServerInterface
      Get information about the repositories that are maintained by this server instance.
      Specified by:
      getRepositoryInfo in interface ServerInterface
      Returns:
      A List of RepositoryInfo objects with information about the repositories.
      Throws:
      RemoteException - In the event of remote object failure.
    • getRepositoryInfoById

      public RepositoryInfo getRepositoryInfoById(String fqid) throws RemoteException
      Throws:
      RemoteException
    • getRepository

      public RepositoryInterface getRepository(String name) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get a named repository managed by this server.
      Specified by:
      getRepository in interface ServerInterface
      Parameters:
      name - The name of the repository to return.
      Returns:
      A RepositoryInterface for the named repository, or null if a repository with that name wasn't found.
      Throws:
      ServiceException - If a server error occured.
      RemoteException - In the event of remote object failure.
    • getRepositories

      public List getRepositories(List repositoryNames) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get a List of named repositories. The repositoryNames parameter is a List of Strings with repository names to return.
      Specified by:
      getRepositories in interface ServerInterface
      Parameters:
      repositoryNames - A List of repository names to return.
      Returns:
      A List of RepositoryInterface objects for the named repositories.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • getRepositories

      public List getRepositories(boolean getAll) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get a List of the requested repositories from this Server. This method returns a List of RepositoryInterface instances that have been explicitly requested via the ServerInterface.getRepository(String) method, unless the getAll parameter is true; then all of the repositories managed by the server are returned.
      Specified by:
      getRepositories in interface ServerInterface
      Parameters:
      getAll - If true, all of the repositories managed by the server are returned. Otherwise, only the explicitly requested repositories are returned.
      Returns:
      A List of RepositoryInterface objects.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • RepositoryDeleted

      public void RepositoryDeleted(String name) throws ServiceException, RemoteException
      Client code notifying the Server that a repository was deleted. This will typically only be used by SASMC.
      Parameters:
      name - The name of the repository that was deleted.
      Throws:
      ServiceException
      RemoteException
    • getHomeFolder

      public FolderInterface getHomeFolder(String userName, UserFolderType type, Filter filter) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get a user's home folder. If the userName is null, the currently connected user's home folder is returned. If not, the home folder of the specified user is returned. This method will always return the requested folder if possible. If it exists, it's returned. If not, it's created and returned.
      Specified by:
      getHomeFolder in interface ServerInterface
      Parameters:
      userName - If null, the home folder of the connected user is returned. Otherwise, it will attempt to return the home folder of the user whose user name is provided.
      type - Which folder to return. If null, the user's "My Folder" is returned. Valid options are UserFolderType.MYFOLDER, or UserFolderType.APPFOLDER for the user's private, or application data folders respectively.
      filter - An optional filter that can be used to provide a template and/or flags for the retrieval of folder data. Other than the template and flags, the filter is not used.
      Returns:
      The "home" folder of the user that's connected to the repository. This may be a server function, or an operation that requires Service level configuration. If no home folder can be determined, null is returned.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • getHomeFolder

      public FolderInterface getHomeFolder(String userName, UserFolderType type, Filter filter, boolean createIfNecessary) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get a user's home folder. If the userName is null, the currently connected user's home folder is returned. If not, the home folder of the specified user is returned. Depending on the setting of the createIfNecessary flag, this method may return a null if the requested folder does not exist already.
      Specified by:
      getHomeFolder in interface ServerInterface
      Parameters:
      userName - If null, the home folder of the connected user is returned. Otherwise, it will attempt to return the home folder of the user whose user name is provided.
      type - Which folder to return. If null, the user's "My Folder" is returned. Valid options are UserFolderType.MYFOLDER, or UserFolderType.APPFOLDER for the user's private, or application data folders respectively.
      filter - An optional filter that can be used to provide a template and/or flags for the retrieval of folder data. Other than the template and flags, the filter is not used.
      createIfNecessary - If true, the requested folder will created if necessary and returned. If false, the folder will only be returned if it already exists.
      Returns:
      The "home" folder of the user that's connected to the repository. This may be a server function, or an operation that requires Service level configuration. If no home folder can be determined, null is returned.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • getProtocol

      public String getProtocol() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get the protocol string for this server.
      Specified by:
      getProtocol in interface ServerInterface
      Returns:
      The string representing the protocol this server understands.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote Object failure.
    • getHost

      public String getHost() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get the host name of the server.
      Specified by:
      getHost in interface ServerInterface
      Returns:
      The server's DNS host name.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • getPort

      public int getPort() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get the server's TCP port number.
      Specified by:
      getPort in interface ServerInterface
      Returns:
      The TCP port number the server is listening on.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • getDomain

      public String getDomain() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get the authentication domain used to connect to the server.
      Specified by:
      getDomain in interface ServerInterface
      Returns:
      The authentication domain that was used when establishing a connection to the server.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • pulseCheck

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

      public void reconnect() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Reconnect to the server if the connection was broken for any reason. This method will typically be used internally to the Information Service classes, but may be used by clients to control reconnect attempts outside of server operations.
      Specified by:
      reconnect in interface ServerInterface
      Throws:
      ServiceException - If the connection attempt fails for any reason.
      RemoteException - In the event of remote object failure.
    • attemptConnection

      protected boolean attemptConnection() throws ServiceException
      Throws:
      ServiceException
    • cachePath

      protected String cachePath() throws RemoteException
      Throws:
      RemoteException
    • makeChainedMessage

      protected String makeChainedMessage(Throwable t)
    • getLoginsForAuthDomain

      public List getLoginsForAuthDomain(String domain) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Get the logins for the connected user for a given authentication domain. This calls through to the ISecurity_1_1 interface to get the logins in a specific order determined by the server. This method is used by the UserContext to populate the identities list, and should not be called by other clients.
      Specified by:
      getLoginsForAuthDomain in interface MetadataServerInterface
      Parameters:
      domain - The authentication domain to return the logins for.
      Returns:
      A List of UserIdentityInterface objects accessible by the connected user in the requested domain.
      Throws:
      ServiceException - If a service-level error occurs.
      RemoteException - In teh event of remote object failure.
    • getFoundationRepository

      public RepositoryInterface getFoundationRepository() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get a handle to the foundation repository for this server.
      Specified by:
      getFoundationRepository in interface ServerInterface
      Returns:
      The RepositoryInterface representing the foundation repository for this server.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • generatePassword

      public UserIdentityInterface generatePassword(String user) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Generate a one-time use password against the metadata server connection for the specified user. Passing in a null or empty string for the user will generate a password for the currently authenticated user. Passing in a user id will only work if the current user is the trusted user.
      Specified by:
      generatePassword in interface ServerInterface
      Parameters:
      user - The userid to generate a password for. This should be null or empty to generate a password for the current user.
      Returns:
      A UserIdentityInterface object with the generated userid and password. The domain is hard-coded to "TRUST".
      Throws:
      ServiceException - If an error occurs during the password generation.
      RemoteException - In the event of remote object failure.
    • getRootFolder

      public RootFolderInterface getRootFolder() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get the server's root folder.
      Specified by:
      getRootFolder in interface ServerInterface
      Returns:
      The FolderInterface representing the root of the server's Folder hierarchy.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • loadTypes

      public void loadTypes() throws ServiceException, RemoteException
      Specified by:
      loadTypes in interface ServerInterface
      Throws:
      ServiceException
      RemoteException
    • loadTypes

      public void loadTypes(boolean force) throws ServiceException, RemoteException
      Specified by:
      loadTypes in interface ServerInterface
      Throws:
      ServiceException
      RemoteException
    • loadExplicitIdentityGroups

      public void loadExplicitIdentityGroups() throws ServiceException, RemoteException
      Throws:
      ServiceException
      RemoteException
    • executeRequest

      public String executeRequest(String request) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Execute a client request and return the result. This method is not intended for use by application clients.
      Specified by:
      executeRequest in interface ServerInterface
      Parameters:
      request - A correctly formatted server request to send as-is to the server.
      Returns:
      The response from the server. This response is not processed in any way, and is just returned to the caller, who is reponsible for parsing for errors.
      Throws:
      ServiceException - If a communications error occurs.
      RemoteException - In the event of remote object failure.
    • getApplicationActionsAuthorizations

      public List<ApplicationAuthorization> getApplicationActionsAuthorizations(SoftwareComponentInterface app, RoleInterface role, boolean explicitRoleActions) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Get the authorizations on an application's actions. The SoftwareComponent is the metadata object that represents the application. The actions defined for the application and their required roles, combined with the roles that the current user has will determine what actions are allowed. Note: Other methods are preferred over this method for most use cases. Use ApplicationInterface.getActions() when a list of all application actions is required. Use UserContextInterface.getGrantedApplicationActions(String...) when a list of granted actions is required. Use this method if role or explicitRoleActions parameters are required.
      Specified by:
      getApplicationActionsAuthorizations in interface MetadataServerInterface
      Parameters:
      app - The SoftwareComponent that represents the application to check.
      role - The Role for which ApplicationActions Authorizations will be returned
      explicitRoleActions - Limit the returned ApplicationsActions to the indicated Role only. ApplicationsActions from contributed Roles will not be returned.
      Returns:
      A List of ApplicationAuthorization objects which indicate the list of actions available for the application and for each, whether the current user is allowed access to that action.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • getApplicationActionsAuthorizations

      public List getApplicationActionsAuthorizations(SoftwareComponentInterface app) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Get the authorizations on an application's actions. The SoftwareComponent is the metadata object that represents the application. The actions defined for the application and their required roles, combined with the roles that the current user has will determine what actions are allowed.

      Note: ApplicationInterface.getActions() is preferred over this method.

      Specified by:
      getApplicationActionsAuthorizations in interface MetadataServerInterface
      Parameters:
      app - The SoftwareComponent that represents the application to check.
      Returns:
      A List of ApplicationAuthorization objects which indicate the list of actions available for the application and for each, whether the current user is allowed access to that action.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • getServerVersion

      public int getServerVersion() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get the version number of the server. If this method is not supported for a server implementation, it will return -1.

      For an OMR server, valid return values include:

      Specified by:
      getServerVersion in interface ServerInterface
      Returns:
      The server's version number, represented as an integer. A -1 indicates the method is not supported by a given implementation.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • factoryProcess

      public MetadataInterface factoryProcess(Object o) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Process a raw repository object into a smart object. Going through the repository rather than directly against the Factory allows for better cache control. This will primarily be called by Smart objects, RepositoryInterface implementations, and other Information Service classes.
      Specified by:
      factoryProcess in interface ServerInterface
      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.
    • getTypeDescriptor

      public TypeDescriptorInterface getTypeDescriptor(String typeName) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get the type descriptor for a known type name.
      Specified by:
      getTypeDescriptor in interface ServerInterface
      Parameters:
      typeName - The non-localized type name for the type.
      Returns:
      The TypeDescriptorInterface for the type or null if none was found.
      Throws:
      ServiceException - If a factory error or repository error occurs.
      RemoteException - In the event of remote object failure.
    • getTypeDescriptors

      public Collection<TypeDescriptorInterface> getTypeDescriptors() throws RemoteException
      Description copied from interface: ServerInterface
      Returns an unmodifiable collection of all known type descriptors.
      Specified by:
      getTypeDescriptors in interface ServerInterface
      Returns:
      an unmodifiable collection of all known type descriptors
      Throws:
      RemoteException - In the event of remote object failure.
    • getExplicitIdentityGroup

      public IdentityGroupInterface getExplicitIdentityGroup(String idGrpName) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get the IdentityGroupInterface for an explicit IdentityGroup
      Specified by:
      getExplicitIdentityGroup in interface ServerInterface
      Parameters:
      idGrpName - The non-localized name for the IdentityGroup.
      Returns:
      The IdentityGroupInterface for the type or null if none was found.
      Throws:
      ServiceException - If a factory error or repository error occurs.
      RemoteException - In the event of remote object failure.
    • getInternalDomain

      public String getInternalDomain() throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Return the string that represents the internal authentication domain. This is normall "saspw".
      Specified by:
      getInternalDomain in interface MetadataServerInterface
      Returns:
      The internal authentication domain string.
      Throws:
      ServiceException - In the event of a service error.
      RemoteException - In the event of remote object failure.
    • getIdentityInfo

      public IdentityInfo getIdentityInfo() throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Return an IdentityInfo object containing information about the currently connected user. This calls through to the ISecurity method GetInfo.
      Specified by:
      getIdentityInfo in interface MetadataServerInterface
      Returns:
      An IdentityInfo object with the current user's information.
      Throws:
      ServiceException - If a metadata server error occurs.
      RemoteException - In the event of remote object failure.
    • getEnterprisePolicies

      public Map getEnterprisePolicies() throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Get a Map with the server-managed enterprise policies.
      Specified by:
      getEnterprisePolicies in interface MetadataServerInterface
      Returns:
      A Map of the enterprise policies. Keys and values should be Strings.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • getCredentials

      public String getCredentials(String subject) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      See the ISecurity interface documentation for a description of this method.
      Specified by:
      getCredentials in interface MetadataServerInterface
      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: MetadataServerInterface
      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 MetadataServerInterface
      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: ServerInterface
      Check authorization status for a given credential, resource, and permission.
      Specified by:
      isAuthorized in interface ServerInterface
      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.
    • isUserAuthorized

      public boolean isUserAuthorized(String repositoryId, String permission) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Check if the user has the specified permission in the repository. This only checks if the connected user has the specified permission to the repository given. It can't make decisions based on hierarchy, etc. This is most useful to determine if the user has WriteMetadata in the repository, which will determine if they can create new objects.
      Specified by:
      isUserAuthorized in interface ServerInterface
      Parameters:
      repositoryId - The repository id. This can be the 8.8 FQID, the name, or the 8 character unique portion of the FQID (all repository id's start with A0000001 anyway).
      permission - The permission string. This will most usefully be "WriteMetadata" or PermissionInterface.PERMISSION_WRITEMETADATA.
      Returns:
      True if the user has the specified permission in the repository, false otherwise.
      Throws:
      ServiceException - If the permission is invalid, the repository specification is invalid, or there is some other repository error.
      RemoteException - In the event of remote object failure.
    • getAuthorizationsForObjects

      public List<AuthorizationObjectsResult> getAuthorizationsForObjects(List<MetadataInterface> resources, List<String> permissions) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Get authorization information for a list of metadata objects. Accepts a List of MetadataInterface objects and a List of permission strings. Returns a List of AuthorizationObjectsResult objects that include the MetadataInterface as the resource, and a List of permission strings which are the granted permissions from the list that was passed in.
      Specified by:
      getAuthorizationsForObjects in interface MetadataServerInterface
      Parameters:
      resources - A List of MetadataInterface objects to check authorizations for.
      permissions - A List of permission strings to check the metadata objects for.
      Returns:
      A List of AuthorizationObjectsResult objects that give the MetadataInterface object and a list of granted permissions from the input list.
      Throws:
      ServiceException - If a service level error occurs.
      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 MetadataServerInterface
      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 MetadataServerInterface
      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 MetadataServerInterface
      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 MetadataServerInterface
      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.
    • applyACTToObj

      public void applyACTToObj(String resource, String act) throws ServiceException, RemoteException
      Apply an AccessControlTemplate to a metadata object.
      Specified by:
      applyACTToObj in interface MetadataServerInterface
      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 MetadataServerInterface
      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(RepositoryInterface repository, int flags) throws ServiceException, RemoteException
      Get the list of AccessControlTemplates for this repository.
      Specified by:
      getAccessControlTemplateList in interface MetadataServerInterface
      Parameters:
      repository - The repository to retrieve the ACT's for.
      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(RepositoryInterface repository, ACTEntry act) throws ServiceException, RemoteException
      Create a new AccessControlTemplate in this repository.
      Specified by:
      createAccessControTemplate in interface MetadataServerInterface
      Parameters:
      repository - The repository which will contain the new ACTEntry.
      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 MetadataServerInterface
      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(RepositoryInterface repository, 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 MetadataServerInterface
      Parameters:
      repository - The repository that contains the ACTEntry to update.
      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 MetadataServerInterface
      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: MetadataServerInterface
      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 MetadataServerInterface
      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: MetadataServerInterface
      Get the authorization information for a metadata resource. See the ISecurity interface documentation for a more complete description.
      Specified by:
      getAuthorizations in interface MetadataServerInterface
      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.
    • getCountNoSecurity

      public int getCountNoSecurity(Filter filter, String association) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      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 MetadataServerInterface
      Parameters:
      filter - A Filter specifying the selection criteria as well as any template that's desired for the operation. If the search should be constrained to a single repository, the repository should be set on the filter using the setOMRRepository method. If no repository is set on the Filter, all repositories in the server will be searched.
      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.
    • setInternalPassword

      public void setInternalPassword(String username, String password) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Set a user's internal password. This is only usable by an administrative user.
      Specified by:
      setInternalPassword in interface MetadataServerInterface
      Parameters:
      username - The name of the user to set an internal password for. This is the Name attribute on a Person object.
      password - The password to set for internal authentication.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • setSelfInternalPassword

      public void setSelfInternalPassword(String username, String oldPassword, String newPassword) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Used to set a user's internal password by the user himself. This is only usable by a User whose own internal password is being changed.
      Specified by:
      setSelfInternalPassword in interface MetadataServerInterface
      Parameters:
      username - The name of the user to set an internal password for. This is the Name attribute on a Person object.
      oldPassword - The current password for internal authentication.
      newPassword - The new password to set for internal authentication.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • encodePassword

      public static String encodePassword(String password)
    • deleteInternalPassword

      public void deleteInternalPassword(String username) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Delete a user's internal password. This is only usable by an administrative user.
      Specified by:
      deleteInternalPassword in interface MetadataServerInterface
      Parameters:
      username - The name of the user whose internal password should be deleted.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • getInternalLoginSitePolicies

      public InternalLoginSitePolicies getInternalLoginSitePolicies() throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Get the site policies that control the internal authentication provider. These policies cannot be set programmatically, they have to be set in the server configuration files. This method can only be used by an administrative user.
      Specified by:
      getInternalLoginSitePolicies in interface MetadataServerInterface
      Returns:
      An InternalLoginSitePolicies object containing the policy information.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • getInternalLoginUserInfo

      public InternalLoginUserInfo getInternalLoginUserInfo(String username) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Get the information regarding a user's internal login. Only an administrative user can successfully call this method.
      Specified by:
      getInternalLoginUserInfo in interface MetadataServerInterface
      Parameters:
      username - The user to retrieve internal login parameters for.
      Returns:
      An InternalLoginUserInfo object with the user's internal login information.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • setInternalLoginUserOptions

      public void setInternalLoginUserOptions(String username, boolean isDisabled, boolean bypassStrength, boolean bypassHistory, boolean useStdPasswordExpirationDays, int passwordExpirationDays, boolean bypassLockout, boolean bypassInactivitySuspension, boolean doesAccountExpire, Date accountExpirationDate) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Set the options on a user's internal login. This call can only be successfully completed by an administrative user.
      Specified by:
      setInternalLoginUserOptions in interface MetadataServerInterface
      Parameters:
      username - The user whose internal login data is to be updated.
      isDisabled - A flag indicating if the internal login is disabled.
      bypassStrength - Bypass the site password strength requirements.
      bypassHistory - Bypass the site password history checks.
      useStdPasswordExpirationDays - Use the site password expiration setting.
      passwordExpirationDays - Override setting in days for password expiration.
      bypassLockout - Bypass the site policy for account lockout.
      bypassInactivitySuspension - Bypass the site policy for inactivity suspension.
      doesAccountExpire - Set the flag indicating whether this account ever expires.
      accountExpirationDate - Set the date that this account expires.
      Throws:
      ServiceException - If a server error occurs.
      RemoteException - In the event of remote object failure.
    • browseFolder

      public BrowseMetadataInterface browseFolder(String folderISEntityKey, FilterInterface filter) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      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. The return object is the BrowseMetadataInterface object representing the folder itself.

      If what you want is a complete set of information about a specific folder, you may want to consider using the browseFetch method instead of browseFolder, using an appropriate template.

      Specified by:
      browseFolder in interface ServerInterface
      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 BrowseMetadataInterface object. The folder and any matching members will be returned.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - in the event of remote object failure.
    • browseFolderRecursive

      public BrowseMetadataInterface browseFolderRecursive(String folderISEntityKey, FilterInterface filter) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      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 as Members of the entity returned. If no filter is specified, all the members and subfolders of the requested folder will be returned in the resulting BrowseMetadata object, with their members and subfolders included in their Maps. This is potentially a very expensive operation, so use it cautiously.
      Specified by:
      browseFolderRecursive in interface ServerInterface
      Parameters:
      folderISEntityKey - The Entity key of the requested folder.
      filter - A Filter to limit the results.
      Returns:
      A BrowseMetadataInterface object representing the Folder being browsed.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • browseFetch

      public BrowseMetadataInterface browseFetch(String objectURI, FilterInterface filter) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Fetch a lightweight object matching the object URI provided.
      Specified by:
      browseFetch in interface ServerInterface
      Parameters:
      objectURI - The SASDS URI of the object to fetch.
      filter - A filter to provide optional flags and template.
      Returns:
      The browse object for the URI provided.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • browseSearch

      public List browseSearch(FilterInterface filter) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      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 ServerInterface
      Parameters:
      filter - A Filter to limit the objects returned to those the client is interested in. This needs to include the repository the user wants to search, or all repositories will be searched. This can be expensive.
      Returns:
      A List of BrowseMetadataInterface objects.
      Throws:
      ServiceException - In the event of repository errors.
      RemoteException - In the event of remote object failure.
    • browseSearch

      public List browseSearch(BrowseMetadataInterface browseFolder, FilterInterface filter) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Search for objects in the server tree using the folder as a base. This will return lightweight objects which cannot be updated.
      Specified by:
      browseSearch in interface ServerInterface
      Parameters:
      browseFolder - The BrowseMetadataInterface object representing a folder to use as a base of the search.
      filter - The filter criteria to use to find objects.
      Returns:
      A List of BrowseMetadataInterface objects in the folder matching the criteria.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • browseSearch

      public List browseSearch(FolderInterface folder, FilterInterface filter) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Search for objects in the server tree using the folder as a base. This will return lightweight objects which cannot be updated.
      Specified by:
      browseSearch in interface ServerInterface
      Parameters:
      folder - The FolderInterface object representing a folder to use as a base of the search.
      filter - The filter criteria to use to find objects.
      Returns:
      A List of BrowseMetadataInterface objects in the folder matching the criteria.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • browseSearch

      public List browseSearch(List folderList, FilterInterface filter) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Search for objects in the server tree using the list of folders as bases. This will return lightweight objects which cannot be updated.
      Specified by:
      browseSearch in interface ServerInterface
      Parameters:
      folderList - The List of FolderInterface object representing folders to use as a base of the search.
      filter - The filter criteria to use to find objects.
      Returns:
      A List of BrowseMetadataInterface objects in the folder matching the criteria.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • search

      public List search(FolderInterface folder, FilterInterface filter) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Search the server tree from a given folder base using the provided filter.
      Specified by:
      search in interface ServerInterface
      Parameters:
      folder - The folder which is the base of the search hierarchy.
      filter - The filter criteria to use to search for objects.
      Returns:
      A List of objects matching the filter within tree specified.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • search

      public List search(List folderList, FilterInterface filter) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Search the server from a collection of base folders. All of the folders are searched and the results aggregated into a List.
      Specified by:
      search in interface ServerInterface
      Parameters:
      folderList - The List of FolderInterface objects to use as search bases.
      filter - The filter criteria to use to search for objects.
      Returns:
      The List of objects matching the filter criteria in the folders.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • deleteEntity

      public void deleteEntity(MetadataInterface input) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      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 ServerInterface
      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
      Description copied from interface: MetadataServerInterface
      Allow a CMetadata object to be passed in to be deleted.

      Specified by:
      deleteEntity in interface MetadataServerInterface
      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
      Description copied from interface: MetadataServerInterface
      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 MetadataServerInterface
      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.
    • getObjectByPathFilter

      public MetadataInterface getObjectByPathFilter(PathUrl url) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Get an object in the BIP tree using a PathUrl to create a filter to search for it, rather than walking the folder hierarchy. This can be a more efficient technique than the getObjectByPath method uses, but works best for public type objects.
      Specified by:
      getObjectByPathFilter in interface ServerInterface
      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.
    • getObjectByPathNew

      public MetadataInterface getObjectByPathNew(PathUrl url) throws ServiceException, RemoteException
      Throws:
      ServiceException
      RemoteException
    • getObjectByPath

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

      Specified by:
      getObjectByPath in interface ServerInterface
      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.
    • getCreateDate

      public Date getCreateDate(MetadataInterface mi) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Get the Created date of a metadata object as a Date rather than a String.
      Specified by:
      getCreateDate in interface MetadataServerInterface
      Parameters:
      mi - The metadata object to get the create date for.
      Returns:
      A Java Date for the creation date/time of the object.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • getModifiedDate

      public Date getModifiedDate(MetadataInterface mi) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Get the modified date of a metadata object as a Date rather than a String.
      Specified by:
      getModifiedDate in interface MetadataServerInterface
      Parameters:
      mi - The metadata object to get the modified date for.
      Returns:
      A Java Date for the modified date/time of the object.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • getClusterConnections

      public HostPortSet getClusterConnections() throws RemoteException, ServiceException
      Throws:
      RemoteException
      ServiceException
    • createMetadata

      public com.sas.metadata.remote.Root createMetadata(String repositoryId, String name, String type) throws RemoteException, ServiceException
      Description copied from interface: MetadataServerInterface
      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 MetadataServerInterface
      Parameters:
      repositoryId - The FQID of the repository where the object is to be created.
      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 repository error occurs.
    • newMetadata

      public MetadataInterface newMetadata(String reposId, String name, String type) throws ServiceException, RemoteException
      Create a new metadata item. This is used to create repository-specific metadata objects. The type must be a repository-native type string, not a smart object type.
      Specified by:
      newMetadata in interface ServerInterface
      Parameters:
      reposId - The ID of the repository where the object is going. This can be the 8.8 ID, the 8 byte ID, or the repository name.
      name - The name of the new metadata object.
      type - The repository-specific type of the new metadata.
      Returns:
      The smart object representation of the new metadata.
      Throws:
      ServiceException - If a repository or service-level error occurs.
      RemoteException - In the event of remote object failure.
    • fetch

      public MetadataInterface fetch(String objectURI) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Fetch an object from the metadat based on its URI.
      Specified by:
      fetch in interface ServerInterface
      Parameters:
      objectURI - When the SASDS URI is supported, this will be that String. Until then, this should be the entity key (obtained via the MetadataInterface.getEntityKey method) or the repository key (obtained via the MetadataInterface.getReposKey method);
      Returns:
      The metadata object that was fetched.
      Throws:
      ServiceException - If no object matching the URI was found, or some other error occurred.
      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 ServerInterface
      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 ServerInterface
      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.
    • refreshEntity

      public void refreshEntity(MetadataInterface mi) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Refresh an entity from the data in the server.
      Specified by:
      refreshEntity in interface ServerInterface
      Parameters:
      mi - The Metadata object to refresh.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of network errors.
    • getTypeDictionaryMap

      public Map getTypeDictionaryMap() throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Get the Map of TypeDescriptors. The key is the PublicType String and the values are TypeDescriptorInterface objects.
      Specified by:
      getTypeDictionaryMap in interface MetadataServerInterface
      Returns:
      The Type Dictionary Map.
      Throws:
      ServiceException - If a service level error occurs.
      RemoteException - In the event of remote object failure.
    • addToCache

      public void addToCache(MetadataInterface newMetadata) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Explicitly add a new metadata object to the cache.
      Specified by:
      addToCache in interface ServerInterface
      Parameters:
      newMetadata - The new metadata object to add.
      Throws:
      ServiceException - If an error occurs adding the object.
      RemoteException - In the event of remote object failure.
    • newChild

      public ChildServerInterface newChild() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      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 ServerInterface
      Returns:
      A new object of type ChildRepositoryInterface.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of remote object failure.
    • newChild

      public ChildServerInterface newChild(boolean detached) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      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 ServerInterface
      Parameters:
      detached - If true, a detached transaction is created that will not cause objects to be added to the main store of the server.
      Returns:
      A new object of type ChildRepositoryInterface.
      Throws:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of remote object failure.
    • flush

      public void flush() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      flush any pending updates to the metadata server.
      Specified by:
      flush in interface ServerInterface
      Throws:
      ServiceException - If an error occurs during the update.
      RemoteException - In the event of remote object failure.
    • toByteArray

      public byte[] toByteArray(boolean copyData) throws RemoteException, ServiceException
      Description copied from interface: ServerInterface
      Output the state of the server to a byte array.
      Specified by:
      toByteArray in interface ServerInterface
      Parameters:
      copyData - If true, the contents of the data cache is output to the byte stream.
      Returns:
      The byte array containing the object state.
      Throws:
      RemoteException - In the event of remote object failure.
      ServiceException - If a service level error occurs.
    • fromByteArray

      public void fromByteArray(UserContextInterface uci, byte[] data) throws RemoteException, ServiceException
      Description copied from interface: ServerInterface
      Initialize an instance of the server from a byte array.
      Specified by:
      fromByteArray in interface ServerInterface
      Parameters:
      uci - The UserContextInterface containing any credentials or other information to complete the initialization.
      data - The byte array containing the data stream for initializing the object.
      Throws:
      RemoteException - In the event of remote object failure.
      ServiceException - If a service level error occurs.
    • debug

      public void debug(String context, ResourceBundle rb, String key, Object arg0, Object arg1, Object arg2) throws RemoteException
      Specified by:
      debug in interface ServerInterface
      Throws:
      RemoteException
    • debug

      public void debug(String context, String message) throws RemoteException
      Specified by:
      debug in interface ServerInterface
      Throws:
      RemoteException
    • debug

      public void debug(String context, String message, Throwable t) throws RemoteException
      Specified by:
      debug in interface ServerInterface
      Throws:
      RemoteException
    • info

      public void info(String context, ResourceBundle rb, String key, Object arg0, Object arg1, Object arg2) throws RemoteException
      Specified by:
      info in interface ServerInterface
      Throws:
      RemoteException
    • info

      public void info(String context, String message) throws RemoteException
      Specified by:
      info in interface ServerInterface
      Throws:
      RemoteException
    • info

      public void info(String context, String message, Throwable t) throws RemoteException
      Specified by:
      info in interface ServerInterface
      Throws:
      RemoteException
    • warn

      public void warn(String context, ResourceBundle rb, String key, Object arg0, Object arg1) throws RemoteException
      Specified by:
      warn in interface ServerInterface
      Throws:
      RemoteException
    • warn

      public void warn(String context, String message) throws RemoteException
      Specified by:
      warn in interface ServerInterface
      Throws:
      RemoteException
    • warn

      public void warn(String context, String message, Throwable t) throws RemoteException
      Specified by:
      warn in interface ServerInterface
      Throws:
      RemoteException
    • error

      public void error(String context, ResourceBundle rb, String key, Object arg0, Object arg1) throws RemoteException
      Specified by:
      error in interface ServerInterface
      Throws:
      RemoteException
    • error

      public void error(String context, String message) throws RemoteException
      Specified by:
      error in interface ServerInterface
      Throws:
      RemoteException
    • MdStoreIDChange

      public void MdStoreIDChange(com.sas.metadata.remote.MdEvent e, List itemsOld, List itemsNew) throws RemoteException
      Specified by:
      MdStoreIDChange in interface com.sas.metadata.remote.MdStoreIDChangeListener
      Throws:
      RemoteException
    • MdObjectsAdded

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

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

      public void MdObjectsModified(com.sas.metadata.remote.MdEvent e, List items) throws RemoteException
      Specified by:
      MdObjectsModified in interface com.sas.metadata.remote.MdStoreListener
      Throws:
      RemoteException
    • refreshAllData

      public void refreshAllData() throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Refresh all of the data cached from this server.
      Specified by:
      refreshAllData in interface ServerInterface
      Throws:
      ServiceException - If a server error occurs during refresh.
      RemoteException - In the event of remote object failure.
    • clearPendingChanges

      public void clearPendingChanges(boolean rollback) throws ServiceException, RemoteException
      Description copied from interface: ServerInterface
      Clear the changes that are pending for this server. This should only be done to clear an error in the changed data that can't be corrected by the user or application. If the rollback flag is set, then all the pending changes will be rolled back to their persisted state. This will likely require a trip to the server to fetch the data.
      Specified by:
      clearPendingChanges in interface ServerInterface
      Parameters:
      rollback - Roll back the changed objects to their persisted state.
      Throws:
      ServiceException - If a repository error occurs during the operation.
      RemoteException - In the event of remote object failure.
    • MdObjectModified

      public void MdObjectModified(com.sas.metadata.remote.MdEvent e) throws RemoteException
      Specified by:
      MdObjectModified in interface com.sas.metadata.remote.MdObjectListener
      Throws:
      RemoteException
    • notify

      public boolean notify(com.sas.metadata.remote.MdConnectionEvent event) throws RemoteException
      Specified by:
      notify in interface com.sas.metadata.remote.MdConnectionListener
      Throws:
      RemoteException
    • addMetadataConnectionListener

      public void addMetadataConnectionListener(MetadataConnectionListener listener) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Adds a new connection listener so that a consumer may become notified of when a connection to the metadata server has been established.
      Specified by:
      addMetadataConnectionListener in interface MetadataServerInterface
      Parameters:
      listener - connection listener
      Throws:
      ServiceException - In the event of a service error.
      RemoteException - In the event of remote object failure.
    • removeMetadataConnectionListener

      public void removeMetadataConnectionListener(MetadataConnectionListener listener) throws ServiceException, RemoteException
      Description copied from interface: MetadataServerInterface
      Removes an existing connection listener
      Specified by:
      removeMetadataConnectionListener in interface MetadataServerInterface
      Parameters:
      listener - connection listener
      Throws:
      ServiceException - In the event of a service error.
      RemoteException - In the event of remote object failure.
    • MdObjectsCreated

      public void MdObjectsCreated(com.sas.metadata.remote.MdFactoryEvent e) throws RemoteException
      Specified by:
      MdObjectsCreated in interface com.sas.metadata.remote.MdFactoryListener
      Throws:
      RemoteException
    • MdObjectsDeleted

      public void MdObjectsDeleted(com.sas.metadata.remote.MdFactoryEvent e) throws RemoteException
      Specified by:
      MdObjectsDeleted in interface com.sas.metadata.remote.MdFactoryListener
      Throws:
      RemoteException
    • MdObjectsModified

      public void MdObjectsModified(com.sas.metadata.remote.MdFactoryEvent e) throws RemoteException
      Specified by:
      MdObjectsModified in interface com.sas.metadata.remote.MdFactoryListener
      Throws:
      RemoteException
    • makeKey

      protected OMIServer.OMIKey makeKey(String repositoryKey) throws ServiceException, RemoteException
      Throws:
      ServiceException
      RemoteException