com.sas.services.information.metadata
Class Metadata

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.sas.services.information.metadata.Metadata
All Implemented Interfaces:
MetadataInterface,
Direct Known Subclasses:
Content, Folder, LdapContentSubscriber, LdapGroup, LdapLogin, LdapPerson, OMRAccessControlEntry, OMRChannel, OMRDirectory, OMRExtension, OMRGroup, OMRIdentityGroup, OMRLogin, OMRPerson, OMRProperty, OMRPropertySet, OMRServer, OMRSubscriber, OMRTextStore, Remarks, StoredProcess

public class Metadata
extends UnicastRemoteObject
implements MetadataInterface, java.io.Serializable

An abstract class to represent objects that can exist in multiple types of repositories.

Users should avoid casting to this class. Instead, cast objects to MetadataInterface.

Since:
1.0
See Also:
Serialized Form

Field Summary
protected  RepositoryInterface _repository
           
protected  int _repositoryFlag
           
protected  Object _repositoryObject
           
static SimpleDateFormat[] formats
          Date formats using for Date parsing.
protected static TimeZone gmtZone
          GMT timezone.
static int REPOSITORY_DAV
          The object is from a DAV Repository.
static int REPOSITORY_LDAP
          The object is from an LDAP repository.
static int REPOSITORY_NONE
          No repository type has been set.
static int REPOSITORY_OMR
          The object is from an OMI Repository.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface com.sas.services.information.metadata.MetadataInterface
PERMISSION_READMETADATA, PERMISSION_WRITEMETADATA
 
Constructor Summary
  Metadata()
          Default constructor.
protected Metadata(Class theClass)
          Constructs an instance using the specified class to determine appropriate RMI socket factories.
  Metadata(Object o)
          Construct a new Metadata object with Object o.
protected Metadata(Object o, Class theClass)
          Construct a new Metadata object with Object o.
 
Method Summary
 void add()
          Add a new metadata item to the repository.
 void addAccessControl(AccessControlEntryInterface ace)
          Add an Access Control item to this object.
 void addAttribute(String key, String value)
          Add an attribute with the given name and value
 void addAttributes(Map attributeMap)
          Add a number of attributes - names and values are given in the map.
 void addExtension(String name, String value, String type)
          Add an extension to the current set of extensions
 void addKeyword(String keyword)
          Add a keyword to this object.
 void addPermissions(List identities, List permissions)
          Add a set of permissions for a set of identities for this metadata object.
 void addRemark(RemarksInterface remark)
          Add a remark to this smart object
 void addTransactionListener(MetadataInterface mi)
          Add a listener to receive event notifications when a transaction is committed or rolled back.
 void checkin()
          Check out the item
 void checkout()
          Check out the item
static void clearInformationService()
           
 void commit()
          Commit changes that have been made to this object to the parent.
 MetadataInterface copyTo(FolderInterface folder, String name)
          Make a copy of this object.
 void delete()
          Delete this object from its repository.
 void deleteAttribute(String key)
          Delete a specific attribute
 void deleteAttributes(List attributes)
          Delete a list of attributes.
 List getAccessControls()
          Get a list of the Access Controls on this object.
 String getAttribute(String key)
          Get the value of the attribute with the given key/name.
 Map getAttributes()
          Get a list of all the attributes.
 Date getCreateDate()
          Get a Date object representing the time the metadata was created.
 String getDescription()
          Get the object description.
 String getEntityKey()
          Get the entity key for this item.
 String getEntityURL()
          Get a "standard" URL for a metadata object.
 List getExtensions()
          Get the extensions for this object.
 String getGUID()
          Get a string representing a unique Identifier for this object.
 List getIdentities()
          Get all the identities that are associated to this metadata object through permissions.
static InformationServiceInterface getInformationService()
          Get an instance of the Information Service.
 List getKeywords()
          Get a list of keywords associated with this object.
 Date getModifyDate()
          Get a Date object representing the time the metadata was last updated.
 String getName()
          Gets the name of the object.
 String getParentPath(String rootFolderName)
          Get the parent path for this object.
 List getParents()
          Return a List of Folder objects that represent the parent(s) of this object in the hierarchy.
 String getPath(String rootFolderName)
          Get the path of this object from the root folder, including the object name.
 List getPaths(String rootFolderName)
          Get all valid paths for this object.
 PathUrl getPathUrl()
          Get the SBIP URL.
 PathUrl getPathUrl(String rootTreeName)
          Get the SBIP URL.
 PermissionInterface getPermission(IdentityInterface identity, PermissionInterface permission)
          Get a permission that matches the requested permission for the requested identity on this metadata object.
 List getPermissions(IdentityInterface identity)
          Get all the permissions that apply to this object.
 List getPermissions(IdentityInterface identity, String[] inheritedPermissions)
          Get all the permissions that apply to this object.
 List getPreviousVersionNames()
          Gets a list of previous version names
 List getRemarksList()
          Return a List of Remarks objects that represent the dicussion threads related to this object.
 String getReposId()
          Get the repository identifier for this object.
 RepositoryInterface getRepository()
          Get the handle to the repository for this object.
 Object getRepositoryEntity()
          Get the object that was returned directly from the repository.
 String getReposKey()
          Get a String that can be passed directly to a RepositoryInterface.fetch method.
 int getTrackingId()
          Get the tracking ID for this object.
static long getTreeRefresh()
          Get the interval for keeping the parent tree information before forcing a trip to the server to refresh it.
 String getType()
          Get the object type.
 MetadataInterface getVersion(String versionName)
          Return a smart object that represents a particular version
 boolean isAuthorized(String permission)
          Check for a specific permission on this object by the user that owns the connection to the repository.
 boolean isLoggingEnabled(int level, String context)
           
 void logMessage(int level, String message, String context, Throwable t)
           
 String mapNameToFilesystem(int hostOS, String prefix, String suffix)
          Map the metadata object name to a file system path.
 String mapUrlToFilesystem(int hostOS, String prefix, String suffix)
          Map the metadata object's SBIP Url to a file system path.
 void moveTo(FolderInterface folder)
          Move this object to a new folder.
 Object newServiceObject()
          For objects that support it, get an "active" interface for the metadata object.
protected  void notifyTransactionListeners()
           
 void refresh()
          Refresh the data for this object from the repository.
 void removeAccessControl(AccessControlEntryInterface ace)
          Remove an Access Control item from this object.
 void removeExtension(String name)
          Remove an Extension from the current extension set.
 void removeKeyword(String keyword)
          Remove a keyword from this object.
 void removePermissions(List identities, List permissions)
          Remove permissions matching the identities and permission list.
 void rollback()
          Roll back changes to this object, and all objects that have been updated or created in the child repository.
 void setAttribute(String key, String value)
          Set the value of an attribute to the given value
 void setAttributes(Map attributeMap)
          Set a number of attributes - names and values are given in the map
 void setDescription(String description)
          Set the object description.
 void setGUID(String guid)
          Set the GUID string for this object.
 void setKeywords(List keywords)
          Set the keyword collection on this object.
 void setName(String name)
          Set the name of the object.
 void setPermission(IdentityInterface identity, PermissionInterface permission)
          Set a new permission on this metadata object.
 void setRemarksList(List remarks)
          Sets the list of Remarks objects that represent the dicussion threads related to this object.
 void setRepository(RepositoryInterface repository)
          Set the repository that this item exists in.
static void setTreeRefresh(long interval)
          Set the interval for keeping the parent tree information before forcing a trip to the server to refresh it.
 MetadataInterface startTransaction()
          Start a Transaction for this Metadata object.
 void transactionEvent(MetadataInterface mi)
          Notify this object that a child transaction has completed either because of a commit or a rollback.
 void uncheckout()
          Check out the item
 void update()
          Persist any changes to the object back to the repository.
 void version()
          Version control the item
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

REPOSITORY_NONE

public static final int REPOSITORY_NONE
No repository type has been set. Probably the object is uninitialized.

REPOSITORY_LDAP

public static final int REPOSITORY_LDAP
The object is from an LDAP repository.

REPOSITORY_OMR

public static final int REPOSITORY_OMR
The object is from an OMI Repository.

REPOSITORY_DAV

public static final int REPOSITORY_DAV
The object is from a DAV Repository.

formats

public static final SimpleDateFormat[] formats
Date formats using for Date parsing.

gmtZone

protected static final TimeZone gmtZone
GMT timezone.

_repositoryFlag

protected int _repositoryFlag

_repositoryObject

protected Object _repositoryObject

_repository

protected RepositoryInterface _repository
Constructor Detail

Metadata

protected Metadata(Class theClass)
            throws RemoteException
Constructs an instance using the specified class to determine appropriate RMI socket factories.
Parameters:
theClass - Class which will be used to determine the appropriate RMI socket factories.
Throws:
RemoteException - if unable to export the remote object.

Metadata

public Metadata()
         throws RemoteException
Default constructor. There's no entity or repository. This isn't an interesting object yet.
Throws:
RemoteException - if unable to export the remote object.

