|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@NotExtensible @ThreadSafety(level=INTERFACE_NOT_THREADSAFE) public interface ClientContext
This interface defines a set of methods that may be used to obtain information about a client connection that has been established to the server.
Method Summary | |
---|---|
void |
disconnect(DisconnectReason reason,
boolean notifyClient,
java.lang.String message)
Terminates the connection to the client and interrupts any operations that may be in progress on that connection. |
AuthInfo |
getAuthInfo()
Retrieves information about the authentication state of the client connection. |
java.net.InetAddress |
getClientInetAddress()
Retrieves an InetAddress representing the address of the client
system, if available. |
long |
getConnectionID()
Retrieves the identifier that has been assigned to the associated client connection. |
long |
getConnectTime()
Retrieves the time that the connection was established. |
InternalConnection |
getInternalConnection(java.lang.String dn,
boolean usePolicyFromConnection)
Retrieves an internal connection that is authenticated as the specified user. |
InternalConnection |
getInternalRootConnection(boolean usePolicyFromConnection)
Retrieves an internal connection that is authenticated as a root user that is not subject to access control. |
InternalConnection |
getInternalUserConnection(boolean usePolicyFromConnection)
Retrieves an internal connection that is authenticated as the same user as the associated client connection. |
java.util.List<java.lang.String> |
getMatchedConnectionCriteria()
Returns a List containing the names of all the Connection
Criteria that match this connection. |
java.lang.String |
getProtocol()
Retrieves the name of the protocol that the client is using to communicate with the server. |
ServerContext |
getServerContext()
Retrieves information about the server with which the client connection is associated. |
java.net.InetAddress |
getServerInetAddress()
Retrieves an InetAddress representing the address on the server to
which the client established the connection, if available. |
boolean |
isAuthenticated()
Indicates whether the client has authenticated to the server. |
boolean |
isInternal()
Indicates whether this represents an internal client connection. |
boolean |
isSecure()
Indicates whether the client is communicating with the server in a secure manner. |
boolean |
matchesConnectionCriteria(java.lang.String criteriaName)
Determines whether this ClientContext matches the given Connection
Criteria. |
void |
sendUnsolicitedNotification(java.lang.String oid,
ResultCode resultCode,
java.lang.String message)
Attempts to send an unsolicited notification to the client with the provided information. |
java.lang.String |
toString()
Retrieves a string representation of the client connection. |
Method Detail |
---|
long getConnectionID()
java.util.List<java.lang.String> getMatchedConnectionCriteria()
List
containing the names of all the Connection
Criteria that match this connection. These are the configuration names
(e.g. the RDNs, not the full DNs) of the Connection Criteria.
boolean matchesConnectionCriteria(java.lang.String criteriaName)
ClientContext
matches the given Connection
Criteria.
criteriaName
- the name (not the DN) of the Connection Criteria to
check against.
ClientContext
matches the specified
Connection Criteria, false otherwise.boolean isInternal()
true
if this represents an internal client connection, or
false
if it is from an external client.InternalConnection getInternalRootConnection(boolean usePolicyFromConnection)
usePolicyFromConnection
- If true
, the internal connection
will use the same client connection policy
as the associated client connection. If
false
, the internal connection
will use the server's default client
connection policy for internal
connections.
InternalConnection getInternalUserConnection(boolean usePolicyFromConnection) throws LDAPException
usePolicyFromConnection
- If true
, the internal connection
will use the same client connection policy
as the associated client connection. If
false
, the internal connection
will use the server's default client
connection policy for internal
connections.
LDAPException
- If a problem occurs while attempting to obtain or
authenticate the connection.InternalConnection getInternalConnection(java.lang.String dn, boolean usePolicyFromConnection) throws LDAPException
dn
- The DN of the user as whom the connection
should be authenticated. It may be
null
or empty if the connection
should be unauthenticated.usePolicyFromConnection
- If true
, the internal connection
will use the same client connection policy
as the associated client connection. If
false
, the internal connection
will use the server's default client
connection policy for internal
connections.
LDAPException
- If a problem occurs while attempting to
authenticate as the specified user.boolean isSecure()
true
if the client is communicating with the server in a
secure manner, or false
if not.java.lang.String getProtocol()
long getConnectTime()
java.net.InetAddress getClientInetAddress()
InetAddress
representing the address of the client
system, if available.
InetAddress
representing the address of the client
system, or null
if that is not available or applicable for
the associated client connection.java.net.InetAddress getServerInetAddress()
InetAddress
representing the address on the server to
which the client established the connection, if available.
null
if that is not available or
applicable.boolean isAuthenticated()
true
if the client has authenticated to the server, or
false
if not.AuthInfo getAuthInfo()
void sendUnsolicitedNotification(java.lang.String oid, ResultCode resultCode, java.lang.String message)
oid
- The OID for the unsolicited notification. It must not
be null
.resultCode
- The result code to use for the unsolicited
notification. It must not be null
.message
- A message to include in the unsolicited notification.
It may be null
if no message is needed.void disconnect(DisconnectReason reason, boolean notifyClient, java.lang.String message)
reason
- A general reason that the connection was closed.notifyClient
- Indicates whether to attempt to send a notice of
disconnection to the client.message
- A message with information about the reason for the
disconnect. It may be null
if none is
available. It is generally recommended that a
message be provided even if the client should not be
notified, since the message may be used in other
ways (e.g., in log messages).ServerContext getServerContext()
java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |