Class SupportedLock

All Implemented Interfaces:
DavConstants, DavProperty<List<LockEntry>>, PropEntry, XmlSerializable

public class SupportedLock extends AbstractDavProperty<List<LockEntry>>
The SupportedLock class encapsulates the lock capabilities of a resource. It is mainly responsible for generating the <supportedlock> property.
  • Constructor Details

    • SupportedLock

      public SupportedLock()
      Creates a new empty SupportedLock property.
  • Method Details

    • addEntry

      public void addEntry(Type type, Scope scope)
      Adds a capability to this lock support.
      Parameters:
      type - Can currently only be 'write'
      scope - Can currently only be 'exclusive' or 'shared'
      Throws:
      IllegalArgumentException - If an argument contains invalid string
    • addEntry

      public void addEntry(LockEntry entry)
      Adds a capability to this lock support.
      Parameters:
      entry - specifying the type of lock that is supported by this entry.
      See Also:
    • isSupportedLock

      public boolean isSupportedLock(Type type, Scope scope)
      Returns true if this a lock with the given type and scope is supported.
      Parameters:
      type -
      scope -
      Returns:
      true if applying a lock with the given type and scope is basically supported.
    • getSupportedLocks

      public Iterator<LockEntry> getSupportedLocks()
      Returns an iterator over all supported locks.
      Returns:
      an iterator over all supported locks
    • toXml

      public Element toXml(Document document)
      Creates an XML element that represents the <supportedlock> tag.
      Specified by:
      toXml in interface XmlSerializable
      Overrides:
      toXml in class AbstractDavProperty<List<LockEntry>>
      Parameters:
      document -
      Returns:
      An XML element of this lock support.
      See Also:
    • getValue

      public List<LockEntry> getValue()
      Returns the list of supported lock entries.
      Returns:
      list of supported lock.
      See Also: