Class TransactionInfo
- java.lang.Object
-
- org.apache.jackrabbit.webdav.transaction.TransactionInfo
-
- All Implemented Interfaces:
TransactionConstants
,XmlSerializable
public class TransactionInfo extends Object implements TransactionConstants, XmlSerializable
TransactionInfo
class encapsulates the information present in theTransactionConstants.XML_TRANSACTIONINFO
element that forms the request body of the UNLOCk request for a transaction lock.
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.webdav.transaction.TransactionConstants
GLOBAL, HEADER_TRANSACTIONID, LOCAL, NAMESPACE, TRANSACTION, XML_COMMIT, XML_GLOBAL, XML_LOCAL, XML_ROLLBACK, XML_TRANSACTION, XML_TRANSACTIONINFO, XML_TRANSACTIONSTATUS
-
-
Constructor Summary
Constructors Constructor Description TransactionInfo(boolean isCommit)
Creates aTransactionInfo
objectTransactionInfo(Element transactionInfo)
Creates aTransactionInfo
object from the given 'transactionInfo' element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isCommit()
Returns true, if this info requires a 'commit' action, false otherwise (i.e.Element
toXml(Document document)
Returns the xml representation of the implementing object asElement
.
-
-
-
Constructor Detail
-
TransactionInfo
public TransactionInfo(boolean isCommit)
Creates aTransactionInfo
object- Parameters:
isCommit
-
-
TransactionInfo
public TransactionInfo(Element transactionInfo) throws DavException
Creates aTransactionInfo
object from the given 'transactionInfo' element. The 'transactionInfo' must have the following form:<!ELEMENT transactioninfo (transactionstatus) > <!ELEMENT transactionstatus ( commit | rollback ) > <!ELEMENT commit EMPTY > <!ELEMENT rollback EMPTY >
- Parameters:
transactionInfo
- as present in the UNLOCK request body.- Throws:
IllegalArgumentException
- if the given transactionInfo element is not valid.DavException
-
-
Method Detail
-
isCommit
public boolean isCommit()
Returns true, if this info requires a 'commit' action, false otherwise (i.e. 'rollback' is requested).- Returns:
- true if a 'commit' element was present. false otherwise.
- See Also:
TransactionConstants.XML_COMMIT
,TransactionConstants.XML_ROLLBACK
-
toXml
public Element toXml(Document document)
Description copied from interface:XmlSerializable
Returns the xml representation of the implementing object asElement
. The givenDocument
is used as factory and represents theowner document
of the returned DOM element.- Specified by:
toXml
in interfaceXmlSerializable
- Parameters:
document
-- Returns:
- a w3c element representing this object
- See Also:
XmlSerializable.toXml(Document)
-
-