*** This class provides Binary Compatibility only, not Source Compatibility ***
Class DAVRepository
- All Implemented Interfaces:
DAVRepositoryInterface, com.sas.services.information.InformationServiceTimerClient,MetadataChangeListener,RepositoryInterface,Serializable,Remote
- Direct Known Subclasses:
DAVChildRepository
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:
-
Field Summary
Fields inherited from class java.rmi.server.RemoteObject
refFields inherited from interface com.sas.services.information.RepositoryInterface
PROFILE_BEST, PROFILE_NO, PROFILE_POSSIBLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionConstructs a default instance.protectedDAVRepository(Class theClass) Constructs an instance exporting a remote object that employs RMI socket factories appropriate for the specified class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntity(MetadataInterface input) Add an entity to the repository.voidaddListener(RepositoryListenerInterface listener) Add a listener to receive event notifications from the repository instance.voidaddRootFolder(FolderInterface folder) Make a folder a root folder of this repository.voidbrowseFetch(String entityKey, FilterInterface filter) Fetch a single object from the repository using the key.ListbrowseFolder(String folderISEntityKey, FilterInterface filter) Get information about a specific folder.ListbrowseFolderRecursive(String folderISEntityKey, FilterInterface filter) Search a folder tree recursively using the filter.browseObjectByPath(PathUrl pathUrl, FilterInterface filter) Retrieve an object based on its PathUrl.ListbrowseSearch(FilterInterface filter) Search the repository, the objects that are returned are not cached, and are in a generic container that is not remotable, doesn't go to the server for data that wasn't originally retrieved, and not persistable.voidcheckin(MetadataInterface entity) Check in the entityvoidcheckin(MetadataInterface entity, String comment) Check in the entityvoidcheckout(MetadataInterface entity) Check out the entitystatic voidvoidclose()Close the connection to the DAV server.booleanconnect(String host, int port, String id, String password, String base) Connect a user to a repository.booleanconnect(String user, String password, RepositoryDef config) Connect to a repository using the configuration provided in a RepositoryDef object.booleanconnectWithProxy(String host, int port, String id, String password, String base, String proxy, boolean isSecure) Connect a user to a repository.Deprecated.copyTo(DAVEntityInterface de, DAVFolderInterface f, String name) Copy a smart object.voiddeleteEntity(MetadataInterface input) Delete an entity in the repository.factoryProcess(Object o) Process a raw repository object into a smart object.booleanfactoryTest(Object testObject, String filterString) Test an object against a Factory filter.fetch(String repositoryKey) Fetch an object from the repository with this repository key (reposKey).fetch(String repositoryKey, boolean bypassCache) Fetch an object from the repository with this repository key (reposKey).fetchByUrl(String entityURL, boolean bypassCache) Fetch an object from the repository given the URL.InputStreamfetchContents(String repositoryId) Fetch an object's content from the repository.voidfetchContents(String repositoryId, File fout) Fetch an object's content from the repository.RepositoryDatafetchRepositoryData(String repositoryKey) protected MetadataInterfacefetchUsingUrl(String url, Map<String, String> extraProperties) voidFree the resource previously acquired.voidfromByteArry(UserContextInterface uci, byte[] data) Initialize an instance of a repository from state saved in a byte array.StringgetBase()Get the search base.com.sas.services.cache.CacheStatisticsGet the cache statistics for the repository cache.StringGet the domain for this repository.EvaluatorInterfacegetEvaluator(Object o) This method is used by the Factory to get an evaluator that will evaluate factory rules against an object's data to determine if it matches the rule.StringgetFactoryKey(Object o) Get the factory key for objects from this repository.StringgetHost()Get the name of the host this repository is running on.booleangetHttps()Return whether this repository is using SSL (https://) or notStringGet the HTTP URL that represents the specific instance for a repository.Get the authenticated user identity.static InformationServiceInterfaceGets the informationService attribute of the DAVRepository classStringGet the Information Service configuration name for this repository if it exists.ListgetObjectByPath(PathUrl url) Get an object in the BIP tree using a PathUrl to find it.getObjectByPath(String rootFolderName, String path, Class type) Deprecated.getObjectByPath(String rootFolderName, String path, String type) Deprecated.in favor of getObjectByPathStringgetObjectByPathString(String rootFolderName, String path, String type) Get an object by path.Get the personal repository.intgetPort()Get the port number of the server this repository is using.ListReturns a list of version names for the objectStringGet the principal name this instance connected with.StringgetReposIdwoTypeFromUrl(String fullUrl) Extract the reposId without the type appended from the url provided.getRootFolder(String name) Get a root folder in the repository.ListGet all the root folders int the repository.Get the ServerInterface that controls this repository.StringReturns the identifier string from the connected WebDAV serverSharedResourceInterfaceGet an object that represents the shared resourcegetTrackedObject(int trackingId) Deprecated.StringGet a unique identifier for this repository instance.StringgetUrl()Get the URL that represents the specific instance for a repository.static StringgetUrlFromEntityKey(String entityKey) Converts a DAV entity key to an HTTP url.getUser()Get the person entity that represents the user that is connected to the repository.Get the UserContext this repository was connected for.static StringgetUserPRInbox(String userid, UserContextInterface uc) Used to get the URL for the user's inbox.getVersion(MetadataInterface entity, String versionName) Retrieves a particular version of the specified objectbooleanCheck if the repostiory instance has been closed.booleanisEqual(Object o) Check to see whether the two repositories point to the same urlintisProfileRepository(String url) Returns true if this repository supports profile storage.makeRootFolder(String name) Make a root folder in the repository.voidDeprecated.moveTo(DAVEntityInterface de, DAVFolderInterface f, String name) Move a smart object.Objectnarrow(RepositoryData entity) Narrow down the type of this entity and return a class that represents this type via the DAVFactory.newChild()Create a child repository instance with its own cache, which can be used to perform a group of updates transaction-style.newMetadata(MetadataInterface model, String name) Deprecated.newMetadata(String repositoryId, String name, String type) Create a new metadata entity.newMetadataByModel(MetadataInterface model, String name) Create a new metadata entity.produceDefaultMetadata(Object o) Return the default metadata object for this repository.voidRefresh all of the data that's in the cache.voidRefresh an existing entity in the repository.voidremoveListener(RepositoryListenerInterface listener) Remove a listener from the list of active event listeners for this repository.removeRootFolder(String folderName) Root DAV folders cannot be removed dynamically.voidListsearch(FilterInterface filter) Search the repository using the provided filter.searchTree(DAVFolderInterface folder, FilterInterface filter, int levels) Search the specified folder tree in the repository using the provided filter.searchTree(FolderInterface baseFolder, FilterInterface filter) Deprecated.in favor of searchTreeFromBase.searchTree(String rootFolderName, FilterInterface filter) Search the specified folder tree in the repository using the provided filter.searchTreeFromBase(FolderInterface baseFolder, FilterInterface filter) Search the specified folder tree in the repository using the provided filter.searchTreeFromBaseWithScope(FolderInterface baseFolder, FilterInterface filter, int levels) Search the specified folder tree in the repository using the provided filter.voidsetACLFromStore(DAVEntityInterface entity) Retrieves the ACL property information and create the access control list for manipulating smart object access control information.voidsetDomain(String domain) Set the string for the security domain this server is running in.voidsetISName(String name) Set the name that was used to connect to the repository.voidsetUser(PersonInterface person) Set the entity that represents the user that is connected to the repository.voidSet the UserContext that this repository belongs to.booleanReturn whether this repository supports ACL or notbooleanReturn whether this repository supports SEARCH or notbyte[]Write the current state of the repository to a byte array.StringtoString()Return a printable string to represent this instance.inttrackEntity(MetadataInterface entity) Add a new object to the tracking cache.voiduncheckout(MetadataInterface entity) Uncheck out/Cancel updatevoidupdateEntity(DAVEntityInterface input) Update an existing entity in the repository.voidversion(MetadataInterface entity) Put the entity under version controlMethods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObjectMethods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLogMethods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toStubMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
DAVRepository
public DAVRepository() throws RemoteExceptionConstructs 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
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@domainuc- 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:
setISNamein interfaceRepositoryInterface- 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 RemoteExceptionDescription copied from interface:RepositoryInterfaceGet 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:
getISNamein interfaceRepositoryInterface- Returns:
- The ReposDef name for this repository.
- Throws:
RemoteException- in the event of remote object failure.
-
setUserContext
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:
setUserContextin interfaceRepositoryInterface- Parameters:
user- The UserContext this repository was connected for.- Throws:
RemoteException- in the event of network failure.
-
getUserContext
Get the UserContext this repository was connected for. This may be null if none was set.- Specified by:
getUserContextin interfaceRepositoryInterface- Returns:
- UserContextInterface The UserContext this repostiory is connected for.
- Throws:
RemoteException- in the event of network failure.
-
setUser
Set the entity that represents the user that is connected to the repository.- Specified by:
setUserin interfaceRepositoryInterface- 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
Get the person entity that represents the user that is connected to the repository.- Specified by:
getUserin interfaceRepositoryInterface- 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
Description copied from interface:RepositoryInterfaceGet the authenticated user identity. This will either be a PersonInterface object or an IdentityGroupInterface object.- Specified by:
getIdentityin interfaceRepositoryInterface- 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:
newMetadatain interfaceRepositoryInterface- 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:
newMetadatain interfaceRepositoryInterface- 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:
newMetadataByModelin interfaceRepositoryInterface- 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
bypassCacheflag 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 thefetchmethod.- Specified by:
fetchin interfaceRepositoryInterface- 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:RepositoryInterfaceFetch an object from the repository given the URL. If the URL doesn't match this repository instance, a ServiceException is thrown.- Specified by:
fetchByUrlin interfaceRepositoryInterface- 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
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:
fetchin interfaceRepositoryInterface- 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 failuresRemoteException- in the event of network failures
-
search
Search the repository using the provided filter.- Specified by:
searchin interfaceRepositoryInterface- 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 failuresRemoteException- in the case of network failures
-
connect
public boolean connect(String user, String password, RepositoryDef config) throws ServiceException, RemoteException Description copied from interface:RepositoryInterfaceConnect to a repository using the configuration provided in a RepositoryDef object.- Specified by:
connectin interfaceRepositoryInterface- Parameters:
user- The UserId for authentication to the repository server.password- The password for authentication to the repository server.config- TheRepositoryDefobject 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:
connectWithProxyin interfaceRepositoryInterface- Parameters:
host- The host name for the DAV serverport- The port to be used in the url for the DAV serverid- The user name to be used for authenticationpassword- The password to be used for authenticationbase- 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 usedisSecure- SSL to be used or not- Returns:
- boolean true if the connection was successful, false otherwise
- Throws:
ServiceException- in the case of repository failuresRemoteException- 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:
connectin interfaceRepositoryInterface- Parameters:
host- The host name for the DAV serverport- The port to be used in the url for the DAV serverid- The user name to be used for authenticationpassword- The password to be used for authenticationbase- 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 failuresRemoteException- in the case of network failures
-
deleteEntity
Delete an entity in the repository.- Specified by:
deleteEntityin interfaceRepositoryInterface- Parameters:
input- The metadata object to delete from the repository- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
addEntity
Add an entity to the repository.- Specified by:
addEntityin interfaceRepositoryInterface- Parameters:
input- The metadata object to be added to the repository- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
getUrl
public String getUrl() throws RemoteExceptionGet 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:
getUrlin interfaceRepositoryInterface- Returns:
- String The url value
- Throws:
RemoteException- in case of network failures
-
getDomain
public String getDomain() throws RemoteExceptionGet 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:
getDomainin interfaceRepositoryInterface- 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:
setDomainin interfaceRepositoryInterface- Parameters:
domain- The new domain value- Throws:
RemoteException- in case of network failures
-
getHost
public String getHost() throws RemoteExceptionGet the name of the host this repository is running on.- Specified by:
getHostin interfaceRepositoryInterface- Returns:
- String The host name.
- Throws:
RemoteException- in case of network failures
-
getPort
public int getPort() throws RemoteExceptionGet the port number of the server this repository is using.- Specified by:
getPortin interfaceRepositoryInterface- Returns:
- int The port number.
- Throws:
RemoteException- in case of network failures
-
getPrincipal
public String getPrincipal() throws RemoteExceptionGet the principal name this instance connected with.- Specified by:
getPrincipalin interfaceRepositoryInterface- Returns:
- String The principal string.
- Throws:
RemoteException- in case of network failures
-
getBase
public String getBase() throws RemoteExceptionGet the search base.- Specified by:
getBasein interfaceRepositoryInterface- Returns:
- String The default search base for this repository instance.
- Throws:
RemoteException- in the event of a network failure.
-
getTrackedObject
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:
getTrackedObjectin interfaceRepositoryInterface- Parameters:
trackingId- Description of the Parameter- Returns:
- MetadataInterface The trackedObject value
- Throws:
RemoteException- in case of network failures
-
close
public void close() throws RemoteExceptionClose the connection to the DAV server.- Specified by:
closein interfaceRepositoryInterface- Throws:
RemoteException- in the event of a network failure
-
addRootFolder
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:
addRootFolderin interfaceRepositoryInterface- 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
Root DAV folders cannot be removed dynamically. They have to be administred through the server configuration.- Specified by:
removeRootFolderin interfaceRepositoryInterface- 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
Get a root folder in the repository.Root folders are uniquely identified by a string name.
- Specified by:
getRootFolderin interfaceRepositoryInterface- Parameters:
name-- Returns:
- FolderInterface The rootFolder value
- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
getRootFolders
Get all the root folders int the repository.- Specified by:
getRootFoldersin interfaceRepositoryInterface- 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
Description copied from interface:RepositoryInterfaceGet an object in the BIP tree using a PathUrl to find it.- Specified by:
getObjectByPathin interfaceRepositoryInterface- 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 failureRemoteException- 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:
getObjectByPathin interfaceRepositoryInterface- Parameters:
rootFolderName-path-type-- Returns:
- The objectByPath value
- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
getObjectByPath
@Deprecated public MetadataInterface getObjectByPath(String rootFolderName, String path, String type) throws ServiceException, RemoteException Deprecated.in favor of getObjectByPathStringGet 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:
getObjectByPathin interfaceRepositoryInterface- Parameters:
rootFolderName-path-type-- Returns:
- The objectByPath value
- Throws:
ServiceException- in the case of repository failuresRemoteException- 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:
getObjectByPathStringin interfaceRepositoryInterface- Parameters:
rootFolderName-path-type-- Returns:
- The objectByPath value
- Throws:
ServiceException- in the case of repository failuresRemoteException- 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:
searchTreein interfaceRepositoryInterface- 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 failuresRemoteException- 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:
searchTreein interfaceRepositoryInterface- 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:
searchTreeFromBasein interfaceRepositoryInterface- 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:
searchTreeFromBaseWithScopein interfaceRepositoryInterface- 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
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:
browseSearchin interfaceRepositoryInterface- 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:
browseFetchin interfaceRepositoryInterface- 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:
browseFolderin interfaceRepositoryInterface- 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:
browseFolderRecursivein interfaceRepositoryInterface- 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:
browseObjectByPathin interfaceRepositoryInterface- 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:RepositoryInterfaceAdd a listener to receive event notifications from the repository instance. Events include disconnect, reconnect, and close. Other events may be added.- Specified by:
addListenerin interfaceRepositoryInterface- 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:RepositoryInterfaceRemove a listener from the list of active event listeners for this repository.- Specified by:
removeListenerin interfaceRepositoryInterface- 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
Description copied from interface:RepositoryInterfaceCreate a child repository instance with its own cache, which can be used to perform a group of updates transaction-style.- Specified by:
newChildin interfaceRepositoryInterface- 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 RemoteExceptionDescription copied from interface:RepositoryInterfaceGet a unique identifier for this repository instance.- Specified by:
getUniqueIdin interfaceRepositoryInterface- Returns:
- A unique identifier.
- Throws:
RemoteException- In the event of remote object failure.
-
factoryProcess
Description copied from interface:RepositoryInterfaceProcess 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:
factoryProcessin interfaceRepositoryInterface- 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 RemoteExceptionDescription copied from interface:RepositoryInterfaceCheck if the repostiory instance has been closed.- Specified by:
isDestroyedin interfaceRepositoryInterface- Returns:
- true if the repository has been closed, false otherwise.
- Throws:
RemoteException- In the event of remote object failure.
-
toByteArray
Description copied from interface:RepositoryInterfaceWrite the current state of the repository to a byte array.- Specified by:
toByteArrayin interfaceRepositoryInterface- 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:RepositoryInterfaceInitialize an instance of a repository from state saved in a byte array.- Specified by:
fromByteArryin interfaceRepositoryInterface- 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, RemoteExceptionDescription copied from interface:RepositoryInterfaceGet the cache statistics for the repository cache.- Specified by:
getCacheStatisticsin interfaceRepositoryInterface- Returns:
- A CacheStatistics object.
- Throws:
ServiceException- If a factory error or repository error occurs.RemoteException- In the event of remote object failure.
-
getFactoryKey
Description copied from interface:RepositoryInterfaceGet the factory key for objects from this repository. This method should only be used internally to the Information Service.- Specified by:
getFactoryKeyin interfaceRepositoryInterface- 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
Description copied from interface:RepositoryInterfaceReturn 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:
produceDefaultMetadatain interfaceRepositoryInterface- 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:RepositoryInterfaceTest an object against a Factory filter. Return true if the filter string matches, false otherwise.- Specified by:
factoryTestin interfaceRepositoryInterface- 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:RepositoryInterfaceReturns true if this repository supports profile storage.- Specified by:
isProfileRepositoryin interfaceRepositoryInterface- 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:RepositoryInterfaceThis 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:
getEvaluatorin interfaceRepositoryInterface- Parameters:
o- The object to test against the rule.- Returns:
- A new evaluator for this object.
-
getServer
Description copied from interface:RepositoryInterfaceGet the ServerInterface that controls this repository. For repositories that do not have servers, this may return null.- Specified by:
getServerin interfaceRepositoryInterface- Returns:
- The
ServerInterfacethat controls this repository. - Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
refreshAllData
Description copied from interface:RepositoryInterfaceRefresh all of the data that's in the cache.- Specified by:
refreshAllDatain interfaceRepositoryInterface- Throws:
ServiceException- If a repository error occurs during the refresh.RemoteException- In the event of remote object failure.
-
fetchContents
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:
fetchContentsin interfaceDAVRepositoryInterface- Parameters:
repositoryId- The identifier for the object from the repository.- Returns:
- byte[] The content for the object
- Throws:
ServiceException- in the event of repository failuresRemoteException- in the event of network failures
-
fetchContents
Description copied from interface:DAVRepositoryInterfaceFetch 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:
fetchContentsin interfaceDAVRepositoryInterface- Parameters:
fout- The file to which the content should be written- Throws:
ServiceException- in the event of repository failuresRemoteException- in the event of network failures
-
getHttpUrl
public String getHttpUrl() throws RemoteExceptionGet the HTTP URL that represents the specific instance for a repository. This is of the form "http(s)://sever:port/base".- Specified by:
getHttpUrlin interfaceDAVRepositoryInterface- Returns:
- String The url value
- Throws:
RemoteException- in case of network failures
-
updateEntity
Update an existing entity in the repository.- Specified by:
updateEntityin interfaceDAVRepositoryInterface- Parameters:
input- The entity to be updated on the backing store- Throws:
ServiceException- in the case of repository failuresRemoteException- 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:
getReposIdwoTypeFromUrlin interfaceDAVRepositoryInterface- 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
- Specified by:
makePersonalAnchorin interfaceDAVRepositoryInterface- Throws:
ServiceExceptionRemoteException
-
getPersonalRepository
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:
getPersonalRepositoryin interfaceDAVRepositoryInterface- Returns:
- PersonalRepository The personal repository for this user
- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
getHttps
public boolean getHttps()Return whether this repository is using SSL (https://) or not- Specified by:
getHttpsin interfaceDAVRepositoryInterface- Returns:
- boolean true using https, false using http
-
supportsACL
public boolean supportsACL()Description copied from interface:DAVRepositoryInterfaceReturn whether this repository supports ACL or not- Specified by:
supportsACLin interfaceDAVRepositoryInterface- Returns:
- boolean true supports ACL, false does not support ACL
-
supportsSEARCH
public boolean supportsSEARCH()Description copied from interface:DAVRepositoryInterfaceReturn whether this repository supports SEARCH or not- Specified by:
supportsSEARCHin interfaceDAVRepositoryInterface- Returns:
- boolean true supports SEARCH, false does not support SEARCH
-
getItems
- Specified by:
getItemsin interfaceDAVRepositoryInterface
-
fetchRepositoryData
public RepositoryData fetchRepositoryData(String repositoryKey) throws ServiceException, RemoteException - Specified by:
fetchRepositoryDatain interfaceDAVRepositoryInterface- Throws:
ServiceExceptionRemoteException
-
copyTo
@Deprecated public MetadataInterface copyTo(DAVEntityInterface de, DAVFolderInterface f) throws ServiceException, RemoteException Deprecated.- Specified by:
copyToin interfaceDAVRepositoryInterface- Throws:
ServiceException- in the case of repository failuresRemoteException- in case of network failures
-
moveTo
@Deprecated public MetadataInterface moveTo(DAVEntityInterface de, DAVFolderInterface f) throws ServiceException, RemoteException Deprecated.- Specified by:
moveToin interfaceDAVRepositoryInterface- Throws:
ServiceException- in the case of repository failuresRemoteException- in case of network failures
-
copyTo
public MetadataInterface copyTo(DAVEntityInterface de, DAVFolderInterface f, String name) throws ServiceException, RemoteException Description copied from interface:DAVRepositoryInterfaceCopy a smart object.- Specified by:
copyToin interfaceDAVRepositoryInterface- Parameters:
de- The repository entity to be copiedf- The folder to contain the new objectname- The object's new name - null or blank takes name of existing object- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
moveTo
public MetadataInterface moveTo(DAVEntityInterface de, DAVFolderInterface f, String name) throws ServiceException, RemoteException Description copied from interface:DAVRepositoryInterfaceMove a smart object.- Specified by:
moveToin interfaceDAVRepositoryInterface- Parameters:
de- The repository entity to be movedf- The folder to contain the new objectname- The object's new name - null or blank takes name of existing object- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
setACLFromStore
Retrieves the ACL property information and create the access control list for manipulating smart object access control information.- Specified by:
setACLFromStorein interfaceDAVRepositoryInterface- Parameters:
entity- The "in memory" smart object.- Throws:
RemoteException- if a networking issue is encountered.
-
version
Put the entity under version control- Specified by:
versionin interfaceDAVRepositoryInterface- Parameters:
entity- The entity that represents the item to be put under version control- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
checkout
Check out the entity- Specified by:
checkoutin interfaceDAVRepositoryInterface- Parameters:
entity- The entity to be checked out of the repository- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
checkin
Check in the entity- Specified by:
checkinin interfaceDAVRepositoryInterface- Parameters:
entity- The entity to be checked in to the repository- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
checkin
public void checkin(MetadataInterface entity, String comment) throws ServiceException, RemoteException Check in the entity- Specified by:
checkinin interfaceDAVRepositoryInterface- Parameters:
entity- The entity to be checked in to the repositorycomment- A comment for the new version that will be created- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
uncheckout
Uncheck out/Cancel update- Specified by:
uncheckoutin interfaceDAVRepositoryInterface- Parameters:
entity- The entity to be unchecked out- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
trackEntity
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:
trackEntityin interfaceDAVRepositoryInterface- Throws:
RemoteException- in the case of network failures
-
addToCache
- Specified by:
addToCachein interfaceDAVRepositoryInterface- Throws:
RemoteException
-
getPreviousVersionNames
public List getPreviousVersionNames(MetadataInterface entity) throws ServiceException, RemoteException Returns a list of version names for the object- Specified by:
getPreviousVersionNamesin interfaceDAVRepositoryInterface- 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 failuresRemoteException- 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:
getVersionin interfaceDAVRepositoryInterface- Parameters:
entity- The object for which the specified version is being requestedversionName- The name of the version (one obtained from getPreviousVersionNames)- Returns:
- MetadataInterface The specified version of the object
- Throws:
ServiceException- in the case of repository failuresRemoteException- in the case of network failures
-
metadataChange
- Specified by:
metadataChangein interfaceMetadataChangeListener- Throws:
RemoteException
-
runInformationServiceTimer
public void runInformationServiceTimer()- Specified by:
runInformationServiceTimerin interfaceInformationServiceTimerClient
-
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:
narrowin interfaceRepositoryInterface- 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:
isEqualin interfaceRepositoryInterface- 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
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:
makeRootFolderin interfaceRepositoryInterface- Parameters:
name- The name of the folder- Returns:
- FolderInterface Newly created root folder or
nullif a folder was not created. - Throws:
ServiceException- if unable to create the root folder.RemoteException- if a network error occurs.
-
refreshEntity
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:
refreshEntityin interfaceRepositoryInterface- Parameters:
mi- The entity to be updated on the backing store- Throws:
ServiceException- in the case of network failuresRemoteException- in the case of repository failures
-
freeResource
public void freeResource() throws RemoteExceptionFree 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:
ServiceExceptionRemoteException
-
toString
public String toString()Return a printable string to represent this instance.- Overrides:
toStringin classRemoteObject- 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:DAVRepositoryInterfaceReturns the identifier string from the connected WebDAV server- Specified by:
getServerStringin interfaceDAVRepositoryInterface- Returns:
- String The server identifier
-