Metadata

protected Metadata(Object o,
                   Class theClass)
            throws RemoteException
Construct a new Metadata object with Object o. Figure out what kind of repository it came from to set the the repository flag.

Use this constructor if you want to determine RMI socket factories using the subclass's class instead of this object's class. Use Metadata(Object) if you want to employ RMI socket factories based on this class instead of the subclass's class.

Parameters:
o - The object used to initialize this object.
theClass - The subclass's class which will be used to determine appropriate RMI socket factories.
Throws:
RemoteException - if unable to export a remote object.

Metadata

public Metadata(Object o)
         throws RemoteException
Construct a new Metadata object with Object o. Figure out what kind of repository it came from to set the the repository flag.

Use this constructor if you want to determine RMI socket factories using this object's class instead of the subsclass's class. Use Metadata(Object, Class) if you want to employ RMI socket factories based on the subclass instead of this class.

Parameters:
o - The object used to initialize this object.
Throws:
RemoteException - in the event of remote object failure.
Method Detail

setTreeRefresh

public static void setTreeRefresh(long interval)
Set the interval for keeping the parent tree information before forcing a trip to the server to refresh it.
Parameters:
interval - The interval in milliseconds to keep the cached tree information

getTreeRefresh

public static long getTreeRefresh()
Get the interval for keeping the parent tree information before forcing a trip to the server to refresh it.
Returns:
The interval in milliseconds to keep the cached tree information.

getInformationService

public static InformationServiceInterface getInformationService()
                                                         throws ServiceException
Get an instance of the Information Service.
Returns:
An InformationService instance.
Throws:
ServiceException - in the event of a discovery error.

clearInformationService

public static void clearInformationService()

getName

public String getName()
               throws RemoteException
Gets the name of the object.

Specified by:
getName in interface MetadataInterface
Returns:
The name String for the object.
Throws:
RemoteException - in the event of remote object failure.

setName

public void setName(String name)
             throws RemoteException
Set the name of the object.

Specified by:
setName in interface MetadataInterface
Parameters:
name - The name of the object in the repository.
Throws:
RemoteException - in the event of remote object failure.

getDescription

public String getDescription()
                      throws RemoteException
Get the object description.

Specified by:
getDescription in interface MetadataInterface
Returns:
The object description String.
Throws:
RemoteException - in the event of remote object failure.

setDescription

public void setDescription(String description)
                    throws RemoteException
Set the object description.

Specified by:
setDescription in interface MetadataInterface
Parameters:
description - The description String for the object.
Throws:
RemoteException - in the event of remote object failure.

getGUID

public String getGUID()
               throws RemoteException
Get a string representing a unique Identifier for this object.

Specified by:
getGUID in interface MetadataInterface
Returns:
A unique identifier string for this object, or null if none was set.
Throws:
RemoteException - in the event of remote object failure.

setGUID

public void setGUID(String guid)
             throws RemoteException,
                    IllegalStateException
Set the GUID string for this object.

Specified by:
setGUID in interface MetadataInterface
Parameters:
guid - The guid string for this object.
Throws:
RemoteException - in the event of remote object failure.
IllegalStateException - if the object already has an assigned GUID.

getReposId

public String getReposId()
                  throws RemoteException
Get the repository identifier for this object. The repository ID uniquely identifies the object within the repository.

Specified by:
getReposId in interface MetadataInterface
Returns:
A String with the repository identifier.
Throws:
RemoteException - in the event of remote object failure.

getReposKey

public String getReposKey()
                   throws ServiceException,
                          RemoteException
Get a String that can be passed directly to a RepositoryInterface.fetch method. This string will have the repository ID plus the type (separated by a "/").
Specified by:
getReposKey in interface MetadataInterface
Returns:
A String with the repository ID and type that can be passed to the fetch method.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

getType

public String getType()
               throws RemoteException
Get the object type. Subclasses of Metadata will return a repository-neutral type string. If no subclass exists, Metadata returns the repository-specific type.
Specified by:
getType in interface MetadataInterface
Returns:
A type string for the object.
Throws:
RemoteException - in the event of remote object failure

add

public void add()
         throws ServiceException,
                RemoteException
Add a new metadata item to the repository.

Specified by:
add in interface MetadataInterface
Throws:
ServiceException - If there's a repository error.
RemoteException - in the event of a network error.

update

public void update()
            throws ServiceException,
                   RemoteException
Persist any changes to the object back to the repository. This is not done automatically in most cases. Any change to metadata requires an update call to write it to the back end server.

