Class DLSubmitPermission

java.lang.Object
com.isode.dsapi.syntax.IsodeSyntax<MD.DLSubmitPermission>
com.isode.dsapi.syntax.mhs.DLSubmitPermission

public class DLSubmitPermission extends IsodeSyntax<MD.DLSubmitPermission>
Class representation of an DLSubmitPermission value. The class makes use of the MD.DLSubmitPermission to encode/decode an ORName. The ASN definition has:
DLSubmitPermission ::= CHOICE {
    individual [0] ORName,
    member-of-dl [1] ORName,
    pattern-match [2] ORNamePattern,
    member-of-group [3] EXPLICIT Name
    }

There are four types of DLSubmitPermission

  • individual, with an ORName
  • group member, with an DN
  • dl member, with an ORName
  • pattern, with an ORName, or subset of an ORName

It is possible for a DLSubmitPermission object to exist which contains no value ("empty"): this is to allow callers to construct an object before they know what all the contents will be, so that they can subsequently use setter methods to populate it.

  • Constructor Details

    • DLSubmitPermission

      public DLSubmitPermission(String str) throws BadValueException, BadSyntaxException
      Constructor.
      Parameters:
      str - String representation, which must not be null.
      Throws:
      BadValueException - if str is not a valid DLSubmitPermission
      BadSyntaxException - if the schema does not know about DLSubmitPermission.
    • DLSubmitPermission

      public DLSubmitPermission(MD.DLSubmitPermission val)
      Create a new DLSubmitPermission object from an existing ASN value.
      Parameters:
      val - an ASN value, which must not be null. The contents of this object will be copied.
      Since:
      14.4
    • DLSubmitPermission

      public DLSubmitPermission()
      Construct an empty object with no value.
  • Method Details

    • getSyntaxInfo

      protected IsodeSyntax.SyntaxInfo getSyntaxInfo() throws BadSyntaxException
      Description copied from class: IsodeSyntax
      Subclasses must implement a method which returns a SyntaxInfo object that can be used by the IsodeSyntax class.
      Specified by:
      getSyntaxInfo in class IsodeSyntax<MD.DLSubmitPermission>
      Returns:
      a SyntaxInfo describing the syntax represented by the subclass.
      Throws:
      BadSyntaxException - if no SyntaxInfo is available for this syntax.
    • parse

      protected void parse(byte[] berRepresentation) throws BadValueException
      Attempt to parse the specified byte array into asn representation. If an error occurs, the existing value will be left unchanged.
      Specified by:
      parse in class IsodeSyntax<MD.DLSubmitPermission>
      Parameters:
      berRepresentation - putative value in BER
      Throws:
      BadValueException - if there was something wrong with berRepresentation.
    • setIndividual

      public void setIndividual(ORName orname_in)
      Set as INDIVIDUAL value. A null input ORName is NOT permitted.
      Parameters:
      orname_in - ORName. Must not be null.
    • setDLMember

      public void setDLMember(ORName orname_in)
      Set as DL_MEMBER value. A null input ORName is NOT permitted.
      Parameters:
      orname_in - ORName. Must not be null.
    • setPattern

      public void setPattern(ORName orname_in)
      Set as PATTERN value. A null input ORName is NOT permitted.
      Parameters:
      orname_in - ORName. Must not be null.
    • setGroupMember

      public void setGroupMember(DN dn_in) throws BadValueException
      Set GROUPMEMBER value. A null input DN is NOT permitted.
      Parameters:
      dn_in - DN. Must not be null.
      Throws:
      BadValueException
    • getORName

      public ORName getORName() throws BadValueException
      Get ORName value.
      Returns:
      ORName.
      Throws:
      BadValueException - If permission type is inappropriate
    • setORName

      public void setORName(ORName orname) throws BadValueException
      Set ORName value.
      Parameters:
      orname - ORName. Must not be null.
      Throws:
      BadValueException - If permission type is inappropriate, stored value is unchanged on error.
    • getDN

      public DN getDN() throws BadValueException
      Get DN value.
      Returns:
      DN
      Throws:
      BadValueException - If permission type is inappropriate
    • setDN

      public void setDN(DN dn) throws BadValueException
      Set DN value.
      Parameters:
      dn - DN.
      Throws:
      BadValueException - If permission type is inappropriate, stored value is unchanged if exception thrown.
    • getPermissionString

      public String getPermissionString()
      Get permission value string (null if not set, string DN for group members, ORName otherwise).
      Returns:
      Permission string formatted according to type, null if not set.
    • getType

      Get the permission type.
      Returns:
      DLSubmitPermissionType.
    • reset

      public void reset()
      Clear all the fields in the object. The object will not be a valid DLSubmitPermission, but may become one if fields inside it are set appropriately.
      Specified by:
      reset in class IsodeSyntax<MD.DLSubmitPermission>
    • isMatchAllPattern

      public boolean isMatchAllPattern()
      Determine whether this DLSubmitPermission object represents a PATTERN that matches all ORNames.

      A DLSubmitPermission is regarded as being a "match all" pattern if it's (a) a pattern, and (b) contains an ORName with empty ORAddress and DN. Such a value will typically have an LDAP string representation of "X400:", but clients should not rely on this.

      Returns:
      true if the object is a pattern that will match any ORName, false otherwise.