org.exist.xmlrpc
Class RpcConnection

java.lang.Object
  extended by org.exist.xmlrpc.RpcConnection
All Implemented Interfaces:
RpcAPI

public class RpcConnection
extends Object
implements RpcAPI

This class implements the actual methods defined by RpcAPI.

Author:
Wolfgang Meier (wolfgang@exist-db.org) Modified by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it

Field Summary
 
Fields inherited from interface org.exist.xmlrpc.RpcAPI
BASE_URI, COLUMN, ERROR, LINE, NAMESPACES, PROTECTED_MODE, SORT_EXPR, STATIC_DOCUMENTS, VARIABLES
 
Constructor Summary
RpcConnection(XmldbRequestProcessorFactory factory, User user)
          Creates a new RpcConnection instance.
 
Method Summary
 void backup(String userbackup, String password, String destcollection, String collection)
          The method backup
 HashMap compile(byte[] xquery, HashMap parameters)
           
 HashMap compile(String query, HashMap parameters)
          The method compile
 boolean configureCollection(String collName, String configuration)
          The method configureCollection
 boolean copyCollection(String name, String namedest)
           
 boolean copyCollection(String collectionPath, String destinationPath, String newName)
           
 boolean copyResource(String docPath, String destinationPath, String newName)
           
 boolean createCollection(String name)
          Create a new collection on the database.
 boolean createCollection(String name, Date created)
          The method createCollection
 String createId(String collName)
          The method createId
 String createResourceId(String collectionName)
          The method createResourceId
 boolean dataBackup(String dest)
          The method dataBackup
 HashMap describeCollection(String rootCollection)
          The method describeCollection
 HashMap describeResource(String resourceName)
          The method describeResource
 boolean enterServiceMode()
           
 HashMap execute(String xpath, HashMap parameters)
          The method execute
 int executeQuery(byte[] xpath, HashMap parameters)
           
 int executeQuery(byte[] xpath, String encoding, HashMap parameters)
          Execute XPath query and return a reference to the result set.
 int executeQuery(String xpath, HashMap parameters)
          The method executeQuery
 void exitServiceMode()
           
 byte[] getBinaryResource(String name)
          The method getBinaryResource
 HashMap getCollectionDesc(String rootCollection)
          The method getCollectionDesc
 Date getCreationDate(String collectionPath)
          The method getCreationDate
 Vector getDocType(String documentPath)
          The method getDocType
 byte[] getDocument(String name, HashMap parametri)
          Retrieve document by name.
 byte[] getDocument(String name, String encoding, int prettyPrint)
          Retrieve document by name.
 byte[] getDocument(String name, String encoding, int prettyPrint, String stylesheet)
          Retrieve document by name.
 String getDocumentAsString(String docName, HashMap parametri)
          The method getDocument
 String getDocumentAsString(String name, int prettyPrint)
           
 String getDocumentAsString(String name, int prettyPrint, String stylesheet)
           
 List getDocumentChunk(String name, HashMap parameters)
           
 byte[] getDocumentChunk(String name, int start, int len)
           
 HashMap getDocumentData(String docName, HashMap parameters)
          The method getDocumentData
 Vector getDocumentListing()
          The method getDocumentListing
 Vector getDocumentListing(String collName)
          The method getDocumentListing
 Vector getGroups()
          The method getGroups
 int getHits(int resultId)
          The method getHits
 Vector getIndexedElements(String collectionName, boolean inclusive)
          The method getIndexedElements
 HashMap getNextChunk(String handle, int offset)
          The method getNextChunk
 HashMap getPermissions(String name)
          The method getPermissions
 int getResourceCount(String collectionName)
          The method getResourceCount
 Vector getTimestamps(String documentPath)
          The method getTimestamps
 HashMap getUser(String name)
          The method getUser
 Vector getUsers()
          The method getUsers
 boolean hasCollection(String collectionName)
          The method hasCollection
 boolean hasDocument(String documentPath)
          The method hasDocument
 String hasUserLock(String documentPath)
          The method hasUserLock
 boolean isValid(String documentPath)
          Validate if specified document is Valid.
 boolean isXACMLEnabled()
          The method isXACMLEnabled
 HashMap listCollectionPermissions(String name)
          The method listCollectionPermissions
 HashMap listDocumentPermissions(String name)
          The method listDocumentPermissions
 boolean lockResource(String documentPath, String userName)
          The method lockResource
 boolean moveCollection(String collectionPath, String destinationPath, String newName)
           
 boolean moveOrCopyCollection(String collectionName, String destinationPath, String newName, boolean move)
          The method moveOrCopyCollection
 boolean moveOrCopyResource(String documentPath, String destinationPath, String newName, boolean move)
          The method moveOrCopyResource
 boolean moveResource(String docPath, String destinationPath, String newName)
           
 boolean parse(byte[] xmlData, String docName)
          Parse an XML document and store it into the database.
 boolean parse(byte[] xml, String documentPath, int overwrite)
          The method parse
 boolean parse(byte[] xml, String documentPath, int overwrite, Date created, Date modified)
          The method parse
 boolean parse(String xml, String docName)
           
 boolean parse(String xml, String docName, int overwrite)
           
 boolean parseLocal(String localFile, String docName, boolean replace, String mimeType)
          Parse a file previously uploaded with upload.
 boolean parseLocal(String localFile, String docName, boolean replace, String mimeType, Date created, Date modified)
           
 boolean parseLocal(String localFile, String documentPath, int overwrite, String mimeType)
          Parse a file previously uploaded with upload.
 boolean parseLocal(String localFile, String documentPath, int overwrite, String mimeType, Date created, Date modified)
          The method parseLocal
 String printDiagnostics(String query, HashMap parameters)
          The method printDiagnostics
 byte[] query(byte[] xquery, int howmany, int start, HashMap parameters)
          execute XPath query and return howmany nodes from the result set, starting at position start.
 String query(String xpath, int howmany, int start, HashMap parameters)
          The method query
 HashMap queryP(byte[] xpath, HashMap parameters)
           
 HashMap queryP(byte[] xpath, String docName, String s_id, HashMap parameters)
           
 HashMap queryP(String xpath, String documentPath, String s_id, HashMap parameters)
          The method queryP
 HashMap querySummary(int resultId)
          Retrieve a summary of the result set identified by it's result-set-id.
 HashMap querySummary(String xquery)
          execute XPath query and return a summary of hits per document and hits per doctype.
 void reindexCollection(String collectionName)
          The method reindexCollection
 void releaseQueryResult(int handle)
          The method releaseQueryResult
 boolean remove(String documentPath)
          The method remove
 boolean removeCollection(String collectionName)
          The method removeCollection
 boolean removeUser(String name)
          The method removeUser
 byte[] retrieve(int resultId, int num, HashMap parameters)
          Retrieve a single result from the result-set identified by resultId.
 byte[] retrieve(String doc, String id)
          Retrieve a single node from a document.
 byte[] retrieve(String doc, String id, HashMap parameters)
          Retrieve a single node from a document.
 byte[] retrieveAll(int resultId, HashMap parameters)
           
 String retrieveAsString(String documentPath, String s_id, HashMap parameters)
          The method retrieve
 Vector scanIndexTerms(String xpath, String start, String end)
          The method scanIndexTerms
 Vector scanIndexTerms(String collectionName, String start, String end, boolean inclusive)
          The method scanIndexTerms
 boolean setDocType(String documentPath, String doctypename, String publicid, String systemid)
          The method setDocType
 boolean setPermissions(String resource, int permissions)
           
 boolean setPermissions(String resource, String permissions)
           
 boolean setPermissions(String resource, String owner, String ownerGroup, int permissions)
          The method setPermissions
 boolean setPermissions(String resource, String owner, String ownerGroup, String permissions)
          The method setPermissions
 boolean setUser(String name, String passwd, String digestPassword, Vector groups)
           
 boolean setUser(String name, String passwd, String passwdDigest, Vector groups, String home)
          The method setUser
 boolean setUser(String name, Vector groups)
          Added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it
 boolean setUser(String name, Vector groups, String rgroup)
          Added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it
 boolean shutdown()
          Shut down the database immediately.
 boolean shutdown(long delay)
          Shut down the database after the specified delay (in milliseconds).
 boolean storeBinary(byte[] data, String docName, String mimeType, boolean replace)
          Store data as a binary resource.
 boolean storeBinary(byte[] data, String docName, String mimeType, boolean replace, Date created, Date modified)
           
 boolean storeBinary(byte[] data, String documentPath, String mimeType, int overwrite)
          The method storeBinary
 boolean storeBinary(byte[] data, String documentPath, String mimeType, int overwrite, Date created, Date modified)
          The method storeBinary
 HashMap summary(int resultId)
          The method summary
 HashMap summary(String xpath)
          The method summary
 boolean sync()
          The method sync
 void synchronize()
          The method synchronize
 boolean unlockResource(String documentPath)
          The method unlockResource
 String upload(byte[] chunk, int length)
          An alternative to parse() for larger XML documents.
 String upload(byte[] chunk, int length, String fileName, boolean compressed)
          The method upload
 String upload(String file, byte[] chunk, int length)
          An alternative to parse() for larger XML documents.
 String uploadCompressed(byte[] data, int length)
           
 String uploadCompressed(String file, byte[] data, int length)
           
 int xupdate(String collectionName, byte[] xupdate)
          The method xupdate
 int xupdateResource(String resource, byte[] xupdate)
           
 int xupdateResource(String resource, byte[] xupdate, String encoding)
          The method xupdateResource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcConnection

