|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjerklib.ConnectionManager
public class ConnectionManager
This class is used to control/store Sessions/Connections. Request new connections with this class.
Constructor Summary | |
---|---|
ConnectionManager(Profile defaultProfile)
Takes a profile to use as default profile for new Connections |
Method Summary | |
---|---|
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 |
Session |
getSession(String name)
gets a session by name |
List<Session> |
getSessions()
get a list of Sessions |
List<WriteRequestListener> |
getWriteListeners()
gets an unmodifiable list of WriteListeners |
void |
quit()
Closes all Sessions and exits library |
void |
quit(String quitMsg)
Closes all connections and shuts down manager |
Session |
requestConnection(String hostName)
request a new connection to a host with the default port of 6667 |
Session |
requestConnection(String hostName,
int port)
request a new connection to a host |
Session |
requestConnection(String hostName,
int port,
Profile profile)
request a new connection to a host |
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 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionManager(Profile defaultProfile)
defaultProfile
- default user profileProfile
Method Detail |
---|
public List<Session> getSessions()
public Session getSession(String name)
name
- session name - the hostname of the server this session is for
public void addWriteRequestListener(WriteRequestListener listener)
listener
- to be notifiedpublic List<WriteRequestListener> getWriteListeners()
public Session requestConnection(String hostName)
hostName
- DNS name or IP of host to connect to
Session
for this connectionpublic Session requestConnection(String hostName, int port)
hostName
- DNS name or IP of host to connect toport
- port to use for connection
Session
for this connectionpublic Session requestConnection(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 connection
Session
for this connectionpublic void quit(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
- public IRCEventListener getDefaultEventHandler()
public void setDefaultInternalEventParser(InternalEventParser parser)
parser
- public InternalEventParser getDefaultInternalEventParser()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |