com.sas.services.information
Class OMIServerRepository

com.sas.services.information.OMIServerRepository
All Implemented Interfaces:
com.sas.metadata.remote.MdObjectListener, com.sas.services.information.InformationServiceTimerClient, MetadataChangeListener, OMIRepositoryInterface, RepositoryInterface, java.io.Serializable, java.rmi.Remote, java.util.EventListener
Direct Known Subclasses:
OMIServerChildRepository

public class OMIServerRepository
implements OMIRepositoryInterface, com.sas.metadata.remote.MdObjectListener, MetadataChangeListener, com.sas.services.information.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:
Serialized Form

Nested Class Summary
 class OMIServerRepository.OMIEvaluator
           
 
Field Summary
protected  java.lang.String _defaultId
           
protected  java.lang.String _defaultName
           
protected  java.lang.String _defaultRepository
           
protected  boolean _isConnected
           
protected  boolean _isDestroyed
           
protected  java.lang.String _myType
           
protected  MetadataServerInterface _omiServer
           
protected  java.lang.String _subNum
           
protected  java.lang.String _url
           
static java.lang.String BIP_COMPONENTNAME
          The name of the SoftwareComponent object that used as the root of the tree structures used by SAS applications.
static java.lang.String BIP_ROOTNAME
          The name of the Tree object that's the default base Tree for BIP applications.
static java.lang.String ROOT_CLASSIDENTIFIER
          The ClassIdentifier attribute value for the SoftwareComponent that's the root of the tree structures used by SAS applications.
 
Fields inherited from interface com.sas.services.information.OMIRepositoryInterface
TYPE_CUSTOM, TYPE_FOUNDATION, TYPE_PROJECT
 
Fields inherited from interface com.sas.services.information.RepositoryInterface
PROFILE_BEST, PROFILE_NO, PROFILE_POSSIBLE
 
Constructor Summary
  OMIServerRepository()
          The default constructor.
protected OMIServerRepository(java.lang.Class theClass)
          Constructs an instance exporting a remote object that employs RMI socket factories appropriate for the specified class.
 
Method Summary
 void addEntity(MetadataInterface input)
          Add an entity to the repository.
 void addListener(RepositoryListenerInterface listener)
          Add a listener to receive event notifications from the repository instance.
 void addRootFolder(FolderInterface folder)
          Make a folder a root folder of this repository.
 void addToCache(MetadataInterface newMetadata)
          Add a MetadataInterface object to a repository's cache.
 void appyACTToObj(java.lang.String resource, java.lang.String act)
          Apply an AccessControlTemplate to a metadata object.
 BrowseMetadataInterface browseFetch(java.lang.String entityKey, FilterInterface filter)
          Fetch a single object from the repository using the key.
 java.util.List browseFolder(java.lang.String folderISEntityKey, FilterInterface filter)
          Get information about a specific folder.
 java.util.List browseFolderRecursive(java.lang.String folderISEntityKey, FilterInterface filter)
          Search a folder tree recursively using the filter.
 BrowseMetadataInterface browseObjectByPath(PathUrl pathurl, FilterInterface filter)
          Retrieve an object based on its PathUrl.
 java.util.List browseSearch(FilterInterface filter)
          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.
static void clearInformationService()
           
 void close()
          Close the connection to the OMR server and clean up any resources.
 boolean connect(com.sas.meta.SASOMI.IOMI connection, java.lang.String base)
          Set up to use an existing IOMI connection.
 boolean connect(java.lang.String host, int port, java.lang.String id, java.lang.String password, java.lang.String base)
          Establish a connection to a repository server.
 boolean connect(java.lang.String user, java.lang.String password, RepositoryDef config)
          Connect to a repository using the configuration provided in a RepositoryDef object.
 boolean connectWithProxy(java.lang.String host, int port, java.lang.String id, java.lang.String password, java.lang.String base, java.lang.String proxy, boolean isSecure)
          Establish a connection to a repository server.
 void createAccessControTemplate(ACTEntry act)
          Create a new AccessControlTemplate in this repository.
 com.sas.metadata.remote.Root createMetadata(java.lang.String name, java.lang.String type)
          Create a new metadata object.
 void deleteEntities(java.util.List metadataObjects)
          Delete a collection of CMetadata objects.
 void deleteEntity(com.sas.metadata.remote.CMetadata metadata)
          Allow a CMetadata object to be passed in to be deleted.
 void deleteEntity(MetadataInterface input)
          Delete an entity in the repository.
 void destroyAccessControlTemplate(java.lang.String act)
          Destroy an AccessControlTemplate in the repository.
 MetadataInterface factoryProcess(java.lang.Object o)
          Process a raw repository object into a smart object.
 boolean factoryTest(java.lang.Object testObject, java.lang.String filterString)
          Test an object against a Factory filter.
 MetadataInterface fetch(java.lang.String repositoryKey)
          Fetch an object from the repository given the repository key.
 MetadataInterface fetch(java.lang.String repositoryKey, boolean bypassCache)
          Fetch an object from the repository given the repository key.
 MetadataInterface fetchByUrl(java.lang.String entityURL, boolean bypassCache)
          Fetch an object from the repository given the URL.