Specified by:
update in interface MetadataInterface
Throws:
ServiceException - if an error occurs in the repository.
RemoteException - in the event of remote object failure

refresh

public void refresh()
             throws ServiceException,
                    RemoteException
Refresh the data for this object from the repository.
Specified by:
refresh in interface MetadataInterface
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

delete

public void delete()
            throws ServiceException,
                   RemoteException
Delete this object from its repository. This may be overridden by subclasses to perform clean up operations on other objects that may be dependent on this one.

Specified by:
delete in interface MetadataInterface
Throws:
ServiceException - in the event of a repository failure.
RemoteException - in the event of a network failure.

getTrackingId

public int getTrackingId()
                  throws RemoteException
Get the tracking ID for this object. This is generated on a per-JVM basis, and incremented for every MetadataInterface object that gets instantiated.

Specified by:
getTrackingId in interface MetadataInterface
Returns:
The tracking ID.
Throws:
RemoteException - in the event of remote object failure

getRepositoryEntity

public Object getRepositoryEntity()
                           throws RemoteException
Get the object that was returned directly from the repository. In the case of OMR data, this will be a CMetadata subclass. For LDAP, it will be a com.sas.services.information.metadata.ldap.LdapEntity subclass.

Specified by:
getRepositoryEntity in interface MetadataInterface
Returns:
The repository-specific object.
Throws:
RemoteException - in the event of remote object failure

getEntityKey

public String getEntityKey()
                    throws IllegalStateException,
                           ServiceException,
                           RemoteException
Get the entity key for this item. The key should have sufficient information to look up the object again at a later time.

Specified by:
getEntityKey in interface MetadataInterface
Returns:
The entity key.
Throws:
IllegalStateException - If the repository hasn't been set on this object.
ServiceException - If an error occurs getting the repository URL.
RemoteException - in the event of remote object failure

getEntityURL

public String getEntityURL()
                    throws ServiceException,
                           RemoteException
Get a "standard" URL for a metadata object. The entity key, while in a URL-ish format, has some extra stuff on it. This method returns a string that can be passed as-is to the Information Service fetchEntityByURL method.
Specified by:
getEntityURL in interface MetadataInterface
Returns:
A URL string representing this metadata object.
Throws:
ServiceException - In the event of a service failure.
RemoteException - In the event of remote object failure.

getPathUrl

public PathUrl getPathUrl()
                   throws IllegalStateException,
                          ServiceException,
                          RemoteException
Get the SBIP URL. This is an object that contains the repository name, the path from a root to the object, the object's name and the object's type. In the SAS Metadata Server, an object is in a rooted Tree if it has a path to a Tree that's associated to a SoftwareComponent with a ClassIdentifier of "E5F27790-2149-11D6-8828-AA0004006D06", and a name of "BIP Service".
Specified by:
getPathUrl in interface MetadataInterface
Returns:
a PathUrl value with the object's location in a rooted tree. If the object isn't in a rooted tree, null is returned.
Throws:
IllegalStateException - if the repository was never set on this object.
ServiceException - if a repository error occurs.
RemoteException - if a remote object error occurs.

getPathUrl

public PathUrl getPathUrl(String rootTreeName)
                   throws IllegalStateException,
                          ServiceException,
                          RemoteException
Get the SBIP URL. This is an object that contains the repository name, the path from a root to the object, the object's name and the object's type. In the SAS Metadata Server, an object is in a rooted Tree if it has a path to a Tree that's associated to a SoftwareComponent with a ClassIdentifier of "E5F27790-2149-11D6-8828-AA0004006D06", and a name of "BIP Service". This method looks for a path to a specific root folder.
Specified by:
getPathUrl in interface MetadataInterface
Parameters:
rootTreeName - The name of the tree rooted at the BIP SoftwareComponent.
Returns:
a PathUrl value with the object's location in the rooted tree. If the object isn't in a tree with the given name, rooted at the BIP SoftwareComponent, null is returned.
Throws:
IllegalStateException - if the repository was never set on this object.
ServiceException - if a repository error occurs.
RemoteException - if a remote object error occurs.

setRepository

public void setRepository(RepositoryInterface repository)
                   throws IllegalStateException,
                          RemoteException
Set the repository that this item exists in.

Specified by:
setRepository in interface MetadataInterface
Parameters:
repository - A handle to the repository for this object.
Throws:
IllegalStateException - If the repository has already been set.
RemoteException - in the event of remote object failure

getRepository

public RepositoryInterface getRepository()
                                  throws RemoteException
Get the handle to the repository for this object.

