public final class LdapProtocolUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COOKIE_DELIM
A delimiter for the replicaId
|
static java.lang.String |
CSN_PREFIX
the prefix for Csn value
|
private static int |
CSN_PREFIX_LEN |
private static org.slf4j.Logger |
LOG |
static java.lang.String |
REPLICA_ID_PREFIX
the prefix for replicaId value
|
static int |
REPLICA_ID_PREFIX_LEN |
| Modifier | Constructor and Description |
|---|---|
private |
LdapProtocolUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
createCookie(int replicaId,
java.lang.String csn) |
static java.lang.String |
getCsn(java.lang.String cookieString)
returns the CSN present in cookie
|
static int |
getReplicaId(java.lang.String cookieString)
returns the replica id present in cookie
|
static boolean |
isValidCookie(java.lang.String cookieString)
Check the cookie syntax.
|
static void |
setRequestControls(OperationContext opContext,
org.apache.directory.api.ldap.model.message.Request request)
Extracts request controls from a request to populate into an
OperationContext.
|
static void |
setResponseControls(OperationContext opContext,
org.apache.directory.api.ldap.model.message.Response response)
Extracts response controls from a an OperationContext to populate into
a Response object.
|
public static final java.lang.String COOKIE_DELIM
public static final java.lang.String REPLICA_ID_PREFIX
public static final int REPLICA_ID_PREFIX_LEN
public static final java.lang.String CSN_PREFIX
private static final int CSN_PREFIX_LEN
private static final org.slf4j.Logger LOG
public static void setRequestControls(OperationContext opContext, org.apache.directory.api.ldap.model.message.Request request) throws java.lang.Exception
opContext - the context to populate with request controlsrequest - the request to extract controls fromjava.lang.Exceptionpublic static void setResponseControls(OperationContext opContext, org.apache.directory.api.ldap.model.message.Response response) throws java.lang.Exception
opContext - the context to extract controls fromresponse - the response to populate with response controlsjava.lang.Exceptionpublic static byte[] createCookie(int replicaId,
java.lang.String csn)
public static boolean isValidCookie(java.lang.String cookieString)
public static java.lang.String getCsn(java.lang.String cookieString)
cookieString - the cookiepublic static int getReplicaId(java.lang.String cookieString)
cookieString - the cookie