Package io.milton.ldap
Class LdapServer
java.lang.Object
java.lang.Thread
io.milton.ldap.LdapServer
- All Implemented Interfaces:
Runnable
LDAP server, handle LDAP directory requests.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault LDAP portprotected booleanFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionLdapServer(LdapTransactionManager txManager, UserFactory userSessionFactory, int port, boolean nosslFlag, String bindAddress, PropFindPropertyBuilder propFindPropertyBuilder) Create a ServerSocket to listen for connections.LdapServer(LdapTransactionManager txManager, UserFactory userSessionFactory, PropFindPropertyBuilder propFindPropertyBuilder) LdapServer(LdapTransactionManager txManager, UserFactory userSessionFactory, WebDavProtocol webDavProtocol, PropFindPropertyBuilder propFindPropertyBuilder) This constructor is for convenience. -
Method Summary
Modifier and TypeMethodDescriptionvoidbind()Bind server socket on defined port.voidclose()Close server socketcreateConnectionHandler(Socket clientSocket) intgetPort()Server socket TCP portbooleanbooleanvoidrun()The body of the server thread.voidsetAllowRemote(boolean allowRemote) voidsetBindAddress(String bindAddress) voidsetKeystoreFile(File keystoreFile) voidsetKeystorePass(String keystorePass) voidsetKeystoreType(String keystoreType) voidsetNosslFlag(boolean nosslFlag) voidsetPort(int port) voidstart()Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
Field Details
-
DEFAULT_PORT
public static final int DEFAULT_PORTDefault LDAP port- See Also:
-
nosslFlag
protected boolean nosslFlag
-
-
Constructor Details
-
LdapServer
public LdapServer(LdapTransactionManager txManager, UserFactory userSessionFactory, int port, boolean nosslFlag, String bindAddress, PropFindPropertyBuilder propFindPropertyBuilder) Create a ServerSocket to listen for connections. Start the thread.- Parameters:
port- pop listen port, 389 if not defined (0)
-
LdapServer
public LdapServer(LdapTransactionManager txManager, UserFactory userSessionFactory, PropFindPropertyBuilder propFindPropertyBuilder) -
LdapServer
public LdapServer(LdapTransactionManager txManager, UserFactory userSessionFactory, WebDavProtocol webDavProtocol, PropFindPropertyBuilder propFindPropertyBuilder) This constructor is for convenience. It uses the list of property sources from the WebDavProtocol object, freeing the developer from the need to publicly declare property sources when only the built in ones are used.- Parameters:
userSessionFactory-webDavProtocol-
-
-
Method Details
-
isNosslFlag
public boolean isNosslFlag() -
setNosslFlag
public void setNosslFlag(boolean nosslFlag) -
getBindAddress
-
setBindAddress
-
setPort
public void setPort(int port) -
getProtocolName
-
createConnectionHandler
-
start
public void start() -
bind
Bind server socket on defined port.- Throws:
DavMailException- unable to create server socketException
-
run
public void run()The body of the server thread. Loop forever, listening for and accepting connections from clients. For each connection, create a Connection object to handle communication through the new Socket. -
close
public void close()Close server socket -
getPort
public int getPort()Server socket TCP port- Returns:
- port
-
getKeystorePass
-
setKeystorePass
-
getKeystoreType
-
setKeystoreType
-
getKeystoreFile
-
setKeystoreFile
-
isAllowRemote
public boolean isAllowRemote() -
setAllowRemote
public void setAllowRemote(boolean allowRemote)
-