Package com.isode.dsapi.syntax.mhs
Class RedirectFilter
Class representation of an RedirectFilter value. Users may create
values from Strings, BER, or AttributeValue objects.
This class works by holding an
MHSR.RedirectFilter
object, and providing a slightly more user-friendly set of methods which
access and manipulate fields inside that object.
See RFC 1801 for description of RedirectFilter, which says it looks like this:
RedirectFilter ::= SEQUENCE {
attribute-type OBJECT IDENTIFIER,
weight RouteWeight,
dda-key DDAKeyString OPTIONAL,
regex-match IA5String OPTIONAL,
reason RedirectionReason,
orname ORName
}
This class supports access (via set and get methods)
to all of the above fields.
The enum RedirectionReason can be used to access reason fields
in the object.- Since:
- 14.4
- Author:
- nh
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumerated values representing RedirectionReason.Nested 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
ConstructorsConstructorDescriptionRedirectFilter(byte[] ber) Construct a new object based on a byte array containing the BER representation of an RedirectFilter.Create a new RedirectFilter object from an existing ASN representation.RedirectFilter(AttributeType attributeType, int weight, String ddaKey, String regexMatch, RedirectFilter.RedirectionReason reason, ORName orname) Construct a new object based on a set of fieldsCreate a new RedirectFilter object from a suitable AttributeValue.RedirectFilter(String str) Create a new RedirectFilter object from a string representation. -
Method Summary
Modifier and TypeMethodDescriptionDetermine the value of the attributetype component of this RedirectFilter.Determine the dda-key from this object.Return a reference to the underlying asn representation of this objectDetermine the ORName component in this RedirectFilterDetermine the RedirectionReason component of the RedirectFilter.Determine the regex-match from this object.intDetermine the routing weight of the RedirectFilter.protected IsodeSyntax.SyntaxInfoSubclasses must implement a method which returns a SyntaxInfo object that can be used by the IsodeSyntax class.protected voidparse(byte[] berRepresentation) Parse the specified byte array into asn representationvoidreset()Clear all fields in the object.voidsetAttributeType(AttributeType newAttributeType) Set the attributeType component of a RedirectFilter.voidsetDDAKeyPrintable(String newDDAKey) Set the dda-key component of a RedirectFilter.voidvoidSet the RedirectionReason of an RedirectFilter.voidsetRegexMatch(String newRegexMatch) Set the regex-match component of a RedirectFilter.voidsetRoutingWeight(int newRouteWeight) Set the weight component of a RedirectFilter.Methods inherited from class com.isode.dsapi.syntax.IsodeSyntax
equals, getAsnVal, getAttributeValue, getAttributeValue, getStringRepresentation, hashCode, isNumeric, isValid, isValidStringValue, set, toString
-
Constructor Details
-
RedirectFilter
Create a new RedirectFilter object from an existing ASN representation.- Parameters:
val- an ASN value, which must not be null. The contents of this object will be copied.
-
RedirectFilter
Create a new RedirectFilter object from a string representation.- Parameters:
str- String representation. Must not be null.- Throws:
BadValueException- if str is not a valid RedirectFilterBadSyntaxException- it is not possible to parse RedirectFilter values
-
RedirectFilter
Create a new RedirectFilter object from a suitable AttributeValue.- Parameters:
av- AttributeValue. Must not be null.- Throws:
BadValueException- if av is not a valid RedirectFilterBadSyntaxException- it is not possible to parse RedirectFilter valuesNativeLibraryException- if an unrecoverable error was detected by the native library
-
RedirectFilter
public RedirectFilter(AttributeType attributeType, int weight, String ddaKey, String regexMatch, RedirectFilter.RedirectionReason reason, ORName orname) throws BadValueException Construct a new object based on a set of fields- Parameters:
attributeType- attribute type (must not be null)weight- routing weightddaKey- PrintableString dda-key value (may be null)regexMatch- regex-match (may be null)reason- redirection reason (must not be null)orname- ORName (must not be null)- Throws:
BadValueException- if the supplied values cannot be converted into a RedirectFilter
-
RedirectFilter
Construct a new object based on a byte array containing the BER representation of an RedirectFilter.- Parameters:
ber- BER representation of a RedirectFilter value- Throws:
BadValueException- if ber doesn't hold a valid RedirectFilter value
-
-
Method Details
-
getSyntaxInfo
Description copied from class:IsodeSyntaxSubclasses must implement a method which returns a SyntaxInfo object that can be used by the IsodeSyntax class.- Specified by:
getSyntaxInfoin classIsodeSyntax<MHSR.RedirectFilter>- Returns:
- a SyntaxInfo describing the syntax represented by the subclass.
- Throws:
BadSyntaxException- if no SyntaxInfo is available for this syntax.
-
parse
Parse the specified byte array into asn representation- Specified by:
parsein classIsodeSyntax<MHSR.RedirectFilter>- Parameters:
berRepresentation- putative value in BER- Throws:
BadValueException
-
getMhsrRedirectFilter
Return a reference to the underlying asn representation of this object- Returns:
- the MHSR.RedirectFilter object.
-
getAttributeType
Determine the value of the attributetype component of this RedirectFilter.- Returns:
- an AttributeType.
- Throws:
BadAttributeTypeException- if it the RedirectFilter does not contain a valid AttributeTypeNativeLibraryException- if an unrecoverable error was detected by the native library
-
getRedirectionReason
Determine the RedirectionReason component of the RedirectFilter.- Returns:
- a RedirectionReason.
-
getRouteWeight
public int getRouteWeight()Determine the routing weight of the RedirectFilter.- Returns:
- an integer representing the routing weight. Lower values are "better".
-
getddaKeyPrintable
Determine the dda-key from this object. A dda-key may be held as either a PrintableString or TeletexString. This method returns the PrintableString (if present), or null if no PrintableString representation is available.- Returns:
- the PrintableString representation of the dda-key, which may be null if none is present.
-
getRegexMatch
Determine the regex-match from this object.- Returns:
- the String representation of the regex-match, which may be null if no value is present.
-
getORName
Determine the ORName component in this RedirectFilter- Returns:
- an ORName
-
setAttributeType
Set the attributeType component of a RedirectFilter. Other fields remain unchanged.- Parameters:
newAttributeType- the new AttributeType to be used (must not be null).- Throws:
NullPointerException- if newAttributeType is null.
-
setRedirectionReason
Set the RedirectionReason of an RedirectFilter. Other fields remain unchanged.- Parameters:
reason- the new RedirectionReason to be used (must not be null).- Throws:
NullPointerException- if newNode is null.
-
setORName
-
setRoutingWeight
public void setRoutingWeight(int newRouteWeight) Set the weight component of a RedirectFilter. Other fields remain unchanged.- Parameters:
newRouteWeight- the new weight to be used.
-
setRegexMatch
Set the regex-match component of a RedirectFilter. Other fields remain unchanged.- Parameters:
newRegexMatch- the new weight to be used (which may be null).
-
setDDAKeyPrintable
Set the dda-key component of a RedirectFilter. Other fields remain unchanged. A dda-key may be held as either a PrintableString or TeletexString. This method sets the PrintableString value (which means any existing PrintableString or TeletexString value will be lost).- Parameters:
newDDAKey- the new PrintableString dda-key to be used (which may be null).
-
reset
public void reset()Clear all fields in the object. The object may not be a valid RedirectFilter, but may become one if fields inside it are set appropriately.- Specified by:
resetin classIsodeSyntax<MHSR.RedirectFilter>- Since:
- 14.6
-