public RpcConnection(XmldbRequestProcessorFactory factory,
                     User user)
Creates a new RpcConnection instance.

Throws:
EXistException - if an error occurs
Method Detail

createCollection

public boolean createCollection(String name)
                         throws EXistException,
                                PermissionDeniedException
Description copied from interface: RpcAPI
Create a new collection on the database.

Specified by:
createCollection in interface RpcAPI
Parameters:
name - the path to the new collection.
Throws:
EXistException
PermissionDeniedException

createCollection

public boolean createCollection(String name,
                                Date created)
                         throws EXistException,
                                PermissionDeniedException
The method createCollection

Specified by:
createCollection in interface RpcAPI
Parameters:
name - a String value
created - a Date value
Throws:
Exception - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs
EXistException

configureCollection

public boolean configureCollection(String collName,
                                   String configuration)
                            throws EXistException,
                                   PermissionDeniedException
The method configureCollection

Specified by:
configureCollection in interface RpcAPI
Parameters:
collName - a String value
configuration - a String value
Throws:
EXistException - if an error occurs
URISyntaxException - if an error occurs
PermissionDeniedException

createId

public String createId(String collName)
                throws EXistException,
                       URISyntaxException
The method createId

Parameters:
collName - a String value
Returns:
a String value
Throws:
EXistException - if an error occurs
URISyntaxException - if an error occurs

printDiagnostics

public String printDiagnostics(String query,
                               HashMap parameters)
                        throws EXistException,
                               PermissionDeniedException
The method printDiagnostics

Specified by:
printDiagnostics in interface RpcAPI
Parameters:
query - a String value
parameters - a HashMap value
Returns:
a String value
Throws:
Exception - if an error occurs
EXistException
PermissionDeniedException

executeQuery

public int executeQuery(byte[] xpath,
                        String encoding,
                        HashMap parameters)
                 throws EXistException,
                        PermissionDeniedException