protected  void finalize()
          Before the object is garbage collected, make sure we close the connection.
protected  void flush()
           
 void freeCredentials(java.lang.String credential)
          Free a credential handle.
 void fromByteArry(UserContextInterface uci, byte[] data)
          Initialize an instance of a repository from state saved in a byte array.
 ACTEntry getAccessControlTemplateAttribs(java.lang.String act)
          Get attributes for an AccessControlTemplate.
 java.util.List getAccessControlTemplateList(int flags)
          Get the list of AccessControlTemplates for this repository.
 java.util.List getACTsOnObj(java.lang.String resource)
          Get the AccessControlTemplates that are associated to an object.
 java.lang.String[][] getAuthorizations(java.lang.String authType, java.lang.String credHandle, java.lang.String resource, java.lang.String permission)
          Get the authorization information for a metadata resource.
 java.util.List getAuthorizationsOnObj(java.lang.String resource, java.util.List identities, java.util.List permissions, int flags)
          Get the authorizations on an object for the given identities and permissions.
 java.lang.String getBase()
          Get the search base.
 com.sas.services.cache.CacheStatistics getCacheStatistics()
          Get the cache statistics for the repository cache.
 java.util.List getChildren()
          Get the list of repository id's that are "down" the dependency chain from the default repository.
 int getCountNoSecurity(Filter filter, java.lang.String association)
          Perform a search operation against the metadata repository which will return a count of the matching objects, rather than the objects themselves.
 java.util.Date getCreateDate(MetadataInterface mi)
           
 java.lang.String getCredentials(java.lang.String subject)
          See the ISecurity interface documentation for a description of this method.
 java.lang.String getDefaultRepositoryId()
          Get the FQID of the default repository.
 java.lang.String getDefaultRepositoryName()
          Get the name of the default repository.
 java.lang.String getDomain()
          Get the domain for this repository.
 com.sas.services.information.rules.EvaluatorInterface getEvaluator(java.lang.Object o)
          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.
 java.lang.String getFactoryKey(java.lang.Object o)
          Get the factory key for objects from this repository.
 long getFolderItemRefreshInterval()
          Get the interval for refreshing the folder's item list for objects retrieved through this repository instance.
 long getFolderSubfolderRefreshInterval()
          Get the interval for refreshing a folder's subfolder list for objects retrieved through this repository instance.
 java.lang.String getHost()
          Get the name of the host this repository is running on.
 java.util.List getIdentitiesOnObj(java.lang.String resource, int flags)
          Get a List of identities associated with an object through authorizations.
 IdentityInterface getIdentity()
          Get the authenticated user identity.
static InformationServiceInterface getInformationService()
          Return a handle to the Information Service.
 java.lang.String[][] getInheritedIdentities(MetadataInterface mi)
           
 java.lang.String[][] getInheritedPermissions(IdentityInterface identity, MetadataInterface metadata, java.util.List permissions)
           
 com.sas.meta.SASOMI.IOMI getIOMI()
          Deprecated. This method will not work across a remote connection.
 com.sas.meta.SASOMI.ISecurity getISecurity()
          Deprecated. This method will not work across a remote connection.
 java.lang.String getISName()
          Get the Information Service configuration name for this repository if it exists.
 java.util.Date getModifiedDate(MetadataInterface mi)
           
 MetadataInterface getObjectByPath(PathUrl url)
          Get an object in the BIP tree using a PathUrl to find it.
 MetadataInterface getObjectByPath(java.lang.String rootFolderName, java.lang.String path, java.lang.Class type)
          Deprecated. Use getObjectByPath( String, String, String )
 MetadataInterface getObjectByPath(java.lang.String rootFolderName, java.lang.String path, java.lang.String type)
          Deprecated. in favor of getObjectByPathString.
 MetadataInterface getObjectByPathString(java.lang.String rootFolderName, java.lang.String path, java.lang.String type)
          Get an object from the repository given a root folder, path and type.
 int getOMRVersion()
          Get the version of the Metadata Server we're taking to.
 long getParentRefreshInterval()
          Get the interval for refreshing an object's parent path information.
 java.util.List getParents()
          Get the list of repository id's that are "up" the dependency chain from the default repository.
 java.util.List getPermissions()
          Get a List of Permission objects from the metadata server.
 int getPort()
          Get the port number of the server this repository is using.
 java.util.List getPredefinedPropertyTypes()
          Get the PropertyType objects from the "Entity Property Types" group.
 java.lang.String getPrincipal()
          Get the principal name this instance connected with.
 java.util.List getRepositories()
          Get a List of MetadataInterface objects that enumerate the Repositories contained in the OMR server we're currently connected to.
 java.lang.String getRepositoryType()
          Get the type of this repository.
 java.lang.String getReposKey(com.sas.metadata.remote.Root reposObject)
          Take a jOMA object and return the repository key that can be used to fetch it.
 FolderInterface getRootFolder(java.lang.String name)
          Get a root folder in the default repository.
 FolderInterface getRootFolder(java.lang.String name, java.lang.String repository)
          Get a root folder in a specific repository.
 java.util.List getRootFolders()
          Get all the root folders in the default repository.
 java.util.List getRootFolders(java.lang.String repository)
          Gets all the root folders in a specific repository.
 ServerInterface getServer()
          Get the ServerInterface that controls this repository.
