public class ConnectionManager
extends java.lang.Object
Constructor and Description |
---|
ConnectionManager(Profile defaultProfile)
Takes a profile to use as default profile for new
Connections
|
Modifier and Type | Method and Description |
---|---|
void |
addWriteRequestListener(WriteRequestListener listener)
Adds a listener to be notified of all writes
|
IRCEventListener |
getDefaultEventHandler()
Gets the InternalEventHandler to use for this Session.
|
InternalEventParser |
getDefaultInternalEventParser()
Get the InternalEventParser used for this Session.
|
Profile |
getDefaultProfile()
gets the default profile used for new connections
|
int |
getRetries() |
Session |
getSession(java.lang.String name)
gets a session by name
|
java.util.List<Session> |
getSessions()
get a list of Sessions
|
java.util.List<WriteRequestListener> |
getWriteListeners()
gets an unmodifiable list of WriteListeners
|
void |
quit()
Closes all Sessions and exits library
|
void |
quit(java.lang.String quitMsg)
Closes all connections and shuts down manager
|
Session |
requestConnection(java.lang.String hostName)
request a new connection to a host with the default port of 6667
|
Session |
requestConnection(java.lang.String hostName,
int port)
request a new connection to a host
|
Session |
requestConnection(java.lang.String hostName,
int port,
Profile profile)
request a new connection to a host
|
void |
setAutoReconnect(boolean bool) |
void |
setAutoReconnect(int amountTries) |
void |
setDefaultInternalEventHandler(IRCEventListener handler)
Sets the InternalEventHandler to use for this Session.
|
void |
setDefaultInternalEventParser(InternalEventParser parser)
Set the InternalEventParser used for this Session.
|
void |
setDefaultProfile(Profile profile)
sets the default profile to use for new connections
|
public void setAutoReconnect(boolean bool)
public void setAutoReconnect(int amountTries)
public int getRetries()
public java.util.List<Session> getSessions()
public Session getSession(java.lang.String name)
name
- session name - the hostname of the server this session is forpublic void addWriteRequestListener(WriteRequestListener listener)
listener
- to be notifiedpublic java.util.List<WriteRequestListener> getWriteListeners()
public Session requestConnection(java.lang.String hostName)
hostName
- DNS name or IP of host to connect toSession
for this connectionpublic Session requestConnection(java.lang.String hostName, int port)
hostName
- DNS name or IP of host to connect toport
- port to use for connectionSession
for this connectionpublic Session requestConnection(java.lang.String hostName, int port, Profile profile)
hostName
- DNS name or IP of host to connect toport
- port to use for connectionprofile
- profile to use for this connectionSession
for this connectionpublic void quit(java.lang.String quitMsg)
quitMsg
- quit messagepublic void quit()
public Profile getDefaultProfile()
public void setDefaultProfile(Profile profile)
profile
- default profile to use for connectionspublic void setDefaultInternalEventHandler(IRCEventListener handler)
handler
- IRCEventListener
,
DefaultInternalEventHandler
public IRCEventListener getDefaultEventHandler()
public void setDefaultInternalEventParser(InternalEventParser parser)
parser
- public InternalEventParser getDefaultInternalEventParser()