Description copied from interface: RpcAPI
Execute XPath query and return a reference to the result set. The returned reference may be used later to get a summary of results or retrieve the actual hits.

Specified by:
executeQuery in interface RpcAPI
Parameters:
xpath - Description of the Parameter
encoding - Description of the Parameter
parameters - a HashMap value
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

executeQuery

public int executeQuery(String xpath,
                        HashMap parameters)
                 throws EXistException,
                        PermissionDeniedException
The method executeQuery

Specified by:
executeQuery in interface RpcAPI
Parameters:
xpath - a String value
parameters - a HashMap value
Returns:
an int value
Throws:
Exception - if an error occurs
EXistException
PermissionDeniedException

getCollectionDesc

public HashMap getCollectionDesc(String rootCollection)
                          throws EXistException,
                                 PermissionDeniedException
The method getCollectionDesc

Specified by:
getCollectionDesc in interface RpcAPI
Parameters:
rootCollection - a String value
Returns:
a HashMap value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

describeResource

public HashMap describeResource(String resourceName)
                         throws EXistException,
                                PermissionDeniedException
The method describeResource

Specified by:
describeResource in interface RpcAPI
Parameters:
resourceName - a String value
Returns:
a HashMap value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

describeCollection

public HashMap describeCollection(String rootCollection)
                           throws EXistException,
                                  PermissionDeniedException
The method describeCollection

Specified by:
describeCollection in interface RpcAPI
Parameters:
rootCollection - a String value
Returns:
a HashMap value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

getDocument

public byte[] getDocument(String name,
                          HashMap parametri)
                   throws EXistException,
                          PermissionDeniedException
Description copied from interface: RpcAPI
Retrieve document by name. All optional output parameters are passed as key/value pairs int the hashtable parameters. Valid keys may either be taken from OutputKeys or EXistOutputKeys. For example, the encoding is identified by the value of key OutputKeys.ENCODING.

Specified by:
getDocument in interface RpcAPI
Parameters:
name - the document's name.
parametri - HashMap of parameters.
Returns:
The document value
Throws:
EXistException
PermissionDeniedException

getDocumentAsString

public String getDocumentAsString(String docName,
                                  HashMap parametri)
                           throws EXistException,
                                  PermissionDeniedException
The method getDocument

Specified by:
getDocumentAsString in interface RpcAPI
Parameters:
docName - a String value
parametri - a HashMap value
Returns:
a String value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

getDocumentData

public HashMap getDocumentData(String docName,
                               HashMap parameters)
                        throws EXistException,
                               PermissionDeniedException
The method getDocumentData

Specified by:
getDocumentData in interface RpcAPI
Parameters:
docName - a String value
parameters - a HashMap value
Returns:
a HashMap value
Throws:
Exception - if an error occurs
EXistException
PermissionDeniedException

getNextChunk

public HashMap getNextChunk(String handle,
                            int offset)
                     throws EXistException,
                            PermissionDeniedException
The method getNextChunk

Specified by:
getNextChunk in interface RpcAPI
Parameters:
handle - a String value
offset - an int value
Returns:
a HashMap value
Throws:
Exception - if an error occurs
EXistException
PermissionDeniedException

getBinaryResource

public byte[] getBinaryResource(String name)
                         throws EXistException,
                                PermissionDeniedException,
                                URISyntaxException
The method getBinaryResource

Specified by:
getBinaryResource in interface RpcAPI
Parameters:
name - a String value
Returns:
a byte[] value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

xupdate

public int xupdate(String collectionName,
                   byte[] xupdate)
            throws PermissionDeniedException,
                   EXistException
The method xupdate

Specified by:
xupdate in interface RpcAPI
Parameters:
collectionName - a String value
xupdate - a String value
Returns:
an int value
Throws:
SAXException - if an error occurs
LockException - if an error occurs
PermissionDeniedException - if an error occurs
EXistException - if an error occurs
XPathException - if an error occurs
URISyntaxException - if an error occurs

xupdateResource

public int xupdateResource(String resource,
                           byte[] xupdate,
                           String encoding)
                    throws PermissionDeniedException,
                           EXistException
The method xupdateResource

Specified by:
xupdateResource in interface RpcAPI
Parameters:
resource - a String value
xupdate - a String value
Returns:
an int value
Throws:
SAXException - if an error occurs
LockException - if an error occurs
PermissionDeniedException - if an error occurs
EXistException - if an error occurs
XPathException - if an error occurs
URISyntaxException - if an error occurs

sync

public boolean sync()
The method sync

Specified by:
sync in interface RpcAPI
Returns:
a boolean value

isXACMLEnabled

public boolean isXACMLEnabled()
The method isXACMLEnabled

Specified by:
isXACMLEnabled in interface RpcAPI
Returns:
a boolean value

dataBackup

public boolean dataBackup(String dest)
The method dataBackup

Specified by:
dataBackup in interface RpcAPI
Parameters:
dest - a String value
Returns:
a boolean value

getDocumentListing

public Vector getDocumentListing()
                          throws EXistException
The method getDocumentListing

Specified by:
getDocumentListing in interface RpcAPI
Returns:
a Vector value
Throws:
EXistException - if an error occurs

getDocumentListing

public Vector getDocumentListing(String collName)
                          throws EXistException,
                                 PermissionDeniedException,
                                 URISyntaxException
The method getDocumentListing

Specified by:
getDocumentListing in interface RpcAPI
Parameters:
collName - a String value
Returns:
a Vector value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

getResourceCount

public int getResourceCount(String collectionName)
                     throws EXistException,
                            PermissionDeniedException,
                            URISyntaxException
The method getResourceCount

Specified by:
getResourceCount in interface RpcAPI
Parameters:
collectionName - a String value
Returns:
an int value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

createResourceId

public String createResourceId(String collectionName)
                        throws EXistException,
                               PermissionDeniedException,
                               URISyntaxException
The method createResourceId

Specified by:
createResourceId in interface RpcAPI
Parameters:
collectionName - a String value
Returns:
a String value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

listDocumentPermissions

public HashMap listDocumentPermissions(String name)
                                throws EXistException,
                                       PermissionDeniedException,
                                       URISyntaxException
The method listDocumentPermissions

Specified by:
listDocumentPermissions in interface RpcAPI
Returns:
a HashMap value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

listCollectionPermissions

public HashMap listCollectionPermissions(String name)
                                  throws EXistException,
                                         PermissionDeniedException,
                                         URISyntaxException
The method listCollectionPermissions

Specified by:
listCollectionPermissions in interface RpcAPI
Parameters:
name - a String value
Returns:
a HashMap value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

getHits

public int getHits(int resultId)
            throws EXistException
The method getHits

Specified by:
getHits in interface RpcAPI
Parameters:
resultId - an int value
Returns:
an int value
Throws:
EXistException - if an error occurs

getPermissions

public HashMap getPermissions(String name)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
The method getPermissions

Specified by:
getPermissions in interface RpcAPI
Parameters:
name - a String value
Returns:
a HashMap value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

getCreationDate

public Date getCreationDate(String collectionPath)
                     throws PermissionDeniedException,
                            EXistException,
                            URISyntaxException
The method getCreationDate

Specified by:
getCreationDate in interface RpcAPI
Parameters:
collectionPath - a String value
Returns:
a Date value
Throws:
PermissionDeniedException - if an error occurs
EXistException - if an error occurs
URISyntaxException - if an error occurs

getTimestamps

public Vector getTimestamps(String documentPath)
                     throws PermissionDeniedException,
                            EXistException,
                            URISyntaxException
The method getTimestamps

Specified by:
getTimestamps in interface RpcAPI
Parameters:
documentPath - a String value
Returns:
a Vector value
Throws:
PermissionDeniedException - if an error occurs
EXistException - if an error occurs
URISyntaxException - if an error occurs

getUser

public HashMap getUser(String name)
                throws EXistException,
                       PermissionDeniedException
The method getUser

Specified by:
getUser in interface RpcAPI
Parameters:
name - a String value
Returns:
a HashMap value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs

getUsers

public Vector getUsers()
                throws EXistException,
                       PermissionDeniedException
The method getUsers

Specified by:
getUsers in interface RpcAPI
Returns:
a Vector value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs

getGroups

public Vector getGroups()
                 throws EXistException,
                        PermissionDeniedException
The method getGroups

Specified by:
getGroups in interface RpcAPI
Returns:
a Vector value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs

hasDocument

public boolean hasDocument(String documentPath)
                    throws URISyntaxException,
                           EXistException,
                           PermissionDeniedException
The method hasDocument

Specified by:
hasDocument in interface RpcAPI
Parameters:
documentPath - a String value
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

hasCollection

public boolean hasCollection(String collectionName)
                      throws EXistException,
                             URISyntaxException
The method hasCollection

Specified by:
hasCollection in interface RpcAPI
Parameters:
collectionName - a String value
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException - Description of the Exception

parse

public boolean parse(byte[] xml,
                     String documentPath,
                     int overwrite)
              throws URISyntaxException,
                     EXistException,
                     PermissionDeniedException
The method parse

Specified by:
parse in interface RpcAPI
Parameters:
xml - a byte value
documentPath - a String value
overwrite - Overwrite an existing document with the same path?
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

parse

public boolean parse(byte[] xml,
                     String documentPath,
                     int overwrite,
                     Date created,
                     Date modified)
              throws URISyntaxException,
                     EXistException,
                     PermissionDeniedException
The method parse

Specified by:
parse in interface RpcAPI
Parameters:
xml - a byte value
documentPath - a String value
created - a Date value
modified - a Date value
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

parseLocal

public boolean parseLocal(String localFile,
                          String documentPath,
                          int overwrite,
                          String mimeType)
                   throws Exception,
                          URISyntaxException
Parse a file previously uploaded with upload. The temporary file will be removed.

Parameters:
localFile -
Throws:
EXistException
IOException
Exception
URISyntaxException

parseLocal

public boolean parseLocal(String localFile,
                          String documentPath,
                          int overwrite,
                          String mimeType,
                          Date created,
                          Date modified)
                   throws URISyntaxException,
                          EXistException,
                          PermissionDeniedException
The method parseLocal

Parameters:
localFile - a String value
documentPath - a String value
mimeType - a String value
created - a Date value
modified - a Date value
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

storeBinary

public boolean storeBinary(byte[] data,
                           String documentPath,
                           String mimeType,
                           int overwrite)
                    throws Exception,
                           URISyntaxException
The method storeBinary

Parameters:
data - a byte value
documentPath - a String value
mimeType - a String value
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs

storeBinary

public boolean storeBinary(byte[] data,
                           String documentPath,
                           String mimeType,
                           int overwrite,
                           Date created,
                           Date modified)
                    throws URISyntaxException,
                           EXistException,
                           PermissionDeniedException
The method storeBinary

Parameters:
data - a byte value
documentPath - a String value
mimeType - a String value
created - a Date value
modified - a Date value
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

upload

public String upload(byte[] chunk,
                     int length,
                     String fileName,
                     boolean compressed)
              throws EXistException,
                     IOException
The method upload

Parameters:
chunk - a byte value
length - an int value
fileName - a String value
compressed - a boolean value
Returns:
a String value
Throws:
EXistException - if an error occurs
IOException - if an error occurs

compile

public HashMap compile(String query,
                       HashMap parameters)
                throws EXistException,
                       PermissionDeniedException
The method compile

Parameters:
query - a String value
parameters - a HashMap value
Returns:
a HashMap value
Throws:
Exception - if an error occurs
EXistException
PermissionDeniedException

