|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ldaptive.provider.jndi.JndiConnection
public class JndiConnection
JNDI provider implementation of ldap operations.
| Nested Class Summary | |
|---|---|
protected static class |
JndiConnection.JndiExtendedRequest
Class for exposing extended request properties. |
protected static class |
JndiConnection.JndiExtendedResponse
Class for exposing extended response properties. |
protected class |
JndiConnection.JndiSearchIterator
Search iterator for JNDI naming enumeration. |
| Field Summary | |
|---|---|
static String |
AUTHENTICATION
The value of this property is a string that specifies the authentication mechanism(s) for the provider to use. |
static String |
BINARY_ATTRIBUTES
The value of this property is a string that specifies additional binary attributes. |
static String |
CREDENTIALS
The value of this property is an object that specifies the credentials of the principal to be authenticated. |
static String |
DELETE_RDN
The value of this property is a string that specifies whether the RDN attribute should be deleted for a modify dn operation. |
static String |
DEREF_ALIASES
The value of this property is a string that specifies how aliases shall be handled by the provider. |
protected org.slf4j.Logger |
logger
Logger for this class. |
static String |
PRINCIPAL
The value of this property is a string that specifies the identity of the principal to be authenticated. |
static String |
REFERRAL
The value of this property is a string that specifies how referrals shall be handled by the provider. |
static String |
SASL_AUTHZ_ID
The value of this property is a string that specifies the sasl authorization id. |
static String |
SASL_MUTUAL_AUTH
The value of this property is a string that specifies the sasl mutual authentication flag. |
static String |
SASL_QOP
The value of this property is a string that specifies the sasl quality of protection. |
static String |
SASL_REALM
The value of this property is a string that specifies the sasl realm. |
static String |
SASL_STRENGTH
The value of this property is a string that specifies the sasl security strength. |
static String |
TYPES_ONLY
The value of this property is a string that specifies to only return attribute type names, no values. |
| Constructor Summary | |
|---|---|
JndiConnection(LdapContext lc,
JndiProviderConfig pc)
Creates a new jndi connection. |
|
| Method Summary | ||
|---|---|---|
void |
abandon(int messageId,
RequestControl[] controls)
Abandon an operation. |
|
Response<Void> |
add(AddRequest request)
Add an entry to an ldap. |
|
void |
addUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
Adds a listener to receive unsolicited notifications. |
|
protected Response<Void> |
anonymousBind(BindRequest request)
Performs an anonymous bind. |
|
Response<Void> |
bind(BindRequest request)
Bind to the ldap. |
|
void |
close(RequestControl[] controls)
Tear down this connection to an LDAP. |
|
Response<Boolean> |
compare(CompareRequest request)
Compare an entry in the ldap. |
|
protected
|
createResponse(Request request,
T result,
NamingException e,
String[] urls,
LdapContext ctx)
Creates an operation response with the supplied referral response data. |
|
protected
|
createResponse(Request request,
T result,
ResultCode code,
String[] urls,
LdapContext ctx)
Creates an operation response with the supplied response data. |
|
Response<Void> |
delete(DeleteRequest request)
Delete an entry in the ldap. |
|
Response<?> |
extendedOperation(ExtendedRequest request)
Perform an extended operation in the ldap. |
|
static SearchControls |
getCompareSearchControls()
Returns a search controls object configured to perform an LDAP compare operation. |
|
LdapContext |
getLdapContext()
Returns the underlying ldap context. |
|
protected static Map<String,Object> |
getSaslProperties(SaslConfig config)
Returns the JNDI properties for the supplied sasl configuration. |
|
protected LdapContext |
initializeContext(Request request)
Creates a new ldap context using LdapContext.newInstance(Control[]). |
|
Response<Void> |
modify(ModifyRequest request)
Modify an entry in the ldap. |
|
Response<Void> |
modifyDn(ModifyDnRequest request)
Modify the DN of an entry in the ldap. |
|
protected void |
processNamingException(Request request,
NamingException e,
String[] urls,
LdapContext ctx)
Determines if the supplied naming exception should result in an operation retry. |
|
protected ResponseControl[] |
processResponseControls(ControlProcessor<Control> processor,
RequestControl[] requestControls,
LdapContext ctx)
Retrieves the response controls from the supplied context and processes them with the supplied control processor. |
|
void |
removeUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
Removes a listener from receiving unsolicited notifications. |
|
protected Response<Void> |
saslBind(BindRequest request)
Performs a sasl bind. |
|
SearchIterator |
search(SearchRequest request)
Search the ldap. |
|
void |
searchAsync(SearchRequest request,
SearchListener listener)
Search the ldap asynchronously. |
|
protected Response<Void> |
simpleBind(BindRequest request)
Performs a simple bind. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String AUTHENTICATION
public static final String CREDENTIALS
public static final String PRINCIPAL
public static final String SASL_AUTHZ_ID
public static final String SASL_QOP
public static final String SASL_STRENGTH
public static final String SASL_MUTUAL_AUTH
public static final String SASL_REALM
public static final String DELETE_RDN
public static final String BINARY_ATTRIBUTES
public static final String DEREF_ALIASES
public static final String REFERRAL
public static final String TYPES_ONLY
protected final org.slf4j.Logger logger
| Constructor Detail |
|---|
public JndiConnection(LdapContext lc,
JndiProviderConfig pc)
lc - ldap contextpc - provider configuration| Method Detail |
|---|
public LdapContext getLdapContext()
public void close(RequestControl[] controls)
throws LdapException
close in interface ProviderConnectioncontrols - request controls
LdapException - if an LDAP error occurs
public Response<Void> bind(BindRequest request)
throws LdapException
bind in interface ProviderConnectionrequest - containing the data necessary to perform the operation
LdapException - if an error occurs
protected Response<Void> anonymousBind(BindRequest request)
throws LdapException
request - to bind with
LdapException - if an error occurs
protected Response<Void> simpleBind(BindRequest request)
throws LdapException
request - to bind with
LdapException - if an error occurs
protected Response<Void> saslBind(BindRequest request)
throws LdapException
request - to bind with
LdapException - if an error occurs
public Response<Void> add(AddRequest request)
throws LdapException
add in interface ProviderConnectionrequest - containing the data necessary to perform the operation
LdapException - if an error occurs
public Response<Boolean> compare(CompareRequest request)
throws LdapException
compare in interface ProviderConnectionrequest - containing the data necessary to perform the operation
LdapException - if an error occurs
public Response<Void> delete(DeleteRequest request)
throws LdapException
delete in interface ProviderConnectionrequest - containing the data necessary to perform the operation
LdapException - if an error occurs
public Response<Void> modify(ModifyRequest request)
throws LdapException
modify in interface ProviderConnectionrequest - containing the data necessary to perform the operation
LdapException - if an error occurs
public Response<Void> modifyDn(ModifyDnRequest request)
throws LdapException
modifyDn in interface ProviderConnectionrequest - containing the data necessary to perform the operation
LdapException - if an error occurs
public SearchIterator search(SearchRequest request)
throws LdapException
search in interface ProviderConnectionrequest - containing the data necessary to perform the operation
LdapException - if an error occurs
public void searchAsync(SearchRequest request,
SearchListener listener)
throws LdapException
searchAsync in interface ProviderConnectionrequest - containing the data necessary to perform the operationlistener - to be notified as results arrive
LdapException - if an error occurs
public void abandon(int messageId,
RequestControl[] controls)
throws LdapException
abandon in interface ProviderConnectionmessageId - of the operation to abandoncontrols - request controls
LdapException - if an error occurs
public Response<?> extendedOperation(ExtendedRequest request)
throws LdapException
extendedOperation in interface ProviderConnectionrequest - containing the data necessary to perform the operation
LdapException - if an error occurspublic void addUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
addUnsolicitedNotificationListener in interface ProviderConnectionlistener - to receive unsolicited notificationspublic void removeUnsolicitedNotificationListener(UnsolicitedNotificationListener listener)
removeUnsolicitedNotificationListener in interface ProviderConnectionlistener - that was registered to receive unsolicited notificationspublic static SearchControls getCompareSearchControls()
protected LdapContext initializeContext(Request request)
throws NamingException
LdapContext.newInstance(Control[]). Adds any additional environment
properties found in the supplied request to the context.
request - to read properties from
NamingException - if a property cannot be added to the context
protected <T> Response<T> createResponse(Request request,
T result,
ResultCode code,
String[] urls,
LdapContext ctx)
T - type of responserequest - containing controlsresult - of the operationcode - operation result codeurls - referral urlsctx - ldap context
protected <T> Response<T> createResponse(Request request,
T result,
NamingException e,
String[] urls,
LdapContext ctx)
T - type of responserequest - containing controlsresult - of the operatione - naming exception produced by the operationurls - referral urlsctx - ldap context
protected void processNamingException(Request request,
NamingException e,
String[] urls,
LdapContext ctx)
throws LdapException
request - that produced the exceptione - that was producedurls - referral urlsctx - that the exception occurred on
LdapException - wrapping the naming exception
protected ResponseControl[] processResponseControls(ControlProcessor<Control> processor,
RequestControl[] requestControls,
LdapContext ctx)
processor - control processorrequestControls - that produced this responsectx - to get controls from
protected static Map<String,Object> getSaslProperties(SaslConfig config)
config - sasl configuration
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||