protected  java.lang.String getSubNum()
           
 MetadataInterface getTrackedObject(int trackingId)
          Deprecated.  
 java.lang.String getUniqueId()
          Get a unique identifier for this repository instance.
 java.lang.String getUrl()
          Return the string that represents the specific instance of this repository.
 PersonInterface getUser()
          Get the person entity that represents the user that is connected to the repository.
 UserContextInterface getUserContext()
          Get the UserContext this repository was connected for.
 boolean isAuthorized(MetadataInterface mi, java.lang.String permission)
           
 boolean isAuthorized(java.lang.String credential, java.lang.String resource, java.lang.String permission)
          Check authorization status for a given credential, resource, and permission.
 AuthResult isAuthorizedWithConditions(java.lang.String credential, java.lang.String resource, java.lang.String permission)
          Check authorization status for a given credential, resource, and permission.
 boolean isChild(RepositoryInterface repos)
          Return a flag indicating if the repository provided is a child of the default repository.
 boolean isChild(java.lang.String repositoryID)
          Return a flag indicating if the repository specified by repositoryID is a dependent child of the default repository.
 boolean isDestroyed()
          Check if the repostiory instance has been closed.
 boolean isEqual(java.lang.Object o)
          Test another object to see if it's equal to this one.
 boolean isInChild(MetadataInterface metadata)
          Return a flag indicating if the metadata object is in a dependent child repository to the default one.
 boolean isInParent(MetadataInterface metadata)
          Return a flag indicating if the metadata object is in a parent repository to the default one.
 boolean isInProject(MetadataInterface metadata)
          Returns a flag indicating if the object came from a project repository.
 boolean isParent(RepositoryInterface repos)
          Return a flag indicating if the repository provided is a parent of the default repository.
 boolean isParent(java.lang.String repositoryID)
          Return a flag indicating if the repository specified by repositoryID is a parent of the default repository.
 int isProfileRepository(java.lang.String url)
          Returns true if this repository supports profile storage.
 boolean isUserAuthorizedInRepository(java.lang.String permission)
          Checks repository permissions for the user.
 FolderInterface makeRootFolder(java.lang.String name)
          Makes a root folder in the repository.
 void MdObjectCreated(com.sas.metadata.remote.MdEvent e, java.lang.String id)
           
 void MdObjectDeleted(com.sas.metadata.remote.MdEvent e, java.lang.String id)
           
 void MdObjectModified(com.sas.metadata.remote.MdEvent e)
          Receive a notification that data has changed that we may have in our cache.
 void MdObjectsAdded(com.sas.metadata.remote.MdEvent e, java.util.List items)
           
 void MdObjectsCreated(com.sas.metadata.remote.MdEvent e, java.util.List ids)
           
 void MdObjectsCreated(com.sas.metadata.remote.MdFactoryEvent e)
           
 void MdObjectsDeleted(com.sas.metadata.remote.MdFactoryEvent e)
           
 void MdObjectsModified(com.sas.metadata.remote.MdEvent e, java.util.List items)
           
 void MdObjectsModified(com.sas.metadata.remote.MdFactoryEvent e)
           
 void MdObjectsRemoved(com.sas.metadata.remote.MdEvent e, java.util.List items)
           
 void metadataChange(MetadataChangeEvent event)
          Process a metadata change event from the Information Service.
 java.lang.Object narrow(com.sas.services.information.RepositoryData entity)
          Narrow a set of raw repository data to a specific object based on the type.
 ChildRepositoryInterface newChild()
          Create a child repository instance with its own cache, which can be used to perform a group of updates transaction-style.
 MetadataInterface newMetadata(MetadataInterface model, java.lang.String name)
          Deprecated. in favor of newMetadataByModel.
 MetadataInterface newMetadata(java.lang.String reposId, java.lang.String name, java.lang.String type)
          Create a new metadata entity.
 MetadataInterface newMetadataByModel(MetadataInterface model, java.lang.String name)
          Create a new metadata entity.
 MetadataInterface produceDefaultMetadata(java.lang.Object o)
          Return the default metadata object for this repository.
protected  void pulseCheck()
           
 void refreshAllData()
          Refresh all of the data that's in the cache.
 void refreshEntity(MetadataInterface mi)
          Refresh an entity from the data in the server.
 void removeACTFromObj(java.lang.String resource, java.lang.String act)
          Remove an AccessControlTemplate from a metadata object.
 void removeListener(RepositoryListenerInterface listener)
          Remove a listener from the list of active event listeners for this repository.
 FolderInterface removeRootFolder(java.lang.String folderName)
          Remove a folder as a root folder for the repository, but don't delete it.
 void runInformationServiceTimer()
           
 java.util.List search(FilterInterface filter)
          Search the repository using the provided filter.
 FilteredFolderInterface searchTree(FolderInterface baseFolder, FilterInterface filter)
          Deprecated. in favor of searchTreeFromBase.
 FilteredFolderInterface searchTree(java.lang.String rootFolderName, FilterInterface filter)
          Search the specified folder tree in the repository using the provided filter.
 FilteredFolderInterface searchTreeFromBase(FolderInterface baseFolder, FilterInterface filter)
          Search the specified folder tree in the repository using the provided filter.
 FilteredFolderInterface searchTreeFromBaseWithScope(FolderInterface baseFolder, FilterInterface filter, int levels)
          Search the specified folder tree in the repository using the provided filter.
 void setAccessControlTemplateAttribs(ACTEntry act)
          Set attributes on an AccessControlTemplate.
 void setAuthorizationsOnObj(java.lang.String resource, java.util.List authorizations, int flags)
          Set authorizations on a metadata object.
 void setDomain(java.lang.String domain)
          Set the security domain for this repository.
 void setFolderItemRefreshInterval(long msecInterval)
          Set the interval for refreshing the folder's item list for objects retrieved through this repository instance.
 void setFolderSubfolderRefreshInterval(long msecInterval)
          Set the interval for refreshing a folder's subfolder list for objects retrieved through this repository instance.
 void setISName(java.lang.String name)
          Set the name that was used to connect to the repository.
 void setParentRefreshInterval(long msecInterval)
          Set the interval for refreshing an object's parent path information.
 void setUser(PersonInterface person)
          Set the entity that represents the user that is connected to the repository.
 void setUserContext(UserContextInterface user)
          Set the UserContext that this repository belongs to.
 byte[] toByteArray()
          Write the current state of the repository to a byte array.
 java.lang.String toString()
          Return a string to represent this instance.
 int trackEntity(MetadataInterface entity)
          Deprecated. Tracking ids are no longer supported.
 void updateEntity(java.lang.Object reposId, java.lang.Object input)
          Update an existing entity in the repository.
 

Field Detail

ROOT_CLASSIDENTIFIER

public static final java.lang.String ROOT_CLASSIDENTIFIER
The ClassIdentifier attribute value for the SoftwareComponent that's the root of the tree structures used by SAS applications.

See Also:
Constant Field Values

BIP_COMPONENTNAME

public static final java.lang.String BIP_COMPONENTNAME
The name of the SoftwareComponent object that used as the root of the tree structures used by SAS applications.

See Also:
Constant Field Values

BIP_ROOTNAME

public static final java.lang.String BIP_ROOTNAME
The name of the Tree object that's the default base Tree for BIP applications.

See Also:
Constant Field Values

_url

protected java.lang.String _url

_defaultRepository

protected java.lang.String _defaultRepository

_defaultName

protected java.lang.String _defaultName

_defaultId

protected java.lang.String _defaultId

_isConnected

protected boolean _isConnected

_isDestroyed

protected boolean _isDestroyed

_subNum

protected java.lang.String _subNum

_myType

protected java.lang.String _myType

_omiServer

protected MetadataServerInterface _omiServer
Constructor Detail

OMIServerRepository

public OMIServerRepository()
                    throws java.rmi.RemoteException
The default constructor.

Initialize the instance. Make sure the Factory is configured, and get a LoggerInterface.

Throws:
java.rmi.RemoteException - if unable to export the remote object.

OMIServerRepository

protected OMIServerRepository(java.lang.Class theClass)
                       throws java.rmi.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, and get a LoggerInterface.

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

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 java.rmi.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:
java.rmi.RemoteException - In the event of network failure.

getUserContext

public UserContextInterface getUserContext()
                                    throws java.rmi.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:
java.rmi.RemoteException - in the event of network failure.

setUser

public void setUser(PersonInterface person)
             throws java.rmi.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:
java.lang.IllegalStateException - if called when the person has already been set.
java.rmi.RemoteException - in the event of remote access errors.

setISName

public void setISName(java.lang.String name)
               throws java.rmi.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:
java.rmi.RemoteException

getISName

public java.lang.String getISName()
                           throws java.rmi.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:
java.rmi.RemoteException - in the event of remote object failure.

getUser

public PersonInterface getUser()
                        throws java.rmi.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:
java.rmi.RemoteException - in the event of remote access errors.

getIdentity

public IdentityInterface getIdentity()
                              throws ServiceException,
                                     java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

getIOMI

public com.sas.meta.SASOMI.IOMI getIOMI()
                                 throws java.lang.IllegalStateException,
                                        java.rmi.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:
java.lang.IllegalStateException - If this instance isn't currently connected.
java.rmi.RemoteException - in the event of remote object failure.

