|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.net.Socket
org.opends.server.protocols.internal.InternalLDAPSocket
@PublicAPI(stability=UNCOMMITTED,
mayInstantiate=true,
mayExtend=false,
mayInvoke=true)
public final class InternalLDAPSocket
This class provides an implementation of a java.net.Socket
object that can be used to facilitate internal communication with
the Directory Server through third-party LDAP APIs that provide the
ability to use a custom socket factory when creating connections.
Whenever data is written over the socket, it is decoded as LDAP
communication and converted to an appropriate internal operation,
which the server then processes and converts the response back to
an LDAP encoding.
Note that this implementation only supports those operations which
can be performed in the Directory Server via internal operations.
This includes add, compare, delete, modify, modify DN, and search
operations, and some types of extended operations. Special support
has been added for simple bind operations to function properly, but
SASL binds are not supported. Abandon and unbind operations are
not supported, nor are the cancel or StartTLS extended operations.
Only clear-text LDAP communication may be used.
| Constructor Summary | |
|---|---|
InternalLDAPSocket()
Creates a new internal LDAP socket. |
|
| Method Summary | |
|---|---|
void |
bind(java.net.SocketAddress bindpoint)
Binds the socket to a local address. |
void |
close()
Closes this socket. |
void |
connect(java.net.SocketAddress endpoint)
Connects this socket to the specified remote endpoint. |
void |
connect(java.net.SocketAddress endpoint,
int timeout)
Connects this socket to the specified remote endpoint. |
java.nio.channels.SocketChannel |
getChannel()
Retrieves the socket channel associated with this socket. |
java.net.InetAddress |
getInetAddress()
Retrieves the address to which this socket is connected. |
InternalLDAPInputStream |
getInputStream()
Retrieves the input stream for this socket. |
boolean |
getKeepAlive()
Indicates whether SO_KEEPALIVE is enabled. |
java.net.InetAddress |
getLocalAddress()
Retrieves the local address to which this socket is bound. |
int |
getLocalPort()
Retrieves the local port to which this socket is bound. |
java.net.SocketAddress |
getLocalSocketAddress()
Retrieves the local socket address to which this socket is bound. |
boolean |
getOOBInline()
Indicates whether OOBINLINE is enabled. |
InternalLDAPOutputStream |
getOutputStream()
Retrieves the output stream for this socket. |
int |
getPort()
Retrieves the remote port to which this socket is connected. |
int |
getReceiveBufferSize()
Retrieves the value of the SO_RCVBUF option for this socket. |
java.net.SocketAddress |
getRemoteSocketAddress()
Retrieves the remote socket address to which this socket is connected. |
boolean |
getReuseAddress()
Indicates whether SO_REUSEADDR is enabled. |
int |
getSendBufferSize()
Retrieves the value of the SO_SNDBUF option for this socket. |
int |
getSoLinger()
Retrieves the value of the SO_LINGER option for this socket. |
int |
getSoTimeout()
Retrieves the value of the SO_TIMEOUT option for this socket. |
boolean |
getTcpNoDelay()
Indicates whether TCP_NODELAY is enabled. |
int |
getTrafficClass()
Retrieves the traffic class for this socket. |
boolean |
isBound()
Indicates whether this socket is bound to a local address. |
boolean |
isClosed()
Indicates whether this socket is closed. |
boolean |
isConnected()
Indicates whether this socket is connected to both local and remote endpoints. |
boolean |
isInputShutdown()
Indicates whether the input side of this socket has been closed. |
boolean |
isOutputShutdown()
Indicates whether the output side of this socket has been closed. |
void |
sendUrgentData(int data)
Sends a single byte of urgent data over this socket. |
void |
setKeepAlive(boolean on)
Sets the value of SO_KEEPALIVE for this socket. |
void |
setOOBInline(boolean on)
Sets the value of OOBINLINE for this socket. |
void |
setPerformancePreferences(int connectionTime,
int latency,
int bandwidth)
Sets the provided performance preferences for this socket. |
void |
setReceiveBufferSize(int size)
Sets the value of SO_RCVBUF for this socket. |
void |
setReuseAddress(boolean on)
Sets the value of SO_REUSEADDR for this socket. |
void |
setSendBufferSize(int size)
Sets the value of SO_SNDBUF for this socket. |
void |
setSoLinger(boolean on,
int linger)
Sets the value of SO_LINGER for this socket. |
void |
setSoTimeout(int timeout)
Sets the value of SO_TIMEOUT for this socket. |
void |
setTcpNoDelay(boolean on)
Sets the value of TCP_NODELAY for this socket. |
void |
setTrafficClass(int tc)
Sets the traffic class for this socket. |
void |
shutdownInput()
Shuts down the input side of this socket. |
void |
shutdownOutput()
Shuts down the output side of this socket. |
java.lang.String |
toString()
Retrieves a string representation of this internal LDAP socket. |
| Methods inherited from class java.net.Socket |
|---|
setSocketImplFactory |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public InternalLDAPSocket()
| Method Detail |
|---|
public void bind(java.net.SocketAddress bindpoint)
bind in class java.net.Socketbindpoint - The socket address to which to bind.public void close()
close in class java.net.Socketpublic void connect(java.net.SocketAddress endpoint)
connect in class java.net.Socketendpoint - The address of the remote endpoint.
public void connect(java.net.SocketAddress endpoint,
int timeout)
connect in class java.net.Socketendpoint - The address of the remote endpoint.timeout - The maximum length of time in milliseconds to
wait for the connection to be established.public java.nio.channels.SocketChannel getChannel()
null since this implementation does
not support use with NIO channels.
getChannel in class java.net.Socketnull because this implementation does not
support use with NIO channels.public java.net.InetAddress getInetAddress()
getInetAddress in class java.net.Socketpublic InternalLDAPInputStream getInputStream()
getInputStream in class java.net.Socketpublic boolean getKeepAlive()
true by default, but if its value is changed
using setKeepalive then that value will be returned.
This setting has no effect in this socket implementation.
getKeepAlive in class java.net.Sockettrue if SO_KEEPALIVE is enabled, or
false if not.public java.net.InetAddress getLocalAddress()
getLocalAddress in class java.net.Socketpublic int getLocalPort()
getLocalPort in class java.net.Socketpublic java.net.SocketAddress getLocalSocketAddress()
getLocalSocketAddress in class java.net.Socketpublic boolean getOOBInline()
true by default, but if its value is changed
using setOOBInline then that value will be returned.
This setting has no effect in this socket implementation.
getOOBInline in class java.net.Sockettrue if OOBINLINE is enabled, or false
if it is not.public InternalLDAPOutputStream getOutputStream()
getOutputStream in class java.net.Socketpublic int getPort()
getPort in class java.net.Socketpublic int getReceiveBufferSize()
getReceiveBufferSize in class java.net.Socketpublic java.net.SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress in class java.net.Socketpublic boolean getReuseAddress()
true by default, but if its value is changed
using setReuseAddress then that value will be returned.
This setting has no effect in this socket implementation.
getReuseAddress in class java.net.Sockettrue if SO_REUSEADDR is enabled, or
false if it is not.public int getSendBufferSize()
getSendBufferSize in class java.net.Socketpublic int getSoLinger()
getSoLinger in class java.net.Socketpublic int getSoTimeout()
getSoTimeout in class java.net.Socketpublic boolean getTcpNoDelay()
true by default, but if its value is changed
using setTcpNoDelay then that value will be returned.
This setting has no effect in this socket implementation.
getTcpNoDelay in class java.net.Sockettrue if TCP_NODELAY is enabled, or false
if it is not.public int getTrafficClass()
getTrafficClass in class java.net.Socketpublic boolean isBound()
true to indicate that it is
bound.
isBound in class java.net.Sockettrue to indicate that the socket is bound to a
local address.public boolean isClosed()
false to indicate that it is not closed.
isClosed in class java.net.Socketfalse to indicate that the socket is not closed.public boolean isConnected()
true to
indicate that it is connected.
isConnected in class java.net.Sockettrue to indicate that the socket is connected.public boolean isInputShutdown()
false to indicate that it
is not closed.
isInputShutdown in class java.net.Socketfalse to indicate that the input side of this
socket is not closed.public boolean isOutputShutdown()
false to indicate that it
is not closed.
isOutputShutdown in class java.net.Socketfalse to indicate that the output side of this
socket is not closed.
public void sendUrgentData(int data)
throws java.io.IOException
sendUrgentData in class java.net.Socketdata - The data to be sent.
java.io.IOException - If a problem occurs while trying to write
the provided data over this socket.public void setKeepAlive(boolean on)
setKeepAlive in class java.net.Socketon - The value to use for the SO_KEEPALIVE option.public void setOOBInline(boolean on)
setOOBInline in class java.net.Socketon - The value to use for the OOBINLINE option.
public void setPerformancePreferences(int connectionTime,
int latency,
int bandwidth)
setPerformancePreferences in class java.net.SocketconnectionTime - An int expressing the relative
importance of a short connection time.latency - An int expressing the relative
importance of low latency.bandwidth - An int expressing the relative
importance of high bandwidth.public void setReceiveBufferSize(int size)
setReceiveBufferSize in class java.net.Socketsize - The value to use for the SO_RCVBUF option.public void setReuseAddress(boolean on)
setReuseAddress in class java.net.Socketon - The value to use for the SO_REUSEADDR option.public void setSendBufferSize(int size)
setSendBufferSize in class java.net.Socketsize - The value to use for the SO_SNDBUF option.
public void setSoLinger(boolean on,
int linger)
setSoLinger in class java.net.Socketon - Indicates whether to enable the linger option.linger - The length of time in milliseconds to allow the
connection to linger.public void setSoTimeout(int timeout)
setSoTimeout in class java.net.Sockettimeout - The value to use for the SO_TIMEOUT option.public void setTcpNoDelay(boolean on)
setTcpNoDelay in class java.net.Socketon - The value to use for the TCP_NODELAY option.public void setTrafficClass(int tc)
setTrafficClass in class java.net.Sockettc - The value to use for the traffic class.public void shutdownInput()
shutdownInput in class java.net.Socketpublic void shutdownOutput()
shutdownOutput in class java.net.Socketpublic java.lang.String toString()
toString in class java.net.Socket
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||