com.leafdigital.irc.api
Interface Connections

All Superinterfaces:
Singleton

public interface Connections
extends Singleton

Singleton holding references to all current server connections. Can be used to create a new server connection or obtain the list of current ones.


Method Summary
 Server[] getConnected()
          Returns array of connected servers.
 Server getNumbered(int index)
          Obtains the currently-connected server of the given index.
 Server newServer()
          Creates a new Server object.
 void setDefaultMessageDisplay(DefaultMessageDisplay dmd)
          Sets up a link that the plugin can use to get a default MessageDisplay for the given server.
 

Method Detail

newServer

Server newServer()
Creates a new Server object. The server is not immediately connected; it's up to the caller to connect it. Until it is connected it will not appear in the lists of connected servers.

Returns:
Newly-created Server object

getNumbered

Server getNumbered(int index)
                   throws java.lang.ArrayIndexOutOfBoundsException
Obtains the currently-connected server of the given index. Indices start from 1 because these are user-typed.

Parameters:
index - Index (beginning from 1)
Returns:
Server object
Throws:
java.lang.ArrayIndexOutOfBoundsException - If there is no server of that index

getConnected

Server[] getConnected()
Returns array of connected servers.

Returns:
Server array (zero-length if not connected)

setDefaultMessageDisplay

void setDefaultMessageDisplay(DefaultMessageDisplay dmd)
Sets up a link that the plugin can use to get a default MessageDisplay for the given server.

Parameters:
dmd - Default message display provider


Copyright © 2011 Samuel Marshall. All rights reserved.