getISecurity

public com.sas.meta.SASOMI.ISecurity getISecurity()
                                           throws java.lang.IllegalStateException,
                                                  java.rmi.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:
java.lang.IllegalStateException - If this instance isn't currently connected.
java.rmi.RemoteException - in the event of remote object failure.

connect

public boolean connect(com.sas.meta.SASOMI.IOMI connection,
                       java.lang.String base)
                throws ServiceException,
                       java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

connectWithProxy

public boolean connectWithProxy(java.lang.String host,
                                int port,
                                java.lang.String id,
                                java.lang.String password,
                                java.lang.String base,
                                java.lang.String proxy,
                                boolean isSecure)
                         throws ServiceException,
                                java.rmi.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:
java.rmi.RemoteException - in the event of network problems.
ServiceException - if a repository error occurs.

connect

public boolean connect(java.lang.String user,
                       java.lang.String password,
                       RepositoryDef config)
                throws ServiceException,
                       java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

connect

public boolean connect(java.lang.String host,
                       int port,
                       java.lang.String id,
                       java.lang.String password,
                       java.lang.String base)
                throws ServiceException,
                       java.rmi.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:
java.rmi.RemoteException - in the event of network problems.
ServiceException - if a repository error occurs.

finalize

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

Overrides:
finalize in class java.lang.Object
Throws:
java.rmi.RemoteException - in the event of remote object failure.

toString

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

Overrides:
toString in class java.rmi.server.RemoteObject
Returns:
the URL string for this instance.

close

public void close()
           throws java.rmi.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:
java.rmi.RemoteException - in the event of remote object failure.

newMetadata

public MetadataInterface newMetadata(java.lang.String reposId,
                                     java.lang.String name,
                                     java.lang.String type)
                              throws ServiceException,
                                     java.rmi.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.
java.rmi.RemoteException - in the event of a network error.

newMetadata

public MetadataInterface newMetadata(MetadataInterface model,
                                     java.lang.String name)
                              throws ServiceException,
                                     java.rmi.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.
java.rmi.RemoteException - in the event of a network error.

newMetadataByModel

public MetadataInterface newMetadataByModel(MetadataInterface model,
                                            java.lang.String name)
                                     throws ServiceException,
                                            java.rmi.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.
java.rmi.RemoteException - in the event of a network error.

fetch

public MetadataInterface fetch(java.lang.String repositoryKey)
                        throws ServiceException,
                               java.rmi.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:
java.rmi.RemoteException - in the event of network errors.
ServiceException - if a repository error occurs.

fetchByUrl

public MetadataInterface fetchByUrl(java.lang.String entityURL,
                                    boolean bypassCache)
                             throws ServiceException,
                                    java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

fetch

public MetadataInterface fetch(java.lang.String repositoryKey,
                               boolean bypassCache)
                        throws ServiceException,
                               java.rmi.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:
java.rmi.RemoteException - in the event of network errors.
ServiceException - if a repository error occurs.

search

public java.util.List search(FilterInterface filter)
                      throws ServiceException,
                             java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

updateEntity

public void updateEntity(java.lang.Object reposId,
                         java.lang.Object input)
                  throws ServiceException,
                         java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

deleteEntity

public void deleteEntity(MetadataInterface input)
                  throws ServiceException,
                         java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

deleteEntity

public void deleteEntity(com.sas.metadata.remote.CMetadata metadata)
                  throws ServiceException,
                         java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

deleteEntities

public void deleteEntities(java.util.List metadataObjects)
                    throws ServiceException,
                           java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

addEntity

public void addEntity(MetadataInterface input)
               throws ServiceException,
                      java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

getUrl

public java.lang.String getUrl()
                        throws java.rmi.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:
java.rmi.RemoteException - in the event of network errors.

getDomain

public java.lang.String getDomain()
                           throws java.rmi.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:
java.rmi.RemoteException - in the event of remote object failure.

setDomain

public void setDomain(java.lang.String domain)
               throws java.rmi.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:
java.rmi.RemoteException - if a networking issue is encountered.

isEqual

public boolean isEqual(java.lang.Object o)
                throws java.rmi.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:
java.rmi.RemoteException

getHost

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

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

getPort

public int getPort()
            throws java.rmi.RemoteException
Get the port number of the server this repository is using.

Specified by:
getPort in interface RepositoryInterface
Returns:
The port number.
Throws:
java.rmi.RemoteException - in the event of remote object failure.

getBase

public java.lang.String getBase()
                         throws java.rmi.RemoteException
Get the search base.

Specified by:
getBase in interface RepositoryInterface
Returns:
The default search base for this repository instance.
Throws:
java.rmi.RemoteException - in the event of a network failure.

getPrincipal

public java.lang.String getPrincipal()
                              throws java.rmi.RemoteException
Get the principal name this instance connected with.

Specified by:
getPrincipal in interface RepositoryInterface
Returns:
The principal string.
Throws:
java.rmi.RemoteException - in the event of remote object failure.

getRepositories

public java.util.List getRepositories()
                               throws ServiceException,
                                      java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

getTrackedObject

public MetadataInterface getTrackedObject(int trackingId)
                                   throws java.rmi.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:
java.rmi.RemoteException - in the event of remote object failure.

narrow

public java.lang.Object narrow(com.sas.services.information.RepositoryData entity)
                        throws ServiceException,
                               java.rmi.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
java.rmi.RemoteException

addRootFolder

public void addRootFolder(FolderInterface folder)
                   throws ServiceException,
                          java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

removeRootFolder

public FolderInterface removeRootFolder(java.lang.String folderName)
                                 throws ServiceException,
                                        java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

makeRootFolder

public FolderInterface makeRootFolder(java.lang.String name)
                               throws ServiceException,
                                      java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

getRootFolder

public FolderInterface getRootFolder(java.lang.String name)
                              throws ServiceException,
                                     java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

getRootFolder

public FolderInterface getRootFolder(java.lang.String name,
                                     java.lang.String repository)
                              throws ServiceException,
                                     java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

getRootFolders

public java.util.List getRootFolders()
                              throws ServiceException,
                                     java.rmi.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.
java.rmi.RemoteException - in the event of RMI failures.

getRootFolders

public java.util.List getRootFolders(java.lang.String repository)
                              throws ServiceException,
                                     java.rmi.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.
java.rmi.RemoteException - in the event of RMI failures.

getObjectByPath

public MetadataInterface getObjectByPath(PathUrl url)
                                  throws ServiceException,
                                         java.rmi.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
java.rmi.RemoteException - in the event of remote object failure.

getObjectByPath

public MetadataInterface getObjectByPath(java.lang.String rootFolderName,
                                         java.lang.String path,
                                         java.lang.Class type)
                                  throws ServiceException,
                                         java.rmi.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.
java.rmi.RemoteException - in the event of network errors.

getObjectByPath

public MetadataInterface getObjectByPath(java.lang.String rootFolderName,
                                         java.lang.String path,
                                         java.lang.String type)
                                  throws ServiceException,
                                         java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

getObjectByPathString

public MetadataInterface getObjectByPathString(java.lang.String rootFolderName,
                                               java.lang.String path,
                                               java.lang.String type)
                                        throws ServiceException,
                                               java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

searchTree

public FilteredFolderInterface searchTree(java.lang.String rootFolderName,
                                          FilterInterface filter)
                                   throws ServiceException,
                                          java.rmi.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:
java.rmi.RemoteException - in the event of network errors.
ServiceException - if a repository error occurs.

searchTree

public FilteredFolderInterface searchTree(FolderInterface baseFolder,
                                          FilterInterface filter)
                                   throws ServiceException,
                                          java.rmi.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:
java.rmi.RemoteException - in the event of network errors.
ServiceException - if a repository error occurs.

searchTreeFromBase

public FilteredFolderInterface searchTreeFromBase(FolderInterface baseFolder,
                                                  FilterInterface filter)
                                           throws ServiceException,
                                                  java.rmi.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:
java.rmi.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,
                                                           java.rmi.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:
java.rmi.RemoteException - in the event of network errors.
ServiceException - if a repository error occurs.

addListener

public void addListener(RepositoryListenerInterface listener)
                 throws ServiceException,
                        java.rmi.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:
java.rmi.RemoteException - in the event of network errors.
ServiceException - if a repository error occurs.

removeListener

public void removeListener(RepositoryListenerInterface listener)
                    throws ServiceException,
                           java.rmi.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:
java.rmi.RemoteException - in the event of network errors.
ServiceException - if a repository error occurs.

metadataChange

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

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

refreshEntity

public void refreshEntity(MetadataInterface mi)
                   throws ServiceException,
                          java.rmi.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:
java.rmi.RemoteException - in the event of network errors.
ServiceException - if a repository error occurs.

MdObjectModified

public void MdObjectModified(com.sas.metadata.remote.MdEvent e)
                      throws java.rmi.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:
java.rmi.RemoteException

trackEntity

public int trackEntity(MetadataInterface entity)
                throws java.rmi.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:
java.rmi.RemoteException - in the event of remote object failure.

getDefaultRepositoryName

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

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

getDefaultRepositoryId

public java.lang.String getDefaultRepositoryId()
                                        throws java.rmi.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:
java.rmi.RemoteException - in the event of remote object failure.

newChild

public ChildRepositoryInterface newChild()
                                  throws ServiceException,
                                         java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

flush

protected void flush()
              throws ServiceException,
                     java.rmi.RemoteException
Throws:
ServiceException
java.rmi.RemoteException

getSubNum

protected java.lang.String getSubNum()
                              throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getReposKey

public java.lang.String getReposKey(com.sas.metadata.remote.Root reposObject)
                             throws ServiceException,
                                    java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

createMetadata

public com.sas.metadata.remote.Root createMetadata(java.lang.String name,
                                                   java.lang.String type)
                                            throws java.rmi.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:
