Package org.ldaptive.control
Class SessionTrackingControl
- java.lang.Object
-
- org.ldaptive.control.AbstractControl
-
- org.ldaptive.control.SessionTrackingControl
-
- All Implemented Interfaces:
Control
,RequestControl
,ResponseControl
public class SessionTrackingControl extends AbstractControl implements RequestControl, ResponseControl
Request/response control for session tracking. See https://tools.ietf.org/html/draft-wahl-ldap-session-03. Control is defined as:LDAPString ::= OCTET STRING -- UTF-8 encoded LDAPOID ::= OCTET STRING -- Constrained to numericoid SessionIdentifierControlValue ::= SEQUENCE { sessionSourceIp LDAPString, sessionSourceName LDAPString, formatOID LDAPOID, sessionTrackingIdentifier LDAPString }
Note that criticality must be either false or absent.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
SessionTrackingControl.FormatOIDHandler
Parse handler implementation for the format oid.private static class
SessionTrackingControl.SourceIpHandler
Parse handler implementation for the source ip.private static class
SessionTrackingControl.SourceNameHandler
Parse handler implementation for the source name.private static class
SessionTrackingControl.TrackingIdentifierHandler
Parse handler implementation for the tracking identifier.
-
Field Summary
Fields Modifier and Type Field Description private String
formatOID
Format OID.private static int
HASH_CODE_SEED
hash code seed.static String
OID
OID of this control.static String
RADIUS_ACCT_MULTI_OID
OID for the Acct-Multi-Session-Id RADIUS attribute format.static String
RADIUS_ACCT_OID
OID for the Acct-Session-Id RADIUS attribute format.private String
sessionSourceIp
Session source ip.private String
sessionSourceName
Session source name.private String
sessionTrackingIdentifier
Session tracking identifier.static String
USERNAME_ACCT_OID
OID for the SASL authorization identity string format.-
Fields inherited from class org.ldaptive.control.AbstractControl
logger
-
-
Constructor Summary
Constructors Constructor Description SessionTrackingControl()
Default constructor.SessionTrackingControl(boolean critical)
Creates a new session tracking control.SessionTrackingControl(String sourceIP, String sourceName, String oid, String trackingIdentifier)
Creates a new session tracking control.SessionTrackingControl(String sourceIP, String sourceName, String oid, String trackingIdentifier, boolean critical)
Creates a new session tracking control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decode(DERBuffer encoded)
Initializes this response control with the supplied BER encoded data.byte[]
encode()
Provides the BER encoding of this control.boolean
equals(Object o)
String
getFormatOID()
Returns the format OID.String
getSessionSourceIp()
Returns the session source ip.String
getSessionSourceName()
Returns the session source name.String
getSessionTrackingIdentifier()
Returns the session tracking identifier.int
hashCode()
Returns the hash code for this object.boolean
hasValue()
Returns whether the control has a value associated with it.void
setFormatOID(String s)
Sets the format OID.void
setSessionSourceIp(String s)
Sets the session source ip.void
setSessionSourceName(String s)
Sets the session source name.void
setSessionTrackingIdentifier(String s)
Sets the session tracking identifier.String
toString()
-
Methods inherited from class org.ldaptive.control.AbstractControl
getCriticality, getOID
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ldaptive.control.Control
getCriticality, getOID
-
-
-
-
Field Detail
-
OID
public static final String OID
OID of this control.- See Also:
- Constant Field Values
-
RADIUS_ACCT_OID
public static final String RADIUS_ACCT_OID
OID for the Acct-Session-Id RADIUS attribute format.- See Also:
- Constant Field Values
-
RADIUS_ACCT_MULTI_OID
public static final String RADIUS_ACCT_MULTI_OID
OID for the Acct-Multi-Session-Id RADIUS attribute format.- See Also:
- Constant Field Values
-
USERNAME_ACCT_OID
public static final String USERNAME_ACCT_OID
OID for the SASL authorization identity string format.- See Also:
- Constant Field Values
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
sessionSourceIp
private String sessionSourceIp
Session source ip.
-
sessionSourceName
private String sessionSourceName
Session source name.
-
formatOID
private String formatOID
Format OID.
-
sessionTrackingIdentifier
private String sessionTrackingIdentifier
Session tracking identifier.
-
-
Constructor Detail
-
SessionTrackingControl
public SessionTrackingControl()
Default constructor.
-
SessionTrackingControl
public SessionTrackingControl(boolean critical)
Creates a new session tracking control.- Parameters:
critical
- whether this control is critical
-
SessionTrackingControl
public SessionTrackingControl(String sourceIP, String sourceName, String oid, String trackingIdentifier)
Creates a new session tracking control.- Parameters:
sourceIP
- session source ipsourceName
- session source nameoid
- format OIDtrackingIdentifier
- session tracking identifier
-
SessionTrackingControl
public SessionTrackingControl(String sourceIP, String sourceName, String oid, String trackingIdentifier, boolean critical)
Creates a new session tracking control.- Parameters:
sourceIP
- session source ipsourceName
- session source nameoid
- format OIDtrackingIdentifier
- session tracking identifiercritical
- whether this control is critical
-
-
Method Detail
-
hasValue
public boolean hasValue()
Description copied from interface:RequestControl
Returns whether the control has a value associated with it.- Specified by:
hasValue
in interfaceRequestControl
- Returns:
- whether the control has a value
-
getSessionSourceIp
public String getSessionSourceIp()
Returns the session source ip.- Returns:
- session source ip
-
setSessionSourceIp
public void setSessionSourceIp(String s)
Sets the session source ip.- Parameters:
s
- session source ip
-
getSessionSourceName
public String getSessionSourceName()
Returns the session source name.- Returns:
- session source name
-
setSessionSourceName
public void setSessionSourceName(String s)
Sets the session source name.- Parameters:
s
- session source name
-
getFormatOID
public String getFormatOID()
Returns the format OID.- Returns:
- format OID
-
setFormatOID
public void setFormatOID(String s)
Sets the format OID.- Parameters:
s
- format OID
-
getSessionTrackingIdentifier
public String getSessionTrackingIdentifier()
Returns the session tracking identifier.- Returns:
- session tracking identifier
-
setSessionTrackingIdentifier
public void setSessionTrackingIdentifier(String s)
Sets the session tracking identifier.- Parameters:
s
- session tracking identifier
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractControl
-
hashCode
public int hashCode()
Description copied from class:AbstractControl
Returns the hash code for this object.- Specified by:
hashCode
in classAbstractControl
- Returns:
- hash code
-
toString
public String toString()
- Overrides:
toString
in classAbstractControl
-
encode
public byte[] encode()
Description copied from interface:RequestControl
Provides the BER encoding of this control.- Specified by:
encode
in interfaceRequestControl
- Returns:
- BER encoded request control
-
decode
public void decode(DERBuffer encoded)
Description copied from interface:ResponseControl
Initializes this response control with the supplied BER encoded data.- Specified by:
decode
in interfaceResponseControl
- Parameters:
encoded
- BER encoded response control
-
-