|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.slamd.example.SLAMDLDAPSocketFactory
public class SLAMDLDAPSocketFactory
This class provides a simple LDAP socket factory that creates plain sockets that are well-suited for LDAP performance and benchmarking. In particular, it sets the TCP_NODELAY option to ensure that requests packets are sent as quickly as possible, and it uses the SO_LINGER and SO_REUSEADDR options to be well-suited for lots of short-lived connections.
| Constructor Summary | |
|---|---|
SLAMDLDAPSocketFactory()
Creates a new instance of this LDAP socket factory with the default settings. |
|
SLAMDLDAPSocketFactory(boolean setKeepAlive,
boolean setLinger,
boolean setReuseAddress,
boolean setTCPNoDelay)
Creates a new instance of this LDAP socket factory with the provided settings. |
|
| Method Summary | |
|---|---|
int |
getConnectTimeout()
Retrieves the maximum length of time in milliseconds to wait while attempting to connect before giving up. |
boolean |
getKeepAlive()
Indicates whether the SO_KEEPALIVE socket option should be used for new connections. |
boolean |
getLinger()
Indicates whether the SO_LINGER socket option should be used for new connections. |
boolean |
getReuseAddress()
Indicates whether the SO_REUSEADDR socket option should be used for new connections. |
boolean |
getTCPNoDelay()
Indicates whether the TCP_NODELAY socket option should be used for new connections. |
java.net.Socket |
makeSocket(java.lang.String host,
int port)
Establishes a socket to the provided host and port with the specified settings that can be used by the LDAP SDK for Java. |
void |
setConnectTimeout(int connectTimeout)
Specifies the maximum length of time in milliseconds to wait while attempting to connect before giving up. |
void |
setKeepAlive(boolean setKeepAlive)
Specifies whether to use the SO_KEEPALIVE socket option. |
void |
setLinger(boolean setLinger)
Specifies whether to use the SO_LINGER socket option. |
void |
setReuseAddress(boolean setReuseAddress)
Specifies whether to use the SO_REUSEADDR socket option. |
void |
setTCPNoDelay(boolean setTCPNoDelay)
Specifies whether to use the TCP_NODELAY socket option. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SLAMDLDAPSocketFactory()
public SLAMDLDAPSocketFactory(boolean setKeepAlive,
boolean setLinger,
boolean setReuseAddress,
boolean setTCPNoDelay)
setKeepAlive - Inkdicates whether to use the SO_KEEPALIVE socket
option.setLinger - Indicates whether to use the SO_LINGER socket
option.setReuseAddress - Indicates whether to use the SO_REUSEADDR socket
option.setTCPNoDelay - Indicates whether to use the TCP_NODELAY socket
option.| Method Detail |
|---|
public boolean getKeepAlive()
true if the SO_KEEPALIVE socket option should be
used, or false if not.public void setKeepAlive(boolean setKeepAlive)
setKeepAlive - Specifies whether to use the SO_KEEPALIVE socket
option.public boolean getLinger()
true if the SO_LINGER socket option should be used,
or false if not.public void setLinger(boolean setLinger)
setLinger - Specifies whether to use the SO_LINGER socket option.public boolean getReuseAddress()
true if the SO_REUSEADDR socket option should be
used, or false if not.public void setReuseAddress(boolean setReuseAddress)
setReuseAddress - Specifies whether to use the SO_REUSEADDR socket
option.public boolean getTCPNoDelay()
true if the TCP_NODELAY socket option should be used,
or false if not.public void setTCPNoDelay(boolean setTCPNoDelay)
setTCPNoDelay - Specifies whether to use the TCP_NODELAY socket
option.public int getConnectTimeout()
public void setConnectTimeout(int connectTimeout)
connectTimeout - The maximum length of time in milliseconds to wait
while attempting to connect before giving up.
public java.net.Socket makeSocket(java.lang.String host,
int port)
throws netscape.ldap.LDAPException
makeSocket in interface netscape.ldap.LDAPSocketFactoryhost - The address of the server to which the connection is to be
established.port - The port number of the server to which the connection is to
be established.
netscape.ldap.LDAPException - If a problem occurs while trying to establish the
connection.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||