Class LabelInfo

  • All Implemented Interfaces:
    DeltaVConstants, XmlSerializable

    public class LabelInfo
    extends Object
    implements DeltaVConstants, XmlSerializable
    LabelInfo encapsulates the request body of a LABEL request used to add, set or remove a label from the requested version resource or from that version specified with the Label header in case the requested resource is a version-controlled resource.

    The request body (thus the 'labelElement' passed to the constructor must be a DAV:label element:
     <!ELEMENT label ANY>
     ANY value: A sequence of elements with at most one DAV:add,
     DAV:set, or DAV:remove element.
     <!ELEMENT add (label-name)>
     <!ELEMENT set (label-name)>
     <!ELEMENT remove (label-name)>
     <!ELEMENT label-name (#PCDATA)>
     PCDATA value: string
     
    Please note, that the given implementation only recognizes the predefined elements 'add', 'set' and 'remove'.
    • Constructor Detail

      • LabelInfo

        public LabelInfo​(String labelName,
                         String type)
      • LabelInfo

        public LabelInfo​(String labelName,
                         int type)
      • LabelInfo

        public LabelInfo​(String labelName,
                         int type,
                         int depth)
      • LabelInfo

        public LabelInfo​(Element labelElement,
                         int depth)
                  throws DavException
        Create a new LabelInfo from the given element and depth integer. If the specified Xml element does have a DeltaVConstants.XML_LABEL root element or no label name is specified with the action to perform the creation will fail.
        Parameters:
        labelElement -
        depth -
        Throws:
        DavException - if the specified element does not start with a DeltaVConstants.XML_LABEL element or if the DAV:label element contains illegal instructions e.g. contains multiple DAV:add, DAV:set or DAV:remove elements.
    • Method Detail

      • getLabelName

        public String getLabelName()
        Return the text present inside the 'DAV:label-name' element or null
        Returns:
        'label-name' or null
      • getType

        public int getType()
        Return the type of the LABEL request. This might either be TYPE_SET, TYPE_ADD or TYPE_REMOVE.
        Returns:
        type
      • getDepth

        public int getDepth()
        Return the depth
        Returns:
        depth