java.rmi.RemoteException - in the event of remote object failure.
ServiceException - If a service level error occurs.

browseSearch

public java.util.List browseSearch(FilterInterface filter)
                            throws ServiceException,
                                   java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

browseFetch

public BrowseMetadataInterface browseFetch(java.lang.String entityKey,
                                           FilterInterface filter)
                                    throws ServiceException,
                                           java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

browseFolder

public java.util.List browseFolder(java.lang.String folderISEntityKey,
                                   FilterInterface filter)
                            throws ServiceException,
                                   java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

browseFolderRecursive

public java.util.List browseFolderRecursive(java.lang.String folderISEntityKey,
                                            FilterInterface filter)
                                     throws ServiceException,
                                            java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

browseObjectByPath

public BrowseMetadataInterface browseObjectByPath(PathUrl pathurl,
                                                  FilterInterface filter)
                                           throws ServiceException,
                                                  java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

runInformationServiceTimer

public void runInformationServiceTimer()
                                throws java.rmi.RemoteException
Specified by:
runInformationServiceTimer in interface com.sas.services.information.InformationServiceTimerClient
Throws:
java.rmi.RemoteException

getCredentials

public java.lang.String getCredentials(java.lang.String subject)
                                throws ServiceException,
                                       java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

freeCredentials

public void freeCredentials(java.lang.String credential)
                     throws ServiceException,
                            java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

isAuthorized

public boolean isAuthorized(java.lang.String credential,
                            java.lang.String resource,
                            java.lang.String permission)
                     throws ServiceException,
                            java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

getAuthorizationsOnObj

public java.util.List getAuthorizationsOnObj(java.lang.String resource,
                                             java.util.List identities,
                                             java.util.List permissions,
                                             int flags)
                                      throws ServiceException,
                                             java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

setAuthorizationsOnObj

public void setAuthorizationsOnObj(java.lang.String resource,
                                   java.util.List authorizations,
                                   int flags)
                            throws ServiceException,
                                   java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

getIdentitiesOnObj

public java.util.List getIdentitiesOnObj(java.lang.String resource,
                                         int flags)
                                  throws ServiceException,
                                         java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

getACTsOnObj

public java.util.List getACTsOnObj(java.lang.String resource)
                            throws ServiceException,
                                   java.rmi.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.
java.rmi.RemoteException - In the event of a remote object failure.

appyACTToObj

public void appyACTToObj(java.lang.String resource,
                         java.lang.String act)
                  throws ServiceException,
                         java.rmi.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.
java.rmi.RemoteException - In the event of a remote object failure.

removeACTFromObj

public void removeACTFromObj(java.lang.String resource,
                             java.lang.String act)
                      throws ServiceException,
                             java.rmi.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.
java.rmi.RemoteException - In the event of a remote object failure.

getAccessControlTemplateList

public java.util.List getAccessControlTemplateList(int flags)
                                            throws ServiceException,
                                                   java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

createAccessControTemplate

public void createAccessControTemplate(ACTEntry act)
                                throws ServiceException,
                                       java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

destroyAccessControlTemplate

public void destroyAccessControlTemplate(java.lang.String act)
                                  throws ServiceException,
                                         java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

setAccessControlTemplateAttribs

public void setAccessControlTemplateAttribs(ACTEntry act)
                                     throws ServiceException,
                                            java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

getAccessControlTemplateAttribs

public ACTEntry getAccessControlTemplateAttribs(java.lang.String act)
                                         throws ServiceException,
                                                java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

isAuthorizedWithConditions

public AuthResult isAuthorizedWithConditions(java.lang.String credential,
                                             java.lang.String resource,
                                             java.lang.String permission)
                                      throws ServiceException,
                                             java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

getAuthorizations

public java.lang.String[][] getAuthorizations(java.lang.String authType,
                                              java.lang.String credHandle,
                                              java.lang.String resource,
                                              java.lang.String permission)
                                       throws ServiceException,
                                              java.rmi.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.
java.rmi.RemoteException - in the event of remote object failure.

getCreateDate

public java.util.Date getCreateDate(MetadataInterface mi)
                             throws ServiceException,
                                    java.rmi.RemoteException
Specified by:
getCreateDate in interface OMIRepositoryInterface
Throws:
ServiceException
java.rmi.RemoteException

getModifiedDate

public java.util.Date getModifiedDate(MetadataInterface mi)
                               throws ServiceException,
                                      java.rmi.RemoteException
Specified by:
getModifiedDate in interface OMIRepositoryInterface
Throws:
ServiceException
java.rmi.RemoteException

getRepositoryType

public java.lang.String getRepositoryType()
                                   throws java.rmi.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:
java.rmi.RemoteException - in the event of remote object failure.

isChild

public boolean isChild(java.lang.String repositoryID)
                throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

isChild

public boolean isChild(RepositoryInterface repos)
                throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

isInChild

public boolean isInChild(MetadataInterface metadata)
                  throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