query

public String query(String xpath,
                    int howmany,
                    int start,
                    HashMap parameters)
             throws EXistException,
                    PermissionDeniedException
The method query

Parameters:
xpath - a String value
howmany - an int value
start - an int value
parameters - a HashMap value
Returns:
a String value
Throws:
Exception - if an error occurs
EXistException
PermissionDeniedException

queryP

public HashMap queryP(String xpath,
                      String documentPath,
                      String s_id,
                      HashMap parameters)
               throws URISyntaxException,
                      EXistException,
                      PermissionDeniedException
The method queryP

Parameters:
xpath - a String value
documentPath - a String value
s_id - a String value
parameters - a HashMap value
Returns:
a HashMap value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

execute

public HashMap execute(String xpath,
                       HashMap parameters)
                throws EXistException,
                       PermissionDeniedException
The method execute

Specified by:
execute in interface RpcAPI
Parameters:
xpath - a String value
parameters - a HashMap value
Returns:
a HashMap value
Throws:
Exception - if an error occurs
EXistException
PermissionDeniedException

releaseQueryResult

public void releaseQueryResult(int handle)
The method releaseQueryResult

Specified by:
releaseQueryResult in interface RpcAPI
Parameters:
handle - an int value

remove

public boolean remove(String documentPath)
               throws URISyntaxException,
                      EXistException,
                      PermissionDeniedException
The method remove

Specified by:
remove in interface RpcAPI
Parameters:
documentPath - a String value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

removeCollection

public boolean removeCollection(String collectionName)
                         throws URISyntaxException,
                                EXistException,
                                PermissionDeniedException
The method removeCollection

Specified by:
removeCollection in interface RpcAPI
Parameters:
collectionName - a String value
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

removeUser

public boolean removeUser(String name)
                   throws EXistException,
                          PermissionDeniedException
The method removeUser

Specified by:
removeUser in interface RpcAPI
Parameters:
name - a String value
Returns:
a boolean value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs

retrieve

public byte[] retrieve(String doc,
                       String id,
                       HashMap parameters)
                throws EXistException,
                       PermissionDeniedException
Description copied from interface: RpcAPI
Retrieve a single node from a document. The node is identified by it's internal id.

Specified by:
retrieve in interface RpcAPI
Parameters:
doc - the document containing the node
id - the node's internal id
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

retrieveAsString

public String retrieveAsString(String documentPath,
                               String s_id,
                               HashMap parameters)
                        throws URISyntaxException,
                               EXistException,
                               PermissionDeniedException
The method retrieve

Specified by:
retrieveAsString in interface RpcAPI
Parameters:
documentPath - a String value
s_id - a String value
parameters - a HashMap value
Returns:
a String value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

retrieve

public byte[] retrieve(int resultId,
                       int num,
                       HashMap parameters)
                throws EXistException,
                       PermissionDeniedException
Description copied from interface: RpcAPI
Retrieve a single result from the result-set identified by resultId. The XML fragment at position num in the result set is returned.

Specified by:
retrieve in interface RpcAPI
Parameters:
resultId - Description of the Parameter
num - Description of the Parameter
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

retrieveAll

public byte[] retrieveAll(int resultId,
                          HashMap parameters)
                   throws EXistException,
                          PermissionDeniedException
Specified by:
retrieveAll in interface RpcAPI
Throws:
EXistException
PermissionDeniedException

setPermissions

public boolean setPermissions(String resource,
                              String owner,
                              String ownerGroup,
                              String permissions)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
The method setPermissions

Specified by:
setPermissions in interface RpcAPI
Parameters:
resource - a String value
owner - a String value
ownerGroup - a String value
permissions - a String value
Returns:
a boolean value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

setPermissions

public boolean setPermissions(String resource,
                              String owner,
                              String ownerGroup,
                              int permissions)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
The method setPermissions

Specified by:
setPermissions in interface RpcAPI
Parameters:
resource - a String value
owner - a String value
ownerGroup - a String value
permissions - an int value
Returns:
a boolean value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

setUser

public boolean setUser(String name,
                       String passwd,
                       String passwdDigest,
                       Vector groups,
                       String home)
                throws EXistException,
                       PermissionDeniedException
The method setUser

Specified by:
setUser in interface RpcAPI
Parameters:
name - a String value
passwd - a String value
passwdDigest - a String value
groups - a Vector value
home - a String value
Returns:
a boolean value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs

setUser

public boolean setUser(String name,
                       Vector groups)
                throws EXistException,
                       PermissionDeniedException
Added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it

Throws:
EXistException
PermissionDeniedException

setUser

public boolean setUser(String name,
                       Vector groups,
                       String rgroup)
                throws EXistException,
                       PermissionDeniedException
Added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it

Throws:
EXistException
PermissionDeniedException

lockResource

public boolean lockResource(String documentPath,
                            String userName)
                     throws EXistException,
                            PermissionDeniedException,
                            URISyntaxException
The method lockResource

Specified by:
lockResource in interface RpcAPI
Parameters:
documentPath - a String value
userName - a String value
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

hasUserLock

public String hasUserLock(String documentPath)
                   throws URISyntaxException,
                          EXistException,
                          PermissionDeniedException
The method hasUserLock

Specified by:
hasUserLock in interface RpcAPI
Parameters:
documentPath - a String value
Returns:
a String value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

unlockResource

public boolean unlockResource(String documentPath)
                       throws URISyntaxException,
                              EXistException,
                              PermissionDeniedException
The method unlockResource

Specified by:
unlockResource in interface RpcAPI
Parameters:
documentPath - a String value
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

summary

public HashMap summary(String xpath)
                throws EXistException,
                       PermissionDeniedException
The method summary