Specified by:
getRepository in interface MetadataInterface
Returns:
A handle to the repository this item exists in.
Throws:
RemoteException - in the event of remote object failure

getKeywords

public List getKeywords()
                 throws RemoteException
Get a list of keywords associated with this object.

Specified by:
getKeywords in interface MetadataInterface
Returns:
A List of String keywords.
Throws:
RemoteException - in the event of remote object failure.

addKeyword

public void addKeyword(String keyword)
                throws ServiceException,
                       RemoteException
Add a keyword to this object.

Specified by:
addKeyword in interface MetadataInterface
Parameters:
keyword - a new String to add as a keyword.
Throws:
ServiceException - if an error occurs in the repository.
RemoteException - in the event of remote object failure

removeKeyword

public void removeKeyword(String keyword)
                   throws RemoteException
Remove a keyword from this object.

Specified by:
removeKeyword in interface MetadataInterface
Parameters:
keyword - The keyword to remove.
Throws:
RemoteException - in the event of remote object failure

setKeywords

public void setKeywords(List keywords)
                 throws ServiceException,
                        RemoteException
Set the keyword collection on this object.

Specified by:
setKeywords in interface MetadataInterface
Parameters:
keywords - The list of keywords to set on this object.
Throws:
ServiceException - In the event of repository failure.
RemoteException - In the event of network failure.

getPath

public String getPath(String rootFolderName)
               throws ServiceException,
                      RemoteException
Get the path of this object from the root folder, including the object name. Clients should consider using the getPathUrl method to get path information.

Specified by:
getPath in interface MetadataInterface
Parameters:
rootFolderName - The name of the root folder for the path. If null is passed in, the default BIP Tree name is used.
Returns:
A String path or null if no valid path exists from the specified root folder to the current object.
Throws:
ServiceException - in the event of repository failure.
RemoteException - in the event of remote object failure.

getParentPath

public String getParentPath(String rootFolderName)
                     throws ServiceException,
                            RemoteException
Get the parent path for this object. It includes the path from the root tree object to the folder that contains this object. The object name itself isn't included. Clients should consider using the getPathUrl method to get path information.

Specified by:
getParentPath in interface MetadataInterface
Parameters:
rootFolderName - Name of the root folder for the path. If null is passed in, the default BIP tree name is used.
Returns:
A string path or null if no valid path exists from the specified root folder to the current object.
Throws:
ServiceException - in the event of repository errors.
RemoteException - in the event of remote object failure.

getPaths

public List getPaths(String rootFolderName)
              throws ServiceException,
                     RemoteException
Get all valid paths for this object.

Specified by:
getPaths in interface MetadataInterface
Parameters:
rootFolderName - Name of the root folder for the path.
Returns:
A List of String paths or null if no valid path exists from the specified root folder to the current object.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

newServiceObject

public Object newServiceObject()
                        throws ServiceException,
                               RemoteException
For objects that support it, get an "active" interface for the metadata object. For instance, com.sas.services.information.metadata.StoredProcess returns a com.sas.services.storedProcess.StoredProcess object.

Specified by:
newServiceObject in interface MetadataInterface
Returns:
The "active" object for this metadata.
Throws:
ServiceException - if an error occurs
RemoteException - in the event of remote object failure

getParents

public List getParents()
                throws ServiceException,
                       RemoteException
Return a List of Folder objects that represent the parent(s) of this object in the hierarchy.
Specified by:
getParents in interface MetadataInterface
Returns:
a List value
Throws:
ServiceException - if an error occurs
RemoteException - in the event of remote object failure

getCreateDate

public Date getCreateDate()
                   throws ServiceException,
                          RemoteException
Get a Date object representing the time the metadata was created.

Specified by:
getCreateDate in interface MetadataInterface
Returns:
a Date with the date/time the metadata was created.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

getModifyDate

public Date getModifyDate()
                   throws ServiceException,
                          RemoteException
Get a Date object representing the time the metadata was last updated.

Specified by:
getModifyDate in interface MetadataInterface
Returns:
a Date with the time the metadata was last updated.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

getRemarksList

public List getRemarksList()
                    throws ServiceException,
                           RemoteException
Return a List of Remarks objects that represent the dicussion threads related to this object.

Specified by:
getRemarksList in interface MetadataInterface
Returns:
List of Remarks. The discussion threads related to this object
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

setRemarksList

public void setRemarksList(List remarks)
                    throws ServiceException,
                           RemoteException
Sets the list of Remarks objects that represent the dicussion threads related to this object.

Specified by:
setRemarksList in interface MetadataInterface
Parameters:
remarks - The discussion threads related to this object
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

