Package com.isode.dsapi.syntax.mhs
Class DLSubmitPermission
java.lang.Object
com.isode.dsapi.syntax.IsodeSyntax<MD.DLSubmitPermission>
com.isode.dsapi.syntax.mhs.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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Used to identify what kind of DLSubmitPermission we haveNested classes/interfaces inherited from class com.isode.dsapi.syntax.IsodeSyntax
IsodeSyntax.SyntaxInfo
-
Field Summary
Fields inherited from class com.isode.dsapi.syntax.IsodeSyntax
asnVal, logger
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an empty object with no value.Create a new DLSubmitPermission object from an existing ASN value.DLSubmitPermission
(String str) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetDN()
Get DN value.Get ORName value.Get permission value string (null if not set, string DN for group members, ORName otherwise).protected IsodeSyntax.SyntaxInfo
Subclasses must implement a method which returns a SyntaxInfo object that can be used by the IsodeSyntax class.getType()
Get the permission type.boolean
Determine whether this DLSubmitPermission object represents a PATTERN that matches all ORNames.protected void
parse
(byte[] berRepresentation) Attempt to parse the specified byte array into asn representation.void
reset()
Clear all the fields in the object.void
setDLMember
(ORName orname_in) Set as DL_MEMBER value.void
Set DN value.void
setGroupMember
(DN dn_in) Set GROUPMEMBER value.void
setIndividual
(ORName orname_in) Set as INDIVIDUAL value.void
Set ORName value.void
setPattern
(ORName orname_in) Set as PATTERN value.Methods inherited from class com.isode.dsapi.syntax.IsodeSyntax
equals, getAsnVal, getAttributeValue, getAttributeValue, getStringRepresentation, hashCode, isNumeric, isValid, isValidStringValue, set, toString
-
Constructor Details
-
DLSubmitPermission
Constructor.- Parameters:
str
- String representation, which must not be null.- Throws:
BadValueException
- if str is not a valid DLSubmitPermissionBadSyntaxException
- if the schema does not know about DLSubmitPermission.
-
DLSubmitPermission
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
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 classIsodeSyntax<MD.DLSubmitPermission>
- Returns:
- a SyntaxInfo describing the syntax represented by the subclass.
- Throws:
BadSyntaxException
- if no SyntaxInfo is available for this syntax.
-
parse
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 classIsodeSyntax<MD.DLSubmitPermission>
- Parameters:
berRepresentation
- putative value in BER- Throws:
BadValueException
- if there was something wrong with berRepresentation.
-
setIndividual
Set as INDIVIDUAL value. A null input ORName is NOT permitted.- Parameters:
orname_in
- ORName. Must not be null.
-
setDLMember
Set as DL_MEMBER value. A null input ORName is NOT permitted.- Parameters:
orname_in
- ORName. Must not be null.
-
setPattern
Set as PATTERN value. A null input ORName is NOT permitted.- Parameters:
orname_in
- ORName. Must not be null.
-
setGroupMember
Set GROUPMEMBER value. A null input DN is NOT permitted.- Parameters:
dn_in
- DN. Must not be null.- Throws:
BadValueException
-
getORName
Get ORName value.- Returns:
- ORName.
- Throws:
BadValueException
- If permission type is inappropriate
-
setORName
Set ORName value.- Parameters:
orname
- ORName. Must not be null.- Throws:
BadValueException
- If permission type is inappropriate, stored value is unchanged on error.
-
getDN
Get DN value.- Returns:
- DN
- Throws:
BadValueException
- If permission type is inappropriate
-
setDN
Set DN value.- Parameters:
dn
- DN.- Throws:
BadValueException
- If permission type is inappropriate, stored value is unchanged if exception thrown.
-
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 classIsodeSyntax<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.
-