org.exist.soap
Interface Admin

All Superinterfaces:
Remote
All Known Implementing Classes:
AdminSoapBindingImpl, AdminSoapBindingSkeleton, AdminSoapBindingStub

public interface Admin
extends Remote


Method Summary
 String connect(String userId, String password)
          Create a new user session.
 void copyCollection(String sessionId, String collectionPath, String destinationPath, String newName)
          Copy a collection to the destination collection and rename it.
 void copyResource(String sessionId, String docPath, String destinationPath, String newName)
          Copy a resource to the destination collection and rename it.
 boolean createCollection(String sessionId, String path)
          Create a new collection using the specified path.
 void disconnect(String sessionId)
          Release a user session.
 byte[] getBinaryResource(String sessionId, String name)
          Retrieve a binary resource from the database
 CollectionDesc getCollectionDesc(String sessionId, String collectionName)
          Obtain a description of the specified collection.
 Strings getGroups(String sessionId)
          Obtain a list of the defined database groups
 IndexedElements getIndexedElements(String sessionId, String collectionName, boolean inclusive)
          Return a list of Indexed Elements for a collection
 Permissions getPermissions(String sessionId, String resource)
          Return the permissions of the specified collection/document
 UserDesc getUser(String sessionId, String user)
          Obtain information about an eXist user.
 UserDescs getUsers(String sessionId)
          Get an list of users
 String hasUserLock(String sessionId, String path)
          Return the name of the user owning the lock on the specified resource
 EntityPermissionsList listCollectionPermissions(String sessionId, String name)
          Return a list of the permissions of the child collections of the specified parent collection
 EntityPermissionsList listDocumentPermissions(String sessionId, String name)
          Return a list of the permissions of the child documents of the specified parent collection
 void lockResource(String sessionId, String path, String userName)
          Place a write lock on the specified resource
 void moveCollection(String sessionId, String collectionPath, String destinationPath, String newName)
          Move a collection and its contents.
 void moveResource(String sessionId, String docPath, String destinationPath, String newName)
          Move a resource.
 boolean removeCollection(String sessionId, String path)
          Remove the specified collection.
 boolean removeDocument(String sessionId, String path)
          Remove the specified document.
 void removeUser(String sessionId, String name)
          Remove an eXist user account.
 void setPermissions(String sessionId, String resource, String owner, String ownerGroup, int permissions)
          Set the owner, group and access permissions for a document or collection
 void setUser(String sessionId, String name, String password, Strings groups, String home)
          Create a new user.
 void store(String sessionId, byte[] data, String encoding, String path, boolean replace)
          Store a new document into the database.
 void storeBinary(String sessionId, byte[] data, String path, String mimeType, boolean replace)
          Store a binary resource in the database
 void unlockResource(String sessionId, String path)
          Release the lock on the specified resource
 int xupdate(String sessionId, String collectionName, String xupdate)
          Apply a set of XUpdate modifications to a collection.
 int xupdateResource(String sessionId, String documentName, String xupdate)
          Apply a set of XUpdate modifications to the specified document.
 

Method Detail

store

void store(String sessionId,
           byte[] data,
           String encoding,
           String path,
           boolean replace)
           throws RemoteException
Store a new document into the database. The document will be stored using the name and location as specified by the path argument. To avoid any conflicts with the SOAP transport layer, document contents are passed as base64 encoded binary data. Internally, all documents are stored in UTF-8 encoding. The method will automatically replace an already existing document with the same path if the replace argument is set to true (and the user has sufficient privileges).

Parameters:
sessionId - a unique id for the created session.
data - the document contents as base64 encoded binary data.
encoding - the character encoding used for the document data.
path - the target path for the new document.
replace - should an existing document be replaced?
Throws:
RemoteException

connect

String connect(String userId,
               String password)
               throws RemoteException
Create a new user session. Authenticates the user against the database. The user has to be a valid database user. If the provided user information is valid, a new session will be registered on the server and a session id will be returned. The session will be valid for at least 60 minutes. Please call disconnect() to release the session. Sessions are shared between the Query and Admin services. A session created through the Query service can be used with the Admin service and vice versa.

Parameters:
userId -
password -
Returns:
session-id a unique id for the created session
Throws:
RemoteException - if the user cannot log in

disconnect

void disconnect(String sessionId)
                throws RemoteException
Release a user session. This will free all resources (including result sets).

Parameters:
sessionId - a valid session id as returned by connect().
Throws:
RemoteException

removeCollection

boolean removeCollection(String sessionId,
                         String path)
                         throws RemoteException
Remove the specified collection.

Parameters:
sessionId - sessionId a unique id for the created session.
path - the full path to the collection.
Returns:
true on success.
Throws:
RemoteException

removeDocument

boolean removeDocument(String sessionId,
                       String path)
                       throws RemoteException
Remove the specified document.

Parameters:
sessionId - a unique id for the created session.
path - the full path to the document.
Returns:
true on success.
Throws:
RemoteException

createCollection

boolean createCollection(String sessionId,
                         String path)
                         throws RemoteException
Create a new collection using the specified path.

Parameters:
sessionId - a unique id for the created session.
path - the full path to the collection.
Throws:
RemoteException

xupdate

int xupdate(String sessionId,
            String collectionName,
            String xupdate)
            throws RemoteException
Apply a set of XUpdate modifications to a collection.

Parameters:
sessionId - a unique id for the created session.
collectionName - the full path to the collection.
xupdate - the XUpdate document to be applied.
Throws:
RemoteException

xupdateResource

int xupdateResource(String sessionId,
                    String documentName,
                    String xupdate)
                    throws RemoteException
Apply a set of XUpdate modifications to the specified document.

Parameters:
sessionId - a unique id for the created session.
documentName - the full path to the document.
xupdate - the XUpdate document to be applied.
Throws:
RemoteException

getBinaryResource

byte[] getBinaryResource(String sessionId,
                         String name)
                         throws RemoteException
Retrieve a binary resource from the database

Parameters:
sessionId - the session identifier
name - the name of the binary resource
Returns:
the binary resource data
Throws:
RemoteException

getCollectionDesc

CollectionDesc getCollectionDesc(String sessionId,
                                 String collectionName)
                                 throws RemoteException
Obtain a description of the specified collection. The description contains - the collection permissions - list of sub-collections - list of documents and their permissions

Parameters:
sessionId - the session identifier
collectionName - the collection
Returns:
the collection descriptor
Throws:
RemoteException

setPermissions

void setPermissions(String sessionId,
                    String resource,
                    String owner,
                    String ownerGroup,
                    int permissions)
                    throws RemoteException
Set the owner, group and access permissions for a document or collection

Parameters:
sessionId - the session id
resource - the document/collection that will get new permissions
owner - the new owner
ownerGroup - the new group
permissions - the new access permissions
Throws:
RemoteException

copyResource

void copyResource(String sessionId,
                  String docPath,
                  String destinationPath,
                  String newName)
                  throws RemoteException
Copy a resource to the destination collection and rename it.

Parameters:
sessionId - the session identifier
docPath - the resource to cop
destinationPath - the destination collection
newName - the new name for the resource
Throws:
RemoteException

copyCollection

void copyCollection(String sessionId,
                    String collectionPath,
                    String destinationPath,
                    String newName)
                    throws RemoteException
Copy a collection to the destination collection and rename it.

Parameters:
sessionId - the session identifier
collectionPath - the collection to rename
destinationPath - the destination collection
newName - the new name of the collection.
Throws:
RemoteException

setUser

void setUser(String sessionId,
             String name,
             String password,
             Strings groups,
             String home)
             throws RemoteException
Create a new user. Requires Admin privilege.

Parameters:
sessionId - the session identifier
name - the name of the new user
password - the password for the new user
groups - the new user should belong to these groups
Throws:
RemoteException

getUser

UserDesc getUser(String sessionId,
                 String user)
                 throws RemoteException
Obtain information about an eXist user.