getPermission

public PermissionInterface getPermission(IdentityInterface identity,
                                         PermissionInterface permission)
                                  throws ServiceException,
                                         RemoteException
Get a permission that matches the requested permission for the requested identity on this metadata object. If none exists, return null.
Specified by:
getPermission in interface MetadataInterface
Parameters:
identity - An IdentityInterface for the identity to find the permission for.
permission - The permission to look for.
Returns:
A matching Permission, or null if none was found.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

setPermission

public void setPermission(IdentityInterface identity,
                          PermissionInterface permission)
                   throws ServiceException,
                          RemoteException
Set a new permission on this metadata object.
Specified by:
setPermission in interface MetadataInterface
Parameters:
identity - An IdentityInterface for the identity for the new permission.
permission - The new permission to add.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

getPermissions

public List getPermissions(IdentityInterface identity)
                    throws ServiceException,
                           RemoteException
Get all the permissions that apply to this object.
Specified by:
getPermissions in interface MetadataInterface
Parameters:
identity - The identity to get permissions for.
Returns:
a List of com.sas.services.security.Permission objects that apply to this object.
Throws:
ServiceException - in the event of repository error.
RemoteException - in the event of remote object failure.

getPermissions

public List getPermissions(IdentityInterface identity,
                           String[] inheritedPermissions)
                    throws ServiceException,
                           RemoteException
Get all the permissions that apply to this object.
Specified by:
getPermissions in interface MetadataInterface
Parameters:
identity - The identity to get permissions for.
inheritedPermissions - An array of Strings containing the inherited permissions to look for.
Returns:
a List of com.sas.services.security.Permission objects that apply to this object.
Throws:
ServiceException - in the event of repository error.
RemoteException - in the event of remote object failure.

getIdentities

public List getIdentities()
                   throws ServiceException,
                          RemoteException
Get all the identities that are associated to this metadata object through permissions.
Specified by:
getIdentities in interface MetadataInterface
Returns:
a List of IdentityInterface objects that have some permission defined for this object.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

addPermissions

public void addPermissions(List identities,
                           List permissions)
                    throws ServiceException,
                           RemoteException
Add a set of permissions for a set of identities for this metadata object. All the identities in the List will get all the permissions provided.
Specified by:
addPermissions in interface MetadataInterface
Parameters:
identities - A List of IdentityInterface objects for whom to set the provided permissions.
permissions - a List of com.sas.services.security.Permission objects that specify the permissions to set for these identities.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

removePermissions

public void removePermissions(List identities,
                              List permissions)
                       throws ServiceException,
                              RemoteException
Remove permissions matching the identities and permission list.
Specified by:
removePermissions in interface MetadataInterface
Parameters:
identities - A List of com.sas.services.information.metadata.IdentityInterface objects for whom to remove the permissions.
permissions - A List of com.sas.services.security.PermissionInterface objects to remove for the identities.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

getAccessControls

public List getAccessControls()
                       throws ServiceException,
                              RemoteException
Get a list of the Access Controls on this object.
Specified by:
getAccessControls in interface MetadataInterface
Returns:
A List of AccessControlEntryInterface objects.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

addAccessControl

public void addAccessControl(AccessControlEntryInterface ace)
                      throws ServiceException,
                             RemoteException
Add an Access Control item to this object.
Specified by:
addAccessControl in interface MetadataInterface
Parameters:
ace - An AccessControlInterface object to add to this object.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

removeAccessControl

public void removeAccessControl(AccessControlEntryInterface ace)
                         throws ServiceException,
                                RemoteException
Remove an Access Control item from this object.
Specified by:
removeAccessControl in interface MetadataInterface
Parameters:
ace - An AccessControl object to remove from this object.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

moveTo

public void moveTo(FolderInterface folder)
            throws ServiceException,
                   RemoteException
Move this object to a new folder. Any current parent folders will be removed, and replaced with the one provided. If folder is null, this object will be removed and no further action will be taken.
Specified by:
moveTo in interface MetadataInterface
Parameters:
folder - The new parent Folder of this object.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

copyTo

public MetadataInterface copyTo(FolderInterface folder,
                                String name)
                         throws ServiceException,
                                RemoteException
Make a copy of this object. A new object will be created with all attributes, and keywords copied from the original. The new object's name will be set from the name argument. If the folder is null, if this object has only one parent, the new object will have the same parent Folder. If it has no parent, or more than one, the new object will not have a parent.
Specified by:
copyTo in interface MetadataInterface
Parameters:
folder - The folder to be the parent of the new object.
name - The name of the new object.
Returns:
The new copy of this object.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

getExtensions

public List getExtensions()
                   throws ServiceException,
                          RemoteException
Get the extensions for this object.
Specified by:
getExtensions in interface MetadataInterface
Returns:
a List of Extension objects.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

addExtension

public void addExtension(String name,
                         String value,
                         String type)
                  throws ServiceException,
                         RemoteException
Add an extension to the current set of extensions
Specified by:
addExtension in interface MetadataInterface
Parameters:
name - The new extension name.
value - The new extension value.
type - The new extension value type.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

removeExtension

public void removeExtension(String name)
                     throws ServiceException,
                            RemoteException
Remove an Extension from the current extension set.
Specified by:
removeExtension in interface MetadataInterface
Parameters:
name - The name of the extension to remove.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

isAuthorized

public boolean isAuthorized(String permission)
                     throws ServiceException,
                            RemoteException
Check for a specific permission on this object by the user that owns the connection to the repository.
Specified by:
isAuthorized in interface MetadataInterface
Parameters:
permission - The permission string to check for.
Returns:
true if the permission is granted by the server, false otherwise.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

startTransaction

public MetadataInterface startTransaction()
                                   throws ServiceException,
                                          RemoteException
Start a Transaction for this Metadata object. This will create a child repository to the current repository, move a copy of this object to the child, and return the new MetadataInterface object. This new object can be updated without changing the current cache. The updates can be committed, or rolled back.
Specified by:
startTransaction in interface MetadataInterface
Returns:
a new MetadataInterface object that exists in the temporary child repository.
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

commit

public void commit()
            throws ServiceException,
                   RemoteException
Commit changes that have been made to this object to the parent. This will update the parent cache and disable the child repository that this object is using. If this object isn't in a child repository, a ServiceException will be thrown.
Specified by:
commit in interface MetadataInterface
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

rollback

public void rollback()
              throws ServiceException,
                     RemoteException
Roll back changes to this object, and all objects that have been updated or created in the child repository. This will dispose of the changes and disable the child repository. If this object isn't in a child repository, a ServiceException will be thrown.
Specified by:
rollback in interface MetadataInterface
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

transactionEvent

public void transactionEvent(MetadataInterface mi)
                      throws RemoteException
Description copied from interface: MetadataInterface
Notify this object that a child transaction has completed either because of a commit or a rollback.
Specified by:
transactionEvent in interface MetadataInterface
Following copied from interface: com.sas.services.information.metadata.MetadataInterface
Parameters:
mi - The child object that has completed its transaction.
Throws:
RemoteException - In the event of remote object failure.

addTransactionListener

public void addTransactionListener(MetadataInterface mi)
                            throws RemoteException
Description copied from interface: MetadataInterface
Add a listener to receive event notifications when a transaction is committed or rolled back. This method is intended for use by the Metadata class, and should not be used by external classes.
Specified by:
addTransactionListener in interface MetadataInterface
Following copied from interface: com.sas.services.information.metadata.MetadataInterface
Parameters:
mi - The metadata object to alert that a transaction has committed or rolled back.
Throws:
RemoteException - In the event of remote object failure.

notifyTransactionListeners

protected void notifyTransactionListeners()
                                   throws RemoteException

logMessage

public void logMessage(int level,
                       String message,
                       String context,
                       Throwable t)
                throws RemoteException
Specified by:
logMessage in interface MetadataInterface
Parameters:
level - The level at which to log this message: LoggerInterface.WARN, LoggerInterface.ERROR, etc.
message - The formatted message to output.
context - The logging context for which to output this message. This is usually the fully qualified java class name. If null or zero length, this will default to "com.sas.services.information.metadata".
t - An optional exception to log.
Throws:
RemoteException - In the event of remote object failure.

addRemark

public void addRemark(RemarksInterface remark)
               throws ServiceException,
                      RemoteException
Description copied from interface: MetadataInterface
Add a remark to this smart object
Specified by:
addRemark in interface MetadataInterface
Following copied from interface: com.sas.services.information.metadata.MetadataInterface
Parameters:
remark - The remark to be added to this smart object
Throws:
ServiceException - if a repository error occurs.
RemoteException - in the event of remote object failure.

isLoggingEnabled

public boolean isLoggingEnabled(int level,
                                String context)
                         throws RemoteException
Specified by:
isLoggingEnabled in interface MetadataInterface
Parameters:
level - The level to check: LoggerInterface.WARN, LoggerInterface.ERROR, etc.
context - The logging context to check the level for. This is usually the fully qualified java class name.
Returns:
True if logging enabled at the given level for the given context.
Throws:
RemoteException - In the event of remote object failure.

