org.xmlecho.palomar.xfs
Interface XfsRepository


public interface XfsRepository

SIXLE's content repository


Field Summary
static java.lang.String FILE_TYPE_BINARY
           
static java.lang.String FILE_TYPE_TEXT
           
static java.lang.String FILE_TYPE_XML
           
 
Method Summary
 void addLock(Transaction xact, ItemLock newLock, User user)
          commits the (tentative) lock
 boolean canAccessCheckedoutItem(RepositoryItem item, User user)
          return true if the checked out item can be accessed by a user
 boolean canAccessLock(User user, ItemLock lock)
          returns true if the user can have access to resource lock
 void deleteAllExpiredLocks()
          delete all expired locks from the ItemLocks table
 void deleteLock(Transaction xact, ItemLock lock, User user)
          deletes a lock
 void deleteRepositoryItem(Transaction xact, User user, java.lang.String recurse, RepositoryItem item)
          deletes the given item on behalf of the given user as part of a larger transaction.
 void doBranchIndex(java.lang.String mimeType, java.lang.String path, int skip, int count, boolean renew)
          indexes docs of a given mime type in a given section of the repository
 java.lang.String getBaseXfsDir()
          get the repository base path on the file system
 java.util.Iterator getBranchWalker(java.lang.String path, java.lang.String mimeType)
          returns an interator over the items in a given branch with a given mimetype
 CherryPicker getCherryPicker(User user)
          gets an object for picking a set of branches on behalf of the given user from a collection of XML documents in the repository
 ItemLock[] getCollectionLocks(Transaction xact)
           
 ItemLock getItemLock(Transaction xact, RepositoryItem item)
          return first lock on the given item
 ItemLock[] getItemLocks(Transaction xact, RepositoryItem item)
          return all the locks on the given item
 java.util.Hashtable getNullResourceLocks()
           
 RepositoryItem getOrCreateFolder(Transaction xact, User user, java.lang.String path)
          gets the named folder on behalf of the given user for updating, create the folder if it doesn't exist
 RepositoryItem getRepositoryItem(Transaction xact, User user, java.lang.String itemID)
          returns the identified item, writeable under the given transaction
 RepositoryItem getRepositoryItem(User user, java.lang.String itemID)
          gets the identified item on behalf of the given user
 RepositoryItem getRepositoryItemByPath(Transaction xact, User user, java.lang.String path)
          gets the named item on behalf of the given user for updating
 RepositoryItem getRepositoryItemByPath(User user, java.lang.String path)
          gets the named item on behalf of the given user
 ItemLock[] getResourceLocks()
           
 boolean isItemCheckedout(RepositoryItem item, User user)
          return true if item is already checked out
 boolean isItemLocked(RepositoryItem item, java.lang.String ifHeader, User user)
          Check to see if a resource is currently write locked.
 boolean isReadOnly()
          gets the read-only status of the repository
 void listDeletedRepositoryItems(User user, org.xml.sax.ContentHandler dest)
          retrieves the list of repository items and writes it to the given content handler
 void loadJar(java.io.InputStream jarStream, User user, java.lang.String basePath)
          gets the files identified by paths to a jarfile, on behalf of the given user
 ItemLock newLock(java.lang.String path)
          create a new (tentative) lock on an item in the repository
 void purgeItemAndVersions(Transaction xact, User user, java.lang.String recurse, RepositoryItem item)
          permanantly deletes the given item and its versions.
 void purgeItemVersions(Transaction xact, User user, int keepRecent, java.lang.String recurse, RepositoryItem item)
          permanently delete the versions of an item excluding the latest version and also excluding few of the recent versions
 void purgeRepositoryItem(Transaction xact, User user, java.lang.String recurse, RepositoryItem item)
          permanantly deletes the given item.
 void restoreRepositoryItem(Transaction xact, User user, java.lang.String recurse, RepositoryItem item)
          restore the given item
 void setReadOnly(boolean readOnlyStatus)
          sets the read-only status of the repository
 Transaction startTransaction()
          return a new object for managing commit/rollback on some set of actions on the repository
 void updateLock(Transaction xact, ItemLock lock, User user)
          updates a lock
 void writeJar(java.io.OutputStream jarStream, User user, java.lang.String[] paths, java.lang.String basePath)
          gets the files identified by paths to a jarfile, on behalf of the given user
 

Field Detail

FILE_TYPE_TEXT

public static final java.lang.String FILE_TYPE_TEXT
See Also:
Constant Field Values

FILE_TYPE_BINARY

public static final java.lang.String FILE_TYPE_BINARY
See Also:
Constant Field Values

FILE_TYPE_XML

public static final java.lang.String FILE_TYPE_XML
See Also:
Constant Field Values
Method Detail

setReadOnly

public void setReadOnly(boolean readOnlyStatus)
sets the read-only status of the repository


isReadOnly

public boolean isReadOnly()
gets the read-only status of the repository


listDeletedRepositoryItems

public void listDeletedRepositoryItems(User user,
                                       org.xml.sax.ContentHandler dest)
                                throws XfsException
retrieves the list of repository items and writes it to the given content handler

Throws:
XfsException

getRepositoryItem

public RepositoryItem getRepositoryItem(User user,
                                        java.lang.String itemID)
                                 throws XfsException
gets the identified item on behalf of the given user

Throws:
XfsException

getRepositoryItem

public RepositoryItem getRepositoryItem(Transaction xact,
                                        User user,
                                        java.lang.String itemID)
                                 throws XfsException
returns the identified item, writeable under the given transaction

Throws:
XfsException

getRepositoryItemByPath

public RepositoryItem getRepositoryItemByPath(User user,
                                              java.lang.String path)
                                       throws XfsException
gets the named item on behalf of the given user

Throws:
XfsException

getOrCreateFolder

public RepositoryItem getOrCreateFolder(Transaction xact,
                                        User user,
                                        java.lang.String path)
                                 throws XfsException
gets the named folder on behalf of the given user for updating, create the folder if it doesn't exist

Throws:
XfsException

getRepositoryItemByPath

public RepositoryItem getRepositoryItemByPath(Transaction xact,
                                              User user,
                                              java.lang.String path)
                                       throws XfsException
gets the named item on behalf of the given user for updating

Throws:
XfsException

getCherryPicker

public CherryPicker getCherryPicker(User user)
                             throws XfsException
gets an object for picking a set of branches on behalf of the given user from a collection of XML documents in the repository

Throws:
XfsException

writeJar

public void writeJar(java.io.OutputStream jarStream,
                     User user,
                     java.lang.String[] paths,
                     java.lang.String basePath)
              throws XfsException
gets the files identified by paths to a jarfile, on behalf of the given user

Throws:
XfsException

loadJar

public void loadJar(java.io.InputStream jarStream,
                    User user,
                    java.lang.String basePath)
             throws XfsException
gets the files identified by paths to a jarfile, on behalf of the given user

Throws:
XfsException

deleteRepositoryItem

public void deleteRepositoryItem(Transaction xact,
                                 User user,
                                 java.lang.String recurse,
                                 RepositoryItem item)
                          throws XfsException
deletes the given item on behalf of the given user as part of a larger transaction. May simply mark the item as no longer active, allowing later recovery of that item

Throws:
XfsException

purgeRepositoryItem

public void purgeRepositoryItem(Transaction xact,
                                User user,
                                java.lang.String recurse,
                                RepositoryItem item)
                         throws XfsException
permanantly deletes the given item.

Throws:
XfsException

purgeItemAndVersions

public void purgeItemAndVersions(Transaction xact,
                                 User user,
                                 java.lang.String recurse,
                                 RepositoryItem item)
                          throws XfsException
permanantly deletes the given item and its versions.

Throws:
XfsException

purgeItemVersions

public void purgeItemVersions(Transaction xact,
                              User user,
                              int keepRecent,
                              java.lang.String recurse,
                              RepositoryItem item)
                       throws XfsException
permanently delete the versions of an item excluding the latest version and also excluding few of the recent versions

Parameters:
keepRecent - excludes number of recent versions as specified in this argument, from deletion.
Throws:
XfsException

restoreRepositoryItem

public void restoreRepositoryItem(Transaction xact,
                                  User user,
                                  java.lang.String recurse,
                                  RepositoryItem item)
                           throws XfsException
restore the given item

Throws:
XfsException

newLock

public ItemLock newLock(java.lang.String path)
create a new (tentative) lock on an item in the repository


addLock

public void addLock(Transaction xact,
                    ItemLock newLock,
                    User user)
             throws XfsException
commits the (tentative) lock

Throws:
XfsException

deleteLock

public void deleteLock(Transaction xact,
                       ItemLock lock,
                       User user)
                throws XfsException
deletes a lock

Throws:
XfsException

updateLock

public void updateLock(Transaction xact,
                       ItemLock lock,
                       User user)
                throws XfsException
updates a lock

Throws:
XfsException

getItemLocks

public ItemLock[] getItemLocks(Transaction xact,
                               RepositoryItem item)
                        throws XfsException
return all the locks on the given item

Throws:
XfsException

getItemLock

public ItemLock getItemLock(Transaction xact,
                            RepositoryItem item)
                     throws XfsException
return first lock on the given item

Throws:
XfsException

getResourceLocks

public ItemLock[] getResourceLocks()

getNullResourceLocks

public java.util.Hashtable getNullResourceLocks()

getCollectionLocks

public ItemLock[] getCollectionLocks(Transaction xact)

canAccessLock

public boolean canAccessLock(User user,
                             ItemLock lock)
returns true if the user can have access to resource lock


isItemLocked

public boolean isItemLocked(RepositoryItem item,
                            java.lang.String ifHeader,
                            User user)
Check to see if a resource is currently write locked.

Parameters:
item - the RepositoryItem under consideration
ifHeader - "If" HTTP header which was included in the request
user - User on whose behalf we're checking
Returns:
boolean true if the resource is locked (and no appropriate lock token has been found for at least one of the non-shared locks which are present on the resource).

isItemCheckedout

public boolean isItemCheckedout(RepositoryItem item,
                                User user)
return true if item is already checked out


canAccessCheckedoutItem

public boolean canAccessCheckedoutItem(RepositoryItem item,
                                       User user)
return true if the checked out item can be accessed by a user

Parameters:
item - checked out version of an repository item
user - User to test

deleteAllExpiredLocks

public void deleteAllExpiredLocks()
delete all expired locks from the ItemLocks table


getBaseXfsDir

public java.lang.String getBaseXfsDir()
get the repository base path on the file system


getBranchWalker

public java.util.Iterator getBranchWalker(java.lang.String path,
                                          java.lang.String mimeType)
                                   throws XfsException
returns an interator over the items in a given branch with a given mimetype

Throws:
XfsException

doBranchIndex

public void doBranchIndex(java.lang.String mimeType,
                          java.lang.String path,
                          int skip,
                          int count,
                          boolean renew)
                   throws XfsException
indexes docs of a given mime type in a given section of the repository

Throws:
XfsException

startTransaction

public Transaction startTransaction()
                             throws XfsException
return a new object for managing commit/rollback on some set of actions on the repository

Throws:
XfsException