Parameters:
sessionId - the session identifier
user - the user
Returns:
the user information - name, groups and home collection
Throws:
RemoteException - if user doesn't exist

removeUser

void removeUser(String sessionId,
                String name)
                throws RemoteException
Remove an eXist user account. Requires Admin privilege

Parameters:
sessionId - the session identifier
name - the name of the user
Throws:
RemoteException

getUsers

UserDescs getUsers(String sessionId)
                   throws RemoteException
Get an list of users

Parameters:
sessionId - the session identifier
Returns:
an array of user infomation (name, groups, home collection)
Throws:
RemoteException

getGroups

Strings getGroups(String sessionId)
                  throws RemoteException
Obtain a list of the defined database groups

Parameters:
sessionId - the session identifier
Returns:
the list of groups
Throws:
RemoteException

moveCollection

void moveCollection(String sessionId,
                    String collectionPath,
                    String destinationPath,
                    String newName)
                    throws RemoteException
Move a collection and its contents.

Parameters:
sessionId - the session isentifier
collectionPath - the collection to move
destinationPath - the new parent collection
newName - the new collection name
Throws:
RemoteException

moveResource

void moveResource(String sessionId,
                  String docPath,
                  String destinationPath,
                  String newName)
                  throws RemoteException
Move a resource.

Parameters:
sessionId - the session identifier
docPath - the resource to move
destinationPath - the collection to receive the moved resource
newName - the new name for the resource
Throws:
RemoteException

lockResource

void lockResource(String sessionId,
                  String path,
                  String userName)
                  throws RemoteException
Place a write lock on the specified resource

Parameters:
sessionId - the session identifier
path - the path of the resource to lock
userName - the user name of the lock owner
Throws:
RemoteException

unlockResource

void unlockResource(String sessionId,
                    String path)
                    throws RemoteException
Release the lock on the specified resource

Parameters:
sessionId - the session identifier
path - path of the resource to unlock
Throws:
RemoteException

hasUserLock

String hasUserLock(String sessionId,
                   String path)
                   throws RemoteException
Return the name of the user owning the lock on the specified resource

Parameters:
sessionId - the session identifier
path - the resource
Returns:
the name of the lock owner or "" if there is no lock
Throws:
RemoteException

getPermissions

Permissions getPermissions(String sessionId,
                           String resource)
                           throws RemoteException
Return the permissions of the specified collection/document

Parameters:
sessionId - the session identifier
resource - the collection or document
Returns:
the permissions (owner, group, access permissions)
Throws:
RemoteException

listCollectionPermissions

EntityPermissionsList listCollectionPermissions(String sessionId,
                                                String name)
                                                throws RemoteException
Return a list of the permissions of the child collections of the specified parent collection

Parameters:
sessionId - the session identifier
name - the name of the parent collection
Returns:
array containing child collections with their permissions
Throws:
RemoteException

listDocumentPermissions

EntityPermissionsList listDocumentPermissions(String sessionId,
                                              String name)
                                              throws RemoteException
Return a list of the permissions of the child documents of the specified parent collection

Parameters:
sessionId - the session identifier
name - name of the parent collection
Returns:
array containing documents with their permissions
Throws:
RemoteException

getIndexedElements

IndexedElements getIndexedElements(String sessionId,
                                   String collectionName,
                                   boolean inclusive)
                                   throws RemoteException
Return a list of Indexed Elements for a collection

Parameters:
sessionId - the session identifier
collectionName - the collection name
inclusive - include sub-collections ?
Returns:
the list of Indexed Elements
Throws:
RemoteException

storeBinary

void storeBinary(String sessionId,
                 byte[] data,
                 String path,
                 String mimeType,
                 boolean replace)
                 throws RemoteException
Store a binary resource in the database

Parameters:
sessionId - the session identifier
data - the binary data
path - the path for the new resource
mimeType - the mime type for the resource
replace - replace resource if it already exists
Throws:
RemoteException


Copyright (C) Wolfgang Meier. All rights reserved.