mapNameToFilesystem

public String mapNameToFilesystem(int hostOS,
                                  String prefix,
                                  String suffix)
                           throws RemoteException,
                                  IllegalArgumentException
Map the metadata object name to a file system path.
Specified by:
mapNameToFilesystem in interface MetadataInterface
Parameters:
hostOS - The host operating system. Valid values include Names.UNKNOWN, Names.WINDOWS, Names.UNIX, Names.ZOS_HFS, Names.ZOS_PDS and Names.WEBDAV.
prefix - The prefix to use when creating the file system path.
suffix - The suffix to use when creating the file system path.
Returns:
String The file system path.
Throws:
RemoteException - In the event of remote object failure.
IllegalArgumentException - If a null name is specified or if an invalid host operating system value is specified.

mapUrlToFilesystem

public String mapUrlToFilesystem(int hostOS,
                                 String prefix,
                                 String suffix)
                          throws ServiceException,
                                 RemoteException,
                                 IllegalArgumentException
Map the metadata object's SBIP Url to a file system path.
Specified by:
mapUrlToFilesystem in interface MetadataInterface
Parameters:
hostOS - The host operating system. Valid values include Names.UNKNOWN, Names.WINDOWS, Names.UNIX, Names.ZOS_HFS, Names.ZOS_PDS and Names.WEBDAV.
prefix - The prefix to use when creating the file system path.
suffix - The suffix to use when creating the file system path.
Returns:
String The file system path.
Throws:
ServiceException - if a repository error occurs.
RemoteException - In the event of remote object failure.
IllegalArgumentException - If a null name is specified or if an invalid host operating system value is specified.

getAttribute

public String getAttribute(String key)
                    throws ServiceException,
                           RemoteException
Get the value of the attribute with the given key/name.
Specified by:
getAttribute in interface MetadataInterface

getAttributes

public Map getAttributes()
                  throws ServiceException,
                         RemoteException
Get a list of all the attributes.
Specified by:
getAttributes in interface MetadataInterface

setAttribute

public void setAttribute(String key,
                         String value)
                  throws ServiceException,
                         RemoteException
Set the value of an attribute to the given value
Specified by:
setAttribute in interface MetadataInterface

addAttribute

public void addAttribute(String key,
                         String value)
                  throws ServiceException,
                         RemoteException
Add an attribute with the given name and value
Specified by:
addAttribute in interface MetadataInterface

deleteAttribute

public void deleteAttribute(String key)
                     throws ServiceException,
                            RemoteException
Delete a specific attribute
Specified by:
deleteAttribute in interface MetadataInterface

setAttributes

public void setAttributes(Map attributeMap)
                   throws ServiceException,
                          RemoteException
Set a number of attributes - names and values are given in the map
Specified by:
setAttributes in interface MetadataInterface

addAttributes

public void addAttributes(Map attributeMap)
                   throws ServiceException,
                          RemoteException
Add a number of attributes - names and values are given in the map.
Specified by:
addAttributes in interface MetadataInterface

deleteAttributes

public void deleteAttributes(List attributes)
                      throws ServiceException,
                             RemoteException
Delete a list of attributes.

Specified by:
deleteAttributes in interface MetadataInterface
Parameters:
attributes - List (of String) property names

version

public void version()
             throws ServiceException,
                    RemoteException
Version control the item
Specified by:
version in interface MetadataInterface

checkout

public void checkout()
              throws ServiceException,
                     RemoteException
Check out the item
Specified by:
checkout in interface MetadataInterface

checkin

public void checkin()
             throws ServiceException,
                    RemoteException
Check out the item
Specified by:
checkin in interface MetadataInterface

uncheckout

public void uncheckout()
                throws ServiceException,
                       RemoteException
Check out the item
Specified by:
uncheckout in interface MetadataInterface

getPreviousVersionNames

public List getPreviousVersionNames()
                             throws ServiceException,
                                    RemoteException
Gets a list of previous version names
Specified by:
getPreviousVersionNames in interface MetadataInterface
Returns:
List of previous version names

getVersion

public MetadataInterface getVersion(String versionName)
                             throws ServiceException,
                                    RemoteException
Return a smart object that represents a particular version
Specified by:
getVersion in interface MetadataInterface
Parameters:
versionName - The name of the version to return
Returns:
MetadataInterface A smart object representing the requested version




Copyright © 2006 SAS Institute Inc. All Rights Reserved.
javadoc generated Fri, 10 Feb 2006 17:28:58