|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.api.ConnectionSecurityProvider
org.opends.server.extensions.NullConnectionSecurityProvider
public class NullConnectionSecurityProvider
This class provides an implementation of a connection security provider that does not actually provide any security for the communication process. Any data read or written will be assumed to be clear text.
Constructor Summary | |
---|---|
|
NullConnectionSecurityProvider()
Creates a new instance of this connection security provider. |
protected |
NullConnectionSecurityProvider(ClientConnection clientConnection,
java.nio.channels.SocketChannel socketChannel)
Creates a new instance of this connection security provider that will be associated with the provided client connection. |
Method Summary | |
---|---|
void |
disconnect(boolean connectionValid)
Indicates that the associated client connection is being closed and that this security provider should perform any necessary processing to deal with that. |
void |
finalizeConnectionSecurityProvider()
Performs any finalization that may be necessary for this connection security provider. |
int |
getClearBufferSize()
Retrieves the size in bytes that the client should use for the byte buffer meant to hold clear-text data read from or to be written to the client. |
int |
getEncodedBufferSize()
Retrieves the size in bytes that the client should use for the byte buffer meant to hold encoded data read from or to be written to the client. |
java.lang.String |
getSecurityMechanismName()
Retrieves the name used to identify this security mechanism. |
void |
initializeConnectionSecurityProvider(ConfigEntry configEntry)
Initializes this connection security provider using the information in the provided configuration entry. |
boolean |
isSecure()
Indicates whether client connections using this connection security provider should be considered secure. |
ConnectionSecurityProvider |
newInstance(ClientConnection clientConnection,
java.nio.channels.SocketChannel socketChannel)
Creates a new instance of this connection security provider that will be used to encode and decode all communication on the provided client connection. |
boolean |
readData()
Reads data from a client connection, performing any necessary negotiation in the process. |
boolean |
writeData(java.nio.ByteBuffer clearData)
Writes the data contained in the provided clear-text buffer to the client, performing any necessary encoding in the process. |
static boolean |
writeWithTimeout(ClientConnection clientConnection,
java.nio.channels.SocketChannel socketChannel,
java.nio.ByteBuffer buffer)
Writes the contents of the provided buffer to the client, terminating the connection if the write is unsuccessful for too long (e.g., if the client is unresponsive or there is a network problem). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NullConnectionSecurityProvider()
initializeConnectionSecurityProvider
method. Also note that
this instance should only be used to create new instances that are
associated with specific client connections. This instance itself should
not be used to attempt secure communication with the client.
protected NullConnectionSecurityProvider(ClientConnection clientConnection, java.nio.channels.SocketChannel socketChannel)
clientConnection
- The client connection with which this connection
security provider should be associated.socketChannel
- The socket channel that may be used to
communicate with the client.Method Detail |
---|
public void initializeConnectionSecurityProvider(ConfigEntry configEntry) throws ConfigException, InitializationException
initializeConnectionSecurityProvider
in class ConnectionSecurityProvider
configEntry
- The entry that contains the configuration
for this connection security provider.
ConfigException
- If the provided entry does not contain
an acceptable configuration for this
security provider.
InitializationException
- If a problem occurs during
initialization that is not
related to the provided
configuration.public void finalizeConnectionSecurityProvider()
finalizeConnectionSecurityProvider
in class ConnectionSecurityProvider
public java.lang.String getSecurityMechanismName()
getSecurityMechanismName
in class ConnectionSecurityProvider
public boolean isSecure()
isSecure
in class ConnectionSecurityProvider
true
if client connections using this connection
security provider should be considered secure, or
false
if not.public ConnectionSecurityProvider newInstance(ClientConnection clientConnection, java.nio.channels.SocketChannel socketChannel) throws DirectoryException
newInstance
in class ConnectionSecurityProvider
clientConnection
- The client connection with which this
security provider will be associated.socketChannel
- The socket channel that may be used to
communicate with the client.
DirectoryException
- If a problem occurs while creating a
new instance of this security
provider for the given client
connection.public void disconnect(boolean connectionValid)
disconnect
in class ConnectionSecurityProvider
connectionValid
- Indicates whether the Directory Server
believes that the client connection is
still valid and may be used for
communication with the client. Note
that this may be inaccurate, or that the
state of the connection may change
during the course of this method, so the
security provider must be able to handle
failures if they arise.public int getClearBufferSize()
getClearBufferSize
in class ConnectionSecurityProvider
public int getEncodedBufferSize()
getEncodedBufferSize
in class ConnectionSecurityProvider
public boolean readData()
ClientConnection.processDataRead
method.
readData
in class ConnectionSecurityProvider
true
if all the data in the provided buffer was
processed and the client connection can remain
established, or false
if a decoding error
occurred and requests from this client should no longer
be processed. Note that if this method does return
false
, then it must have already disconnected
the client.public boolean writeData(java.nio.ByteBuffer clearData)
getClearBufferSize
method.
When this method returns, the provided buffer should be in its
original state with regard to the position and limit.
writeData
in class ConnectionSecurityProvider
clearData
- The buffer containing the clear-text data to
write to the client.
true
if all the data in the provided buffer was
written to the client and the connection may remain
established, or false
if a problem occurred and
the client connection is no longer valid. Note that if
this method does return false
, then it must have
already disconnected the client.public static boolean writeWithTimeout(ClientConnection clientConnection, java.nio.channels.SocketChannel socketChannel, java.nio.ByteBuffer buffer) throws java.io.IOException
ClientConnection.getWriteSelector
method, but it is capable of
working even if that method returns null
.
clientConnection
- The client connection to which the data is to be
written.socketChannel
- The socket channel over which to write the data.buffer
- The data to be written to the client.
true
if all the data in the provided buffer was
written to the client and the connection may remain established,
or false
if a problem occurred and the client
connection is no longer valid. Note that if this method does
return false
, then it must have already disconnected
the client.
java.io.IOException
- If a problem occurs while attempting to write data
to the client. The caller will be responsible for
catching this and terminating the client connection.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |