Class MonitoringLdapConnection
- java.lang.Object
-
- org.apache.directory.ldap.client.api.LdapConnectionWrapper
-
- org.apache.directory.ldap.client.api.MonitoringLdapConnection
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,LdapConnection
,Wrapper<LdapConnection>
public final class MonitoringLdapConnection extends LdapConnectionWrapper
A class used to monitor the use of a LdapConnection- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
anonymousBind()
Anonymous bind on a server.void
bind()
Bind on a server, using theLdapConnectionConfig
information of this connection.void
bind(String name)
Unauthenticated authentication bind on a server.void
bind(String name, String credentials)
Simple bind on a server.BindResponse
bind(BindRequest bindRequest)
Bind to the server using a bind request object.void
bind(Dn name)
Unauthenticated authentication bind on a server.void
bind(Dn name, String credentials)
Simple bind on a server.boolean
bindCalled()
ExtendedResponse
extended(String oid)
Sends a extended operation request to the server with the given OID and no value.ExtendedResponse
extended(String oid, byte[] value)
Sends a extended operation request to the server with the given OID and value.ExtendedResponse
extended(Oid oid)
Sends a extended operation request to the server with the given OID and no value.ExtendedResponse
extended(Oid oid, byte[] value)
Sends a extended operation request to the server with the given OID and value.ExtendedResponse
extended(ExtendedRequest extendedRequest)
Performs an extended operation based on the extended request object.void
resetMonitors()
Reset the Bind and StartTLS flagsboolean
startTlsCalled()
-
Methods inherited from class org.apache.directory.ldap.client.api.LdapConnectionWrapper
abandon, abandon, add, add, bind, close, compare, compare, compare, compare, compare, compare, compare, connect, delete, delete, delete, doesFutureExistFor, exists, exists, getBinaryAttributeDetector, getCodecService, getRootDse, getRootDse, getSchemaManager, getSupportedControls, isAuthenticated, isConnected, isControlSupported, isRequestCompleted, loadSchema, loadSchemaRelaxed, lookup, lookup, lookup, lookup, lookup, lookup, modify, modify, modify, modify, modifyDn, move, move, moveAndRename, moveAndRename, moveAndRename, moveAndRename, rename, rename, rename, rename, search, search, search, setBinaryAttributeDetector, setSchemaManager, setTimeOut, unBind, wrapped
-
-
-
-
Method Detail
-
bindCalled
public boolean bindCalled()
- Returns:
- tells if a Bind has been issued
-
resetMonitors
public void resetMonitors()
Reset the Bind and StartTLS flags
-
startTlsCalled
public boolean startTlsCalled()
- Returns:
- tells if the StarTLS extended operation has been called
-
bind
public void bind() throws LdapException
Bind on a server, using theLdapConnectionConfig
information of this connection.- Specified by:
bind
in interfaceLdapConnection
- Overrides:
bind
in classLdapConnectionWrapper
- Throws:
LdapException
- if some error occurred
-
anonymousBind
public void anonymousBind() throws LdapException
Anonymous bind on a server.- Specified by:
anonymousBind
in interfaceLdapConnection
- Overrides:
anonymousBind
in classLdapConnectionWrapper
- Throws:
LdapException
- if some error occurred
-
bind
public void bind(String name) throws LdapException
Unauthenticated authentication bind on a server.- Specified by:
bind
in interfaceLdapConnection
- Overrides:
bind
in classLdapConnectionWrapper
- Parameters:
name
- The name used to authenticate the user. It must be a valid distinguished name.- Throws:
LdapException
- if some error occurred
-
bind
public void bind(String name, String credentials) throws LdapException
Simple bind on a server.- Specified by:
bind
in interfaceLdapConnection
- Overrides:
bind
in classLdapConnectionWrapper
- Parameters:
name
- The name used to authenticate the user. It must be a valid distinguished name.credentials
- The password, it can't benull
- Throws:
LdapException
- if some error occurred
-
bind
public void bind(Dn name) throws LdapException
Unauthenticated authentication bind on a server.- Specified by:
bind
in interfaceLdapConnection
- Overrides:
bind
in classLdapConnectionWrapper
- Parameters:
name
- The name used to authenticate the user.- Throws:
LdapException
- if some error occurred
-
bind
public void bind(Dn name, String credentials) throws LdapException
Simple bind on a server.- Specified by:
bind
in interfaceLdapConnection
- Overrides:
bind
in classLdapConnectionWrapper
- Parameters:
name
- The name used to authenticate the user.credentials
- The password, it can't be null- Throws:
LdapException
- if some error occurred
-
bind
public BindResponse bind(BindRequest bindRequest) throws LdapException
Bind to the server using a bind request object.- Specified by:
bind
in interfaceLdapConnection
- Overrides:
bind
in classLdapConnectionWrapper
- Parameters:
bindRequest
- The bind request object containing all the needed parameters- Returns:
- A
BindResponse
containing the result - Throws:
LdapException
- if some error occurred
-
extended
public ExtendedResponse extended(String oid) throws LdapException
Sends a extended operation request to the server with the given OID and no value.- Specified by:
extended
in interfaceLdapConnection
- Overrides:
extended
in classLdapConnectionWrapper
- Parameters:
oid
- the object identifier of the extended operation- Returns:
- extended operation's response
- Throws:
LdapException
- if some error occurred- See Also:
LdapConnection.extended(org.apache.directory.api.asn1.util.Oid, byte[])
-
extended
public ExtendedResponse extended(String oid, byte[] value) throws LdapException
Sends a extended operation request to the server with the given OID and value.- Specified by:
extended
in interfaceLdapConnection
- Overrides:
extended
in classLdapConnectionWrapper
- Parameters:
oid
- the object identifier of the extended operationvalue
- value to be used by the extended operation, can be a null value- Returns:
- extended operation's response
- Throws:
LdapException
- if some error occurred- See Also:
LdapConnection.extended(org.apache.directory.api.asn1.util.Oid, byte[])
-
extended
public ExtendedResponse extended(Oid oid) throws LdapException
Sends a extended operation request to the server with the given OID and no value.- Specified by:
extended
in interfaceLdapConnection
- Overrides:
extended
in classLdapConnectionWrapper
- Parameters:
oid
- the object identifier of the extended operation- Returns:
- extended operation's response
- Throws:
LdapException
- if some error occurred- See Also:
LdapConnection.extended(org.apache.directory.api.asn1.util.Oid, byte[])
-
extended
public ExtendedResponse extended(Oid oid, byte[] value) throws LdapException
Sends a extended operation request to the server with the given OID and value.- Specified by:
extended
in interfaceLdapConnection
- Overrides:
extended
in classLdapConnectionWrapper
- Parameters:
oid
- the object identifier of the extended operationvalue
- value to be used by the extended operation, can be a null value- Returns:
- extended operation's response
- Throws:
LdapException
- if some error occurred
-
extended
public ExtendedResponse extended(ExtendedRequest extendedRequest) throws LdapException
Performs an extended operation based on the extended request object.- Specified by:
extended
in interfaceLdapConnection
- Overrides:
extended
in classLdapConnectionWrapper
- Parameters:
extendedRequest
- the extended operation's request- Returns:
- Extended operation's response
- Throws:
LdapException
- if the extended operation failed
-
-