Parameters:
xpath - a String value
Returns:
a HashMap value
Throws:
Exception - if an error occurs
EXistException
PermissionDeniedException

summary

public HashMap summary(int resultId)
                throws EXistException,
                       XPathException
The method summary

Parameters:
resultId - an int value
Returns:
a HashMap value
Throws:
EXistException - if an error occurs
XPathException - if an error occurs

getIndexedElements

public Vector getIndexedElements(String collectionName,
                                 boolean inclusive)
                          throws EXistException,
                                 PermissionDeniedException,
                                 URISyntaxException
The method getIndexedElements

Specified by:
getIndexedElements in interface RpcAPI
Parameters:
collectionName - a String value
inclusive - a boolean value
Returns:
a Vector value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

scanIndexTerms

public Vector scanIndexTerms(String collectionName,
                             String start,
                             String end,
                             boolean inclusive)
                      throws PermissionDeniedException,
                             EXistException,
                             URISyntaxException
The method scanIndexTerms

Specified by:
scanIndexTerms in interface RpcAPI
Parameters:
collectionName - a String value
start - a String value
end - a String value
inclusive - a boolean value
Returns:
a Vector value
Throws:
PermissionDeniedException - if an error occurs
EXistException - if an error occurs
URISyntaxException - if an error occurs

scanIndexTerms

public Vector scanIndexTerms(String xpath,
                             String start,
                             String end)
                      throws PermissionDeniedException,
                             EXistException,
                             XPathException
The method scanIndexTerms

Specified by:
scanIndexTerms in interface RpcAPI
Parameters:
xpath - a String value
start - a String value
end - a String value
Returns:
a Vector value
Throws:
PermissionDeniedException - if an error occurs
EXistException - if an error occurs
XPathException - if an error occurs

synchronize

public void synchronize()
The method synchronize


getDocumentChunk

public byte[] getDocumentChunk(String name,
                               int start,
                               int len)
                        throws EXistException,
                               PermissionDeniedException,
                               IOException
Specified by:
getDocumentChunk in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
IOException

moveOrCopyResource

public boolean moveOrCopyResource(String documentPath,
                                  String destinationPath,
                                  String newName,
                                  boolean move)
                           throws EXistException,
                                  PermissionDeniedException,
                                  URISyntaxException
The method moveOrCopyResource

Parameters:
documentPath - a String value
destinationPath - a String value
newName - a String value
move - a boolean value
Returns:
a boolean value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

moveOrCopyCollection

public boolean moveOrCopyCollection(String collectionName,
                                    String destinationPath,
                                    String newName,
                                    boolean move)
                             throws EXistException,
                                    PermissionDeniedException,
                                    URISyntaxException
The method moveOrCopyCollection

Parameters:
collectionName - a String value
destinationPath - a String value
newName - a String value
move - a boolean value
Returns:
a boolean value
Throws:
EXistException - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs

reindexCollection

public void reindexCollection(String collectionName)
                       throws URISyntaxException,
                              EXistException,
                              PermissionDeniedException
The method reindexCollection

Specified by:
reindexCollection in interface RpcAPI
Parameters:
collectionName - a String value
Throws:
Exception - if an error occurs
PermissionDeniedException - if an error occurs
URISyntaxException - if an error occurs
EXistException

backup

public void backup(String userbackup,
                   String password,
                   String destcollection,
                   String collection)
            throws EXistException,
                   PermissionDeniedException
The method backup

Specified by:
backup in interface RpcAPI
Parameters:
userbackup - a String value
password - a String value
destcollection - a String value
collection - a String value
Throws:
Exception - if an error occurs
PermissionDeniedException - if an error occurs
EXistException

isValid

public boolean isValid(String documentPath)
                throws PermissionDeniedException,
                       URISyntaxException,
                       EXistException
Validate if specified document is Valid.

Specified by:
isValid in interface RpcAPI
Parameters:
documentPath - Path to XML document in database
Returns:
TRUE if document is valid, FALSE if not or errors or.....
Throws:
Exception - Generic exception
PermissionDeniedException - User is not allowed to perform action.
URISyntaxException
EXistException

getDocType

public Vector getDocType(String documentPath)
                  throws PermissionDeniedException,
                         EXistException,
                         URISyntaxException
The method getDocType

Specified by:
getDocType in interface RpcAPI
Parameters:
documentPath - a String value
Returns:
a Vector value
Throws:
PermissionDeniedException - if an error occurs
EXistException - if an error occurs
URISyntaxException - if an error occurs

setDocType

public boolean setDocType(String documentPath,
                          String doctypename,
                          String publicid,
                          String systemid)
                   throws URISyntaxException,
                          EXistException,
                          PermissionDeniedException
The method setDocType

Specified by:
setDocType in interface RpcAPI
Parameters:
documentPath - a String value
doctypename - a String value
publicid - a String value
systemid - a String value
Returns:
a boolean value
Throws:
Exception - if an error occurs
URISyntaxException - if an error occurs
EXistException
PermissionDeniedException

copyResource

public boolean copyResource(String docPath,
                            String destinationPath,
                            String newName)
                     throws EXistException,
                            PermissionDeniedException,
                            URISyntaxException
Specified by:
copyResource in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
URISyntaxException

copyCollection

public boolean copyCollection(String collectionPath,
                              String destinationPath,
                              String newName)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Specified by:
copyCollection in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
URISyntaxException

moveResource

public boolean moveResource(String docPath,
                            String destinationPath,
                            String newName)
                     throws EXistException,
                            PermissionDeniedException,
                            URISyntaxException
Specified by:
moveResource in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
URISyntaxException

moveCollection

public boolean moveCollection(String collectionPath,
                              String destinationPath,
                              String newName)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Specified by:
moveCollection in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
URISyntaxException

getDocumentChunk

