*** This class provides Binary Compatibility only, not Source Compatibility ***

Class DAVRepository

java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
com.sas.services.information.DAVRepository
All Implemented Interfaces:
DAVRepositoryInterface, com.sas.services.information.InformationServiceTimerClient, MetadataChangeListener, RepositoryInterface, Serializable, Remote
Direct Known Subclasses:
DAVChildRepository

@SASScope("ALL") @BinaryCompatibilityOnly public class DAVRepository extends UnicastRemoteObject implements DAVRepositoryInterface, MetadataChangeListener, InformationServiceTimerClient
The DAV Repository is a single persistent store for information used by client applications. It interfaces to a webDAV server to add, retrieve and update data. DAVRepository documentation

Repositories are defined in the Information Service configuration metadata. NB. Do not specify a trailing slash in the base parameter.

Since:
1.0
See Also:
  • Constructor Details

    • DAVRepository

      public DAVRepository() throws RemoteException
      Constructs a default instance.
      Throws:
      RemoteException - if unable to export the remote object.
    • DAVRepository

      protected DAVRepository(Class theClass) throws RemoteException
      Constructs an instance exporting a remote object that employs RMI socket factories appropriate for the specified class.
      Parameters:
      theClass - Class which will be used to determine the appropriate RMI socket factories.
      Throws:
      RemoteException - if unable to export the remote object.
  • Method Details

    • getInformationService

      public static InformationServiceInterface getInformationService()
      Gets the informationService attribute of the DAVRepository class
      Returns:
      The informationService value
    • clearInformationService

      public static void clearInformationService()
    • getUrlFromEntityKey

      public static String getUrlFromEntityKey(String entityKey)
      Converts a DAV entity key to an HTTP url.
      Parameters:
      entityKey - The entity key to be converted
      Returns:
      String The HTTP url
    • getUserPRInbox

      public static String getUserPRInbox(String userid, UserContextInterface uc) throws ServiceException, RemoteException
      Used to get the URL for the user's inbox. It is assumed that the user's inbox is located on the same DAV server that the user described by the user context parameter. Note - it is possible that this inbox doesn't exist yet.
      Parameters:
      userid - userid of the inbox you want: format is userid, domain\\userid, user@domain
      uc - userContext that can be used to obtain information about the webDAV server
      Returns:
      String The URL of the user's inbox
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • setISName

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

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

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

      public void setUserContext(UserContextInterface user) throws RemoteException
      Set the UserContext that this repository belongs to. This will be used to retrieve a logging interface as well as a session when necessary.
      Specified by:
      setUserContext in interface RepositoryInterface
      Parameters:
      user - The UserContext this repository was connected for.
      Throws:
      RemoteException - in the event of network failure.
    • getUserContext

      public UserContextInterface getUserContext() throws RemoteException
      Get the UserContext this repository was connected for. This may be null if none was set.
      Specified by:
      getUserContext in interface RepositoryInterface
      Returns:
      UserContextInterface The UserContext this repostiory is connected for.
      Throws:
      RemoteException - in the event of network failure.
    • setUser

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

      public PersonInterface getUser() throws RemoteException
      Get the person entity that represents the user that is connected to the repository.
      Specified by:
      getUser in interface RepositoryInterface
      Returns:
      The person entity. This may be null if no Person entity for the user exists in the repository.
      Throws:
      RemoteException - in the event of remote access errors.
    • getIdentity

      public IdentityInterface getIdentity() throws 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:
      RemoteException - In the event of remote object failure.
    • newMetadata

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

      Specified by:
      newMetadata in interface RepositoryInterface
      Parameters:
      repositoryId - 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 repository entity.
      type - The repository-specific type to create.
      Returns:
      a new MetadataInterface object.
      Throws:
      ServiceException - In the event of a parameter or configuration error.
      RemoteException - in the event of a network error.
    • newMetadata

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

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

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

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

      public MetadataInterface fetch(String repositoryKey, boolean bypassCache) throws ServiceException, RemoteException
      Fetch an object from the repository with this repository key (reposKey). The reposKey is the path of the item relative to the repository url. It also has an item type appended to the relative path, which is not used in this repository. For example a url for a resource might be http://server:port/base/results/report1, the repository url would be "dav://server:port/base" and the reposKey would be of the form "results/report1/report", the report being the type of item. The reposKey can be obtained using the Metadata.getReposKey method.

      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 behavior is the same as the fetch method.

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

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

      public MetadataInterface fetch(String repositoryKey) throws ServiceException, RemoteException
      Fetch an object from the repository with this repository key (reposKey). The reposKey is the path of the item relative to the repository url. It also has an item type appended to the relative path, which is not used in this repository. For example a url for a resource might be http://server:port/base/results/report1, the repository url would be "dav://server:port/base" and the reposKey would be of the form "results/report1/report", the report being the type of item. The reposKey can be obtained using the Metadata.getReposKey method.

      Specified by:
      fetch in interface RepositoryInterface
      Parameters:
      repositoryKey - The identifier for the object from the repository.
      Returns:
      MetadataInterface The metadata matching the repositoryId, or null.
      Throws:
      ServiceException - in the event of repository failures
      RemoteException - in the event of network failures
    • search

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

      Specified by:
      search in interface RepositoryInterface
      Parameters:
      filter - A filter to use to limit the returned data.
      Returns:
      List (of Objects) found in the repository satisfying the filter
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • connect

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

      public boolean connectWithProxy(String host, int port, String id, String password, String base, String proxy, boolean isSecure) throws ServiceException, RemoteException
      Connect a user to a repository. The identity should already be authenticated before connecting.

      The host, port, and base make up the repository url which has the format "dav://host:port/base" in DAVRepository. Each entity in the repository is then known by a reposId, which is the path of the resource relative to this repository url. The id and password are used to authenticate against the DAV/HTTP server.

      Specified by:
      connectWithProxy in interface RepositoryInterface
      Parameters:
      host - The host name for the DAV server
      port - The port to be used in the url for the DAV server
      id - The user name to be used for authentication
      password - The password to be used for authentication
      base - The virtual root. Generally authentication domains are created for different virtual roots in a web/DAV server. So the authentication is tried against the url that contains this base.
      proxy - The proxy URL string if a proxy is to be used
      isSecure - SSL to be used or not
      Returns:
      boolean true if the connection was successful, false otherwise
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • connect

      public boolean connect(String host, int port, String id, String password, String base) throws ServiceException, RemoteException
      Connect a user to a repository. The identity should already be authenticated before connecting.

      The host, port, and base make up the repository url which has the format "dav://host:port/base" in DAVRepository. Each entity in the repository is then known by a reposId, which is the path of the resource relative to this repository url. The id and password are used to authenticate against the DAV/HTTP server.

      Specified by:
      connect in interface RepositoryInterface
      Parameters:
      host - The host name for the DAV server
      port - The port to be used in the url for the DAV server
      id - The user name to be used for authentication
      password - The password to be used for authentication
      base - The virtual root. Generally authentication domains are created for different virtual roots in a web/DAV server. So the authentication is tried against the url that contains this base.
      Returns:
      boolean true if the connection was successful, false otherwise
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • deleteEntity

      public void deleteEntity(MetadataInterface input) throws ServiceException, RemoteException
      Delete an entity in the repository.
      Specified by:
      deleteEntity in interface RepositoryInterface
      Parameters:
      input - The metadata object to delete from the repository
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • addEntity

      public void addEntity(MetadataInterface input) throws ServiceException, RemoteException
      Add an entity to the repository.
      Specified by:
      addEntity in interface RepositoryInterface
      Parameters:
      input - The metadata object to be added to the repository
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • getUrl

      public String getUrl() throws RemoteException
      Get the URL that represents the specific instance for a repository. This is of the form "dav://server:port/base". This is in an escaped form.
      Specified by:
      getUrl in interface RepositoryInterface
      Returns:
      String The url value
      Throws:
      RemoteException - in case of network failures
    • getDomain

      public String getDomain() throws RemoteException
      Get the domain for this repository. This is set to a generic domain when the object is created, then set to the specific instance after a successful connection.
      Specified by:
      getDomain in interface RepositoryInterface
      Returns:
      String The domain value
      Throws:
      RemoteException - in case of network failures
    • setDomain

      public void setDomain(String domain) throws RemoteException
      Set the string for the security domain this server is running in.
      Specified by:
      setDomain in interface RepositoryInterface
      Parameters:
      domain - The new domain value
      Throws:
      RemoteException - in case of network failures
    • getHost

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

      Specified by:
      getHost in interface RepositoryInterface
      Returns:
      String The host name.
      Throws:
      RemoteException - in case of network failures
    • getPort

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

      Specified by:
      getPort in interface RepositoryInterface
      Returns:
      int The port number.
      Throws:
      RemoteException - in case of network failures
    • getPrincipal

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

      Specified by:
      getPrincipal in interface RepositoryInterface
      Returns:
      String The principal string.
      Throws:
      RemoteException - in case of network failures
    • getBase

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

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

      @Deprecated public MetadataInterface getTrackedObject(int trackingId) throws RemoteException
      Deprecated.
      Get a cached object by its tracking ID. Objects in the tracking cache are saved by WeakReference, so they may be garbage collected if no other object is using them. In that case, this method will return null.
      Specified by:
      getTrackedObject in interface RepositoryInterface
      Parameters:
      trackingId - Description of the Parameter
      Returns:
      MetadataInterface The trackedObject value
      Throws:
      RemoteException - in case of network failures
    • close

      public void close() throws RemoteException
      Close the connection to the DAV server.
      Specified by:
      close in interface RepositoryInterface
      Throws:
      RemoteException - in the event of a network failure
    • addRootFolder

      public void addRootFolder(FolderInterface folder) throws ServiceException, RemoteException
      Make a folder a root folder of this repository. DAV root naming contexts must be administered through configuration, and cannot be added dynamically.
      Specified by:
      addRootFolder in interface RepositoryInterface
      Parameters:
      folder - The folder to make a root folder.
      Throws:
      ServiceException - In the event of a repository error.
      RemoteException - In the event of remote object failure.
    • removeRootFolder

      public FolderInterface removeRootFolder(String folderName) throws ServiceException, RemoteException
      Root DAV folders cannot be removed dynamically. They have to be administred through the server configuration.
      Specified by:
      removeRootFolder in interface RepositoryInterface
      Parameters:
      folderName - The name of the folder to remove as a root.
      Returns:
      The folder that was removed, if found. Null otherwise.
      Throws:
      ServiceException - In the event of repository error.
      RemoteException - In the event of remote object failure.
    • getRootFolder

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

      Root folders are uniquely identified by a string name.

      Specified by:
      getRootFolder in interface RepositoryInterface
      Parameters:
      name -
      Returns:
      FolderInterface The rootFolder value
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • getRootFolders

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

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

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

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

      @Deprecated public MetadataInterface getObjectByPath(String rootFolderName, String path, Class type) throws ServiceException, RemoteException
      Deprecated.
      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 -
      path -
      type -
      Returns:
      The objectByPath value
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • getObjectByPath

      @Deprecated public MetadataInterface getObjectByPath(String rootFolderName, String path, String type) throws ServiceException, RemoteException
      Deprecated.
      in favor of getObjectByPathString
      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 -
      path -
      type -
      Returns:
      The objectByPath value
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • getObjectByPathString

      public MetadataInterface getObjectByPathString(String rootFolderName, String path, String type) throws ServiceException, RemoteException
      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:
      getObjectByPathString in interface RepositoryInterface
      Parameters:
      rootFolderName -
      path -
      type -
      Returns:
      The objectByPath value
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • searchTree

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

      Specified by:
      searchTree in interface RepositoryInterface
      Parameters:
      rootFolderName - Name of the root folder.
      filter - A filter to use to limit the returned data.
      Returns:
      An Iterator of Objects found in the repository that match the filter.
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • searchTree

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

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

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

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

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

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

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

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

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

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

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

      public BrowseMetadataInterface browseFetch(String entityKey, FilterInterface filter) throws ServiceException, RemoteException
      Fetch a single object from the repository using the key. The filter will be ignored for a WebDAV repository. All of the object's attributes are retrieved.
      Specified by:
      browseFetch in interface RepositoryInterface
      Parameters:
      entityKey - The Information Services entity key, or the repository key of the object desired.
      filter - Ignored.
      Returns:
      A BrowseMetadataInterface object with the requested information.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • browseFolder

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

      public List browseFolderRecursive(String folderISEntityKey, FilterInterface filter) throws ServiceException, RemoteException
      Search a folder tree recursively using the filter. If the filter is provided, the members of all the trees from the one specified, through all of its subordinates will be searched and the matching objects will be returned in the results List. If no filter is specified, all the members and subfolders of the requested folder will be returned in the result List, with their members and subfolders included in their Maps. This is potentially a very expensive operation, so use it cautiously.
      Specified by:
      browseFolderRecursive in interface RepositoryInterface
      Parameters:
      folderISEntityKey - The Entity key of the requested folder.
      filter - A filter to limit the results.
      Returns:
      A List of BrowseMetadataInterface objects.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • browseObjectByPath

      public BrowseMetadataInterface browseObjectByPath(PathUrl pathUrl, FilterInterface filter) throws ServiceException, RemoteException
      Retrieve an object based on its PathUrl.
      Specified by:
      browseObjectByPath in interface RepositoryInterface
      Parameters:
      pathUrl - A PathUrl object that represents the object to be retrieved.
      filter - Ignored for this implementation
      Returns:
      A BrowseMetadataInterface with the requested object, or null if it couldn't be located.
      Throws:
      ServiceException - If a repository error occurs.
      RemoteException - In the event of remote object failure.
    • addListener

      public void addListener(RepositoryListenerInterface listener) throws ServiceException, RemoteException
      Description copied from interface: RepositoryInterface
      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:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of network errors.
    • removeListener

      public void removeListener(RepositoryListenerInterface listener) throws ServiceException, RemoteException
      Description copied from interface: RepositoryInterface
      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:
      ServiceException - if a repository error occurs.
      RemoteException - in the event of network errors.
    • newChild

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

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

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

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

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

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

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

      public String getFactoryKey(Object o) throws RemoteException, ServiceException
      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:
      RemoteException - In the event of remote object failure.
      ServiceException - If a service level error occurs.
    • produceDefaultMetadata

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

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

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

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

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

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

      public InputStream fetchContents(String repositoryId) throws ServiceException, RemoteException
      Fetch an object's content from the repository. This is separate from the fetch method, which only loads the properties of the object. Try to delay the fetching of the content until it is called for (to improve performance). *

      Specified by:
      fetchContents in interface DAVRepositoryInterface
      Parameters:
      repositoryId - The identifier for the object from the repository.
      Returns:
      byte[] The content for the object
      Throws:
      ServiceException - in the event of repository failures
      RemoteException - in the event of network failures
    • fetchContents

      public void fetchContents(String repositoryId, File fout) throws ServiceException, RemoteException
      Description copied from interface: DAVRepositoryInterface
      Fetch an object's content from the repository. This is separate from the fetch method, which only loads the properties of the object. Try to delay the fetching of the content until it is called for (to improve performance). The content is written to the provided file.

      Specified by:
      fetchContents in interface DAVRepositoryInterface
      Parameters:
      fout - The file to which the content should be written
      Throws:
      ServiceException - in the event of repository failures
      RemoteException - in the event of network failures
    • getHttpUrl

      public String getHttpUrl() throws RemoteException
      Get the HTTP URL that represents the specific instance for a repository. This is of the form "http(s)://sever:port/base".
      Specified by:
      getHttpUrl in interface DAVRepositoryInterface
      Returns:
      String The url value
      Throws:
      RemoteException - in case of network failures
    • updateEntity

      public void updateEntity(DAVEntityInterface input) throws ServiceException, RemoteException
      Update an existing entity in the repository.
      Specified by:
      updateEntity in interface DAVRepositoryInterface
      Parameters:
      input - The entity to be updated on the backing store
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • getReposIdwoTypeFromUrl

      public String getReposIdwoTypeFromUrl(String fullUrl)
      Extract the reposId without the type appended from the url provided. If this url can be serviced by this repository, then the url parameter must begin with the repository url. The reposId (without type modifier) is the remainder of the url.
      Specified by:
      getReposIdwoTypeFromUrl in interface DAVRepositoryInterface
      Parameters:
      fullUrl - The url that needs to be broken up into the repository url and the reposId without a type qualifier
      Returns:
      The reposId without a type qualifier for the fullUrl provided. If this entity cannot be processed by this repository then null is returned
    • makePersonalAnchor

      public PersonInterface makePersonalAnchor() throws ServiceException, RemoteException
      Specified by:
      makePersonalAnchor in interface DAVRepositoryInterface
      Throws:
      ServiceException
      RemoteException
    • getPersonalRepository

      public PersonalRepositoryInterface getPersonalRepository() throws ServiceException, RemoteException
      Get the personal repository. If one doesn't exist then create one for this user. The personal repository is anchored under a collection that represents the person connected to the repository - if this collection doesn't exist at this time then it is created here. This is to avoid creating this collection for every connected repository, only ones that are required (eg. personal repository or personal profiles).
      Specified by:
      getPersonalRepository in interface DAVRepositoryInterface
      Returns:
      PersonalRepository The personal repository for this user
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • getHttps

      public boolean getHttps()
      Return whether this repository is using SSL (https://) or not
      Specified by:
      getHttps in interface DAVRepositoryInterface
      Returns:
      boolean true using https, false using http
    • supportsACL

      public boolean supportsACL()
      Description copied from interface: DAVRepositoryInterface
      Return whether this repository supports ACL or not
      Specified by:
      supportsACL in interface DAVRepositoryInterface
      Returns:
      boolean true supports ACL, false does not support ACL
    • supportsSEARCH

      public boolean supportsSEARCH()
      Description copied from interface: DAVRepositoryInterface
      Return whether this repository supports SEARCH or not
      Specified by:
      supportsSEARCH in interface DAVRepositoryInterface
      Returns:
      boolean true supports SEARCH, false does not support SEARCH
    • getItems

      public List getItems(DAVFolderInterface d)
      Specified by:
      getItems in interface DAVRepositoryInterface
    • fetchRepositoryData

      public RepositoryData fetchRepositoryData(String repositoryKey) throws ServiceException, RemoteException
      Specified by:
      fetchRepositoryData in interface DAVRepositoryInterface
      Throws:
      ServiceException
      RemoteException
    • copyTo

      @Deprecated public MetadataInterface copyTo(DAVEntityInterface de, DAVFolderInterface f) throws ServiceException, RemoteException
      Deprecated.
      Specified by:
      copyTo in interface DAVRepositoryInterface
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in case of network failures
    • moveTo

      @Deprecated public MetadataInterface moveTo(DAVEntityInterface de, DAVFolderInterface f) throws ServiceException, RemoteException
      Deprecated.
      Specified by:
      moveTo in interface DAVRepositoryInterface
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in case of network failures
    • copyTo

      public MetadataInterface copyTo(DAVEntityInterface de, DAVFolderInterface f, String name) throws ServiceException, RemoteException
      Description copied from interface: DAVRepositoryInterface
      Copy a smart object.
      Specified by:
      copyTo in interface DAVRepositoryInterface
      Parameters:
      de - The repository entity to be copied
      f - The folder to contain the new object
      name - The object's new name - null or blank takes name of existing object
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • moveTo

      public MetadataInterface moveTo(DAVEntityInterface de, DAVFolderInterface f, String name) throws ServiceException, RemoteException
      Description copied from interface: DAVRepositoryInterface
      Move a smart object.
      Specified by:
      moveTo in interface DAVRepositoryInterface
      Parameters:
      de - The repository entity to be moved
      f - The folder to contain the new object
      name - The object's new name - null or blank takes name of existing object
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • setACLFromStore

      public void setACLFromStore(DAVEntityInterface entity) throws RemoteException
      Retrieves the ACL property information and create the access control list for manipulating smart object access control information.
      Specified by:
      setACLFromStore in interface DAVRepositoryInterface
      Parameters:
      entity - The "in memory" smart object.
      Throws:
      RemoteException - if a networking issue is encountered.
    • version

      public void version(MetadataInterface entity) throws ServiceException, RemoteException
      Put the entity under version control
      Specified by:
      version in interface DAVRepositoryInterface
      Parameters:
      entity - The entity that represents the item to be put under version control
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • checkout

      public void checkout(MetadataInterface entity) throws ServiceException, RemoteException
      Check out the entity
      Specified by:
      checkout in interface DAVRepositoryInterface
      Parameters:
      entity - The entity to be checked out of the repository
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • checkin

      public void checkin(MetadataInterface entity) throws ServiceException, RemoteException
      Check in the entity
      Specified by:
      checkin in interface DAVRepositoryInterface
      Parameters:
      entity - The entity to be checked in to the repository
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • checkin

      public void checkin(MetadataInterface entity, String comment) throws ServiceException, RemoteException
      Check in the entity
      Specified by:
      checkin in interface DAVRepositoryInterface
      Parameters:
      entity - The entity to be checked in to the repository
      comment - A comment for the new version that will be created
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • uncheckout

      public void uncheckout(MetadataInterface entity) throws ServiceException, RemoteException
      Uncheck out/Cancel update
      Specified by:
      uncheckout in interface DAVRepositoryInterface
      Parameters:
      entity - The entity to be unchecked out
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • trackEntity

      public int trackEntity(MetadataInterface entity) throws RemoteException
      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 DAVRepositoryInterface
      Throws:
      RemoteException - in the case of network failures
    • addToCache

      public void addToCache(MetadataInterface mi) throws RemoteException
      Specified by:
      addToCache in interface DAVRepositoryInterface
      Throws:
      RemoteException
    • getSharedResource

      public SharedResourceInterface getSharedResource() throws RemoteException
      Get an object that represents the shared resource
      Specified by:
      getSharedResource in interface DAVRepositoryInterface
      Returns:
      SharedResourceInterface The object that represents the shared resource
      Throws:
      RemoteException - in the case of network failures
    • getPreviousVersionNames

      public List getPreviousVersionNames(MetadataInterface entity) throws ServiceException, RemoteException
      Returns a list of version names for the object
      Specified by:
      getPreviousVersionNames in interface DAVRepositoryInterface
      Parameters:
      entity - The object for which a list of versions is required
      Returns:
      List A list of version names (String)
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • getVersion

      public MetadataInterface getVersion(MetadataInterface entity, String versionName) throws ServiceException, RemoteException
      Retrieves a particular version of the specified object
      Specified by:
      getVersion in interface DAVRepositoryInterface
      Parameters:
      entity - The object for which the specified version is being requested
      versionName - The name of the version (one obtained from getPreviousVersionNames)
      Returns:
      MetadataInterface The specified version of the object
      Throws:
      ServiceException - in the case of repository failures
      RemoteException - in the case of network failures
    • metadataChange

      public void metadataChange(MetadataChangeEvent event) throws RemoteException
      Specified by:
      metadataChange in interface MetadataChangeListener
      Throws:
      RemoteException
    • runInformationServiceTimer

      public void runInformationServiceTimer()
      Specified by:
      runInformationServiceTimer in interface InformationServiceTimerClient
    • narrow

      public Object narrow(RepositoryData entity) throws RemoteException
      Narrow down the type of this entity and return a class that represents this type via the DAVFactory.
      Specified by:
      narrow in interface RepositoryInterface
      Parameters:
      entity - The general entity to be narrowed
      Returns:
      An instance of a subclass of DAVEntity, depending on type information in entity
      Throws:
      RemoteException - in case of network failures
    • isEqual

      public boolean isEqual(Object o) throws RemoteException
      Check to see whether the two repositories point to the same url
      Specified by:
      isEqual in interface RepositoryInterface
      Parameters:
      o - The repository to be compared against
      Returns:
      true if they are the same repository, false if not
      Throws:
      RemoteException - in case of network failures
    • makeRootFolder

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

      DAV root folders cannot be created dynamically. They have to be created using the server configuration tools.

      Specified by:
      makeRootFolder in interface RepositoryInterface
      Parameters:
      name - The name of the folder
      Returns:
      FolderInterface Newly created root folder or null if a folder was not created.
      Throws:
      ServiceException - if unable to create the root folder.
      RemoteException - if a network error occurs.
    • refreshEntity

      public void refreshEntity(MetadataInterface mi) throws ServiceException, RemoteException
      Refresh an existing entity in the repository. Refresh the properties of the resource and if not a collection then refresh the contents too.
      Specified by:
      refreshEntity in interface RepositoryInterface
      Parameters:
      mi - The entity to be updated on the backing store
      Throws:
      ServiceException - in the case of network failures
      RemoteException - in the case of repository failures
    • freeResource

      public void freeResource() throws RemoteException
      Free the resource previously acquired. This method must be called to free up the resource. It should always be called in a try finally block.
      Throws:
      RemoteException - In the event of remote object failure.
    • fetchUsingUrl

      protected MetadataInterface fetchUsingUrl(String url, Map<String,String> extraProperties) throws ServiceException, RemoteException
      Throws:
      ServiceException
      RemoteException
    • toString

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

      Overrides:
      toString in class RemoteObject
      Returns:
      The domain string is hopefully enough to represent this server from any others. If that's not enough, we'll have to provide the bind DN.
    • getServerString

      public String getServerString()
      Description copied from interface: DAVRepositoryInterface
      Returns the identifier string from the connected WebDAV server
      Specified by:
      getServerString in interface DAVRepositoryInterface
      Returns:
      String The server identifier