@PublicAPI(stability=UNCOMMITTED, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class InternalLDAPSocket extends Socket
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.
Constructor and Description |
---|
InternalLDAPSocket()
Creates a new internal LDAP socket.
|
Modifier and Type | Method and Description |
---|---|
void |
bind(SocketAddress bindpoint)
Binds the socket to a local address.
|
void |
close()
Closes this socket.
|
void |
connect(SocketAddress endpoint)
Connects this socket to the specified remote endpoint.
|
void |
connect(SocketAddress endpoint,
int timeout)
Connects this socket to the specified remote endpoint.
|
SocketChannel |
getChannel()
Retrieves the socket channel associated with this socket.
|
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.
|
InetAddress |
getLocalAddress()
Retrieves the local address to which this socket is bound.
|
int |
getLocalPort()
Retrieves the local port to which this socket is bound.
|
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.
|
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.
|
String |
toString()
Retrieves a string representation of this internal LDAP socket.
|
setSocketImplFactory
public InternalLDAPSocket()
public void bind(SocketAddress bindpoint)
public void close()
public void connect(SocketAddress endpoint)
public void connect(SocketAddress endpoint, int timeout)
public SocketChannel getChannel()
null
since this implementation does
not support use with NIO channels.getChannel
in class Socket
null
because this implementation does not
support use with NIO channels.public InetAddress getInetAddress()
getInetAddress
in class Socket
public InternalLDAPInputStream getInputStream()
getInputStream
in class Socket
public 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 Socket
true
if SO_KEEPALIVE is enabled, or
false
if not.public InetAddress getLocalAddress()
getLocalAddress
in class Socket
public int getLocalPort()
getLocalPort
in class Socket
public SocketAddress getLocalSocketAddress()
getLocalSocketAddress
in class Socket
public 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 Socket
true
if OOBINLINE is enabled, or false
if it is not.public InternalLDAPOutputStream getOutputStream()
getOutputStream
in class Socket
public int getPort()
public int getReceiveBufferSize()
getReceiveBufferSize
in class Socket
public SocketAddress getRemoteSocketAddress()
getRemoteSocketAddress
in class Socket
public 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 Socket
true
if SO_REUSEADDR is enabled, or
false
if it is not.public int getSendBufferSize()
getSendBufferSize
in class Socket
public int getSoLinger()
getSoLinger
in class Socket
public int getSoTimeout()
getSoTimeout
in class Socket
public 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 Socket
true
if TCP_NODELAY is enabled, or false
if it is not.public int getTrafficClass()
getTrafficClass
in class Socket
public boolean isBound()
true
to indicate that it is
bound.public boolean isClosed()
false
to indicate that it is not closed.public boolean isConnected()
true
to
indicate that it is connected.isConnected
in class Socket
true
to indicate that the socket is connected.public boolean isInputShutdown()
false
to indicate that it
is not closed.isInputShutdown
in class Socket
false
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 Socket
false
to indicate that the output side of this
socket is not closed.public void sendUrgentData(int data) throws IOException
sendUrgentData
in class Socket
data
- The data to be sent.IOException
- If a problem occurs while trying to write
the provided data over this socket.public void setKeepAlive(boolean on)
setKeepAlive
in class Socket
on
- The value to use for the SO_KEEPALIVE option.public void setOOBInline(boolean on)
setOOBInline
in class Socket
on
- The value to use for the OOBINLINE option.public void setPerformancePreferences(int connectionTime, int latency, int bandwidth)
setPerformancePreferences
in class Socket
connectionTime
- 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 Socket
size
- The value to use for the SO_RCVBUF option.public void setReuseAddress(boolean on)
setReuseAddress
in class Socket
on
- The value to use for the SO_REUSEADDR option.public void setSendBufferSize(int size)
setSendBufferSize
in class Socket
size
- The value to use for the SO_SNDBUF option.public void setSoLinger(boolean on, int linger)
setSoLinger
in class Socket
on
- 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 Socket
timeout
- The value to use for the SO_TIMEOUT option.public void setTcpNoDelay(boolean on)
setTcpNoDelay
in class Socket
on
- The value to use for the TCP_NODELAY option.public void setTrafficClass(int tc)
setTrafficClass
in class Socket
tc
- The value to use for the traffic class.public void shutdownInput()
shutdownInput
in class Socket
public void shutdownOutput()
shutdownOutput
in class Socket
Copyright © 2010-2016 ForgeRock AS. All Rights Reserved.