org.apache.cocoon.components.repository.impl
Class WebDAVRepositoryTransactionHelper

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.components.repository.impl.WebDAVRepositoryTransactionHelper
All Implemented Interfaces:
Disposable, Component, LogEnabled, Serviceable, RepositoryTransactionHelper

public class WebDAVRepositoryTransactionHelper
extends AbstractLogEnabled
implements RepositoryTransactionHelper, Serviceable, Disposable, Component

A transaction an locking helper class intended to be used by flowscripts or corresponding wrapper components.


Constructor Summary
WebDAVRepositoryTransactionHelper(CredentialsToken credentials, WebDAVRepository repo)
          create a WebDAVRepositoryTransactionHelper
 
Method Summary
 boolean beginTran()
          beginning a transaction on the repository
 boolean commitTran()
          committing a transaction on the repository
 void dispose()
           
 boolean lock(String uri)
          lock the resource
 boolean lock(String uri, int timeout)
          lock the resource with explicit timeout in seconds
 boolean rollbackTran()
          rolling back a transaction on the repository
 void service(ServiceManager manager)
           
 boolean supportsLocking()
          checking wether the repository supports locking
 boolean supportsTransactions()
          checking wether the repository supports transactions
 boolean unlock(String uri)
          unlock resource
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDAVRepositoryTransactionHelper

public WebDAVRepositoryTransactionHelper(CredentialsToken credentials,
                                         WebDAVRepository repo)
create a WebDAVRepositoryTransactionHelper

Parameters:
credentials - the user credentials to be used against the WebDAV repository.
repo - a reference to the WebDAVRepository object.
Method Detail

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

dispose

public void dispose()
Specified by:
dispose in interface Disposable

beginTran

public boolean beginTran()
Description copied from interface: RepositoryTransactionHelper
beginning a transaction on the repository

Specified by:
beginTran in interface RepositoryTransactionHelper
Returns:
a boolean indicating success.

commitTran

public boolean commitTran()
Description copied from interface: RepositoryTransactionHelper
committing a transaction on the repository

Specified by:
commitTran in interface RepositoryTransactionHelper
Returns:
a boolean indicating success.

rollbackTran

public boolean rollbackTran()
Description copied from interface: RepositoryTransactionHelper
rolling back a transaction on the repository

Specified by:
rollbackTran in interface RepositoryTransactionHelper
Returns:
a boolean indicating success.

lock

public boolean lock(String uri)
Description copied from interface: RepositoryTransactionHelper
lock the resource

Specified by:
lock in interface RepositoryTransactionHelper
Parameters:
uri - the uri of the resource.
Returns:
a boolean indicating success.

lock

public boolean lock(String uri,
                    int timeout)
Description copied from interface: RepositoryTransactionHelper
lock the resource with explicit timeout in seconds

Specified by:
lock in interface RepositoryTransactionHelper
Parameters:
uri - the uri of the resource.
timeout - the lock timeout in seconds.
Returns:
a boolean indicating success.

unlock

public boolean unlock(String uri)
Description copied from interface: RepositoryTransactionHelper
unlock resource

Specified by:
unlock in interface RepositoryTransactionHelper
Parameters:
uri - the uri of the resource.
Returns:
a boolean indicating success.

supportsTransactions

public boolean supportsTransactions()
Description copied from interface: RepositoryTransactionHelper
checking wether the repository supports transactions

Specified by:
supportsTransactions in interface RepositoryTransactionHelper
Returns:
true if the repository supports transactions.

supportsLocking

public boolean supportsLocking()
Description copied from interface: RepositoryTransactionHelper
checking wether the repository supports locking

Specified by:
supportsLocking in interface RepositoryTransactionHelper
Returns:
true if the repository supports locking.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.