public List getDocumentChunk(String name,
                             HashMap parameters)
                      throws EXistException,
                             PermissionDeniedException,
                             IOException
Specified by:
getDocumentChunk in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
IOException

copyCollection

public boolean copyCollection(String name,
                              String namedest)
                       throws PermissionDeniedException,
                              EXistException
Specified by:
copyCollection in interface RpcAPI
Throws:
PermissionDeniedException
EXistException

xupdateResource

public int xupdateResource(String resource,
                           byte[] xupdate)
                    throws PermissionDeniedException,
                           EXistException,
                           SAXException
Specified by:
xupdateResource in interface RpcAPI
Throws:
PermissionDeniedException
EXistException
SAXException

setPermissions

public boolean setPermissions(String resource,
                              int permissions)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Specified by:
setPermissions in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
URISyntaxException

setPermissions

public boolean setPermissions(String resource,
                              String permissions)
                       throws EXistException,
                              PermissionDeniedException,
                              URISyntaxException
Specified by:
setPermissions in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
URISyntaxException

setUser

public boolean setUser(String name,
                       String passwd,
                       String digestPassword,
                       Vector groups)
                throws EXistException,
                       PermissionDeniedException
Specified by:
setUser in interface RpcAPI
Throws:
EXistException
PermissionDeniedException

querySummary

public HashMap querySummary(int resultId)
                     throws EXistException,
                            PermissionDeniedException,
                            XPathException
Description copied from interface: RpcAPI
Retrieve a summary of the result set identified by it's result-set-id. This method returns a struct with the following fields: "queryTime" int "hits" int "documents" array of array: Object[][3] "doctypes" array of array: Object[][2] Documents and doctypes represent tables where each row describes one document or doctype for which hits were found. Each document entry has the following structure: docId (int), docName (string), hits (int) The doctype entry has this structure: doctypeName (string), hits (int)

Specified by:
querySummary in interface RpcAPI
Parameters:
resultId - Description of the Parameter
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception
XPathException

executeQuery

public int executeQuery(byte[] xpath,
                        HashMap parameters)
                 throws EXistException,
                        PermissionDeniedException
Specified by:
executeQuery in interface RpcAPI
Throws:
EXistException
PermissionDeniedException

storeBinary

public boolean storeBinary(byte[] data,
                           String docName,
                           String mimeType,
                           boolean replace,
                           Date created,
                           Date modified)
                    throws EXistException,
                           PermissionDeniedException,
                           URISyntaxException
Specified by:
storeBinary in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
URISyntaxException

storeBinary

public boolean storeBinary(byte[] data,
                           String docName,
                           String mimeType,
                           boolean replace)
                    throws EXistException,
                           PermissionDeniedException,
                           URISyntaxException
Description copied from interface: RpcAPI
Store data as a binary resource.

Specified by:
storeBinary in interface RpcAPI
Parameters:
data - the data to be stored
docName - the path to the new document
replace - if true, an old document with the same path will be overwritten
Throws:
EXistException
PermissionDeniedException
URISyntaxException

parseLocal

public boolean parseLocal(String localFile,
                          String docName,
                          boolean replace,
                          String mimeType,
                          Date created,
                          Date modified)
                   throws EXistException,
                          PermissionDeniedException,
                          SAXException,
                          URISyntaxException
Specified by:
parseLocal in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
SAXException
URISyntaxException

parseLocal

public boolean parseLocal(String localFile,
                          String docName,
                          boolean replace,
                          String mimeType)
                   throws EXistException,
                          PermissionDeniedException,
                          SAXException,
                          URISyntaxException
Description copied from interface: RpcAPI
Parse a file previously uploaded with upload. The temporary file will be removed.

Specified by:
parseLocal in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
SAXException
URISyntaxException

uploadCompressed

public String uploadCompressed(String file,
                               byte[] data,
                               int length)
                        throws EXistException,
                               PermissionDeniedException,
                               IOException
Specified by:
uploadCompressed in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
IOException

uploadCompressed

public String uploadCompressed(byte[] data,
                               int length)
                        throws EXistException,
                               PermissionDeniedException,
                               IOException
Specified by:
uploadCompressed in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
IOException

upload

public String upload(String file,
                     byte[] chunk,
                     int length)
              throws EXistException,
                     PermissionDeniedException,
                     IOException
Description copied from interface: RpcAPI
An alternative to parse() for larger XML documents. The document is first uploaded chunk by chunk using upload(), then parseLocal() is called to actually store the uploaded file.

Specified by:
upload in interface RpcAPI
Parameters:
file - the name of the file to which the chunk will be appended. This should be the file name returned by the first call to upload.
chunk - the current chunk
length - total length of the file
Returns:
the name of the file to which the chunk has been appended.
Throws:
EXistException
PermissionDeniedException
IOException

upload

public String upload(byte[] chunk,
                     int length)
              throws EXistException,
                     PermissionDeniedException,
                     IOException
Description copied from interface: RpcAPI
An alternative to parse() for larger XML documents. The document is first uploaded chunk by chunk using upload(), then parseLocal() is called to actually store the uploaded file.

Specified by:
upload in interface RpcAPI
Parameters:
chunk - the current chunk
length - total length of the file
Returns:
the name of the file to which the chunk has been appended.
Throws:
EXistException
PermissionDeniedException
IOException

parse

public boolean parse(String xml,
                     String docName)
              throws EXistException,
                     PermissionDeniedException,
                     URISyntaxException
Specified by:
parse in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
URISyntaxException

parse

public boolean parse(String xml,
                     String docName,
                     int overwrite)
              throws EXistException,
                     PermissionDeniedException,
                     URISyntaxException
Specified by:
parse in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
URISyntaxException

parse

public boolean parse(byte[] xmlData,
                     String docName)
              throws EXistException,
                     PermissionDeniedException,
                     URISyntaxException
Description copied from interface: RpcAPI
Parse an XML document and store it into the database. The document will later be identified by docName. Some xmlrpc clients seem to have problems with character encodings when sending xml content. To avoid this, parse() accepts the xml document content as byte[]. If overwrite is >0, an existing document with the same name will be replaced by the new document.

Specified by:
parse in interface RpcAPI
Parameters:
xmlData - The document data
docName - The path where the document will be stored
Throws:
EXistException
PermissionDeniedException
URISyntaxException

querySummary

public HashMap querySummary(String xquery)
                     throws EXistException,
                            PermissionDeniedException
Description copied from interface: RpcAPI
execute XPath query and return a summary of hits per document and hits per doctype. This method returns a struct with the following fields:
"queryTime" int
"hits" int
"documents" array of array: Object[][3]
"doctypes" array of array: Object[][2]
Documents and doctypes represent tables where each row describes one document or doctype for which hits were found. Each document entry has the following structure: docId (int), docName (string), hits (int) The doctype entry has this structure: doctypeName (string), hits (int)

Specified by:
querySummary in interface RpcAPI
Parameters:
xquery - Description of the Parameter
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

query

public byte[] query(byte[] xquery,
                    int howmany,
                    int start,
                    HashMap parameters)
             throws EXistException,
                    PermissionDeniedException
Description copied from interface: RpcAPI
execute XPath query and return howmany nodes from the result set, starting at position start. If prettyPrint is set to >0 (true), results are pretty printed.

Specified by:
query in interface RpcAPI
howmany - maximum number of results to return.
start - item in the result set to start with.
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

queryP

public HashMap queryP(byte[] xpath,
                      String docName,
                      String s_id,
                      HashMap parameters)
               throws EXistException,
                      PermissionDeniedException,
                      URISyntaxException
Specified by:
queryP in interface RpcAPI
Throws:
EXistException
PermissionDeniedException
URISyntaxException

queryP

public HashMap queryP(byte[] xpath,
                      HashMap parameters)
               throws EXistException,
                      PermissionDeniedException
Specified by:
queryP in interface RpcAPI
Throws:
EXistException
PermissionDeniedException

compile

public HashMap compile(byte[] xquery,
                       HashMap parameters)
                throws EXistException,
                       PermissionDeniedException
Specified by:
compile in interface RpcAPI
Throws:
EXistException
PermissionDeniedException

retrieve

public byte[] retrieve(String doc,
                       String id)
                throws EXistException,
                       PermissionDeniedException
Description copied from interface: RpcAPI
Retrieve a single node from a document. The node is identified by it's internal id.

Specified by:
retrieve in interface RpcAPI
Parameters:
doc - the document containing the node
id - the node's internal id
Returns:
Description of the Return Value
Throws:
EXistException - Description of the Exception
PermissionDeniedException - Description of the Exception

getDocumentAsString

public String getDocumentAsString(String name,
                                  int prettyPrint,
                                  String stylesheet)
                           throws EXistException,
                                  PermissionDeniedException
Specified by:
getDocumentAsString in interface RpcAPI
Throws:
EXistException
PermissionDeniedException

getDocumentAsString

public String getDocumentAsString(String name,
                                  int prettyPrint)
                           throws EXistException,
                                  PermissionDeniedException
Specified by:
getDocumentAsString in interface RpcAPI
Throws:
EXistException
PermissionDeniedException

getDocument

public byte[] getDocument(String name,
                          String encoding,
                          int prettyPrint,
                          String stylesheet)
                   throws EXistException,
                          PermissionDeniedException
Description copied from interface: RpcAPI
Retrieve document by name. XML content is indented if prettyPrint is set to >=0. Use supplied encoding for output and apply the specified stylesheet. This method is provided to retrieve a document with encodings other than UTF-8. Since the data is handled as binary data, character encodings are preserved. byte[]-values are automatically BASE64-encoded by the XMLRPC library.

Specified by:
getDocument in interface RpcAPI
Parameters:
name - the document's name.
encoding - character encoding to use.
prettyPrint - pretty print XML if >0.
Returns:
The document value
Throws:
EXistException
PermissionDeniedException

getDocument

public byte[] getDocument(String name,
                          String encoding,
                          int prettyPrint)
                   throws EXistException,
                          PermissionDeniedException
Description copied from interface: RpcAPI
Retrieve document by name. XML content is indented if prettyPrint is set to >=0. Use supplied encoding for output. This method is provided to retrieve a document with encodings other than UTF-8. Since the data is handled as binary data, character encodings are preserved. byte[]-values are automatically BASE64-encoded by the XMLRPC library.

Specified by:
getDocument in interface RpcAPI
Parameters:
name - the document's name.
encoding - character encoding to use.
prettyPrint - pretty print XML if >0.
Returns:
Document data as binary array.
Throws:
EXistException
PermissionDeniedException

shutdown

public boolean shutdown()
                 throws PermissionDeniedException
Description copied from interface: RpcAPI
Shut down the database immediately.

Specified by:
shutdown in interface RpcAPI
Returns:
true if the shutdown succeeded, false otherwise
Throws:
PermissionDeniedException

shutdown

public boolean shutdown(long delay)
                 throws PermissionDeniedException
Description copied from interface: RpcAPI
Shut down the database after the specified delay (in milliseconds).

Specified by:
shutdown in interface RpcAPI
Returns:
true if the shutdown succeeded, false otherwise
Throws:
PermissionDeniedException

enterServiceMode

public boolean enterServiceMode()
                         throws PermissionDeniedException,
                                EXistException
Throws:
PermissionDeniedException
EXistException

exitServiceMode

public void exitServiceMode()
                     throws PermissionDeniedException,
                            EXistException
Throws:
PermissionDeniedException
EXistException


Copyright (C) Wolfgang Meier. All rights reserved.