isParent

public boolean isParent(java.lang.String repositoryID)
                 throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

isParent

public boolean isParent(RepositoryInterface repos)
                 throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

isInParent

public boolean isInParent(MetadataInterface metadata)
                   throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

isInProject

public boolean isInProject(MetadataInterface metadata)
                    throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

getParents

public java.util.List getParents()
                          throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

getChildren

public java.util.List getChildren()
                           throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

getUniqueId

public java.lang.String getUniqueId()
                             throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

setFolderItemRefreshInterval

public void setFolderItemRefreshInterval(long msecInterval)
                                  throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

getFolderItemRefreshInterval

public long getFolderItemRefreshInterval()
                                  throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

setFolderSubfolderRefreshInterval

public void setFolderSubfolderRefreshInterval(long msecInterval)
                                       throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

getFolderSubfolderRefreshInterval

public long getFolderSubfolderRefreshInterval()
                                       throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

setParentRefreshInterval

public void setParentRefreshInterval(long msecInterval)
                              throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

getParentRefreshInterval

public long getParentRefreshInterval()
                              throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

getCountNoSecurity

public int getCountNoSecurity(Filter filter,
                              java.lang.String association)
                       throws ServiceException,
                              java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

getInheritedPermissions

public java.lang.String[][] getInheritedPermissions(IdentityInterface identity,
                                                    MetadataInterface metadata,
                                                    java.util.List permissions)
                                             throws ServiceException,
                                                    java.rmi.RemoteException
Specified by:
getInheritedPermissions in interface OMIRepositoryInterface
Throws:
ServiceException
java.rmi.RemoteException

getInheritedIdentities

public java.lang.String[][] getInheritedIdentities(MetadataInterface mi)
                                            throws ServiceException,
                                                   java.rmi.RemoteException
Specified by:
getInheritedIdentities in interface OMIRepositoryInterface
Throws:
ServiceException
java.rmi.RemoteException

isAuthorized

public boolean isAuthorized(MetadataInterface mi,
                            java.lang.String permission)
                     throws ServiceException,
                            java.rmi.RemoteException
Specified by:
isAuthorized in interface OMIRepositoryInterface
Throws:
ServiceException
java.rmi.RemoteException

factoryProcess

public MetadataInterface factoryProcess(java.lang.Object o)
                                 throws ServiceException,
                                        java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

addToCache

public void addToCache(MetadataInterface newMetadata)
                throws ServiceException,
                       java.rmi.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.
java.rmi.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,
                            java.lang.String id)
                     throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

MdObjectDeleted

public void MdObjectDeleted(com.sas.metadata.remote.MdEvent e,
                            java.lang.String id)
                     throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

MdObjectsCreated

public void MdObjectsCreated(com.sas.metadata.remote.MdEvent e,
                             java.util.List ids)
                      throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

toByteArray

public byte[] toByteArray()
                   throws java.rmi.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:
java.rmi.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 java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.
ServiceException - If a factory error or repository error occurs.

isDestroyed

public boolean isDestroyed()
                    throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

getCacheStatistics

public com.sas.services.cache.CacheStatistics getCacheStatistics()
                                                          throws ServiceException,
                                                                 java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

getFactoryKey

public java.lang.String getFactoryKey(java.lang.Object o)
                               throws ServiceException,
                                      java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

produceDefaultMetadata

public MetadataInterface produceDefaultMetadata(java.lang.Object o)
                                         throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.
ServiceException - If a repository or service level error occurs.

factoryTest

public boolean factoryTest(java.lang.Object testObject,
                           java.lang.String filterString)
                    throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.
ServiceException - If a repository or service level error occurs.

getEvaluator

public com.sas.services.information.rules.EvaluatorInterface getEvaluator(java.lang.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(java.lang.String url)
                        throws java.rmi.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:
java.rmi.RemoteException - In the event of remote object failure.

getOMRVersion

public int getOMRVersion()
                  throws ServiceException,
                         java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

getPermissions

public java.util.List getPermissions()
                              throws ServiceException,
                                     java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

getPredefinedPropertyTypes

public java.util.List getPredefinedPropertyTypes()
                                          throws ServiceException,
                                                 java.rmi.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.
java.rmi.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,
                           java.util.List items)
                    throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

MdObjectsRemoved

public void MdObjectsRemoved(com.sas.metadata.remote.MdEvent e,
                             java.util.List items)
                      throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

MdObjectsModified

public void MdObjectsModified(com.sas.metadata.remote.MdEvent e,
                              java.util.List items)
                       throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getServer

public ServerInterface getServer()
                          throws ServiceException,
                                 java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

refreshAllData

public void refreshAllData()
                    throws ServiceException,
                           java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.

isUserAuthorizedInRepository

public boolean isUserAuthorizedInRepository(java.lang.String permission)
                                     throws ServiceException,
                                            java.rmi.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.
java.rmi.RemoteException - In the event of remote object failure.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.