|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--wtanaka.praya.Protocol
|
+--wtanaka.praya.gale.GaleClient
Protocol subclass for the gale messaging system. A GaleClient multiplexes a single connection to a server using any number of gale session objects.
Return to
or the Praya Homepage
Multiplexer, Serialized Form| Field Summary | |
(package private) static int |
BACKGROUND_TIMEOUT
Amount of time in milliseconds to wait for a key response in the background. |
static java.lang.String |
CLASS
|
private static int |
CONF_GALE_CONNECT_STATUS
|
private static int |
CONF_GALE_FROM
|
private static int |
CONF_GALE_ID
|
private static int |
CONF_GALE_ITEM_COUNT
|
private static int |
CONF_GALE_PORT
|
private static int |
CONF_GALE_SERVER
|
private static int |
CONF_GALE_SUBSCRIBE
|
private static int |
CONF_GALE_SYS_DIR
|
private java.lang.String |
currentServer
|
static java.lang.String |
DEFAULT_SERVER
|
private int |
m_akdCounter
|
private ConfigItem[] |
m_configItems
|
private GaleConnection |
m_connection
|
private java.lang.String |
m_defaultDomain
|
private java.util.Vector |
m_inMemoryPrivateKeyList
Used to augment the list fetched from the disk. |
private Multiplexer |
m_multiplexer
|
private int |
m_pseudoPid
|
private Status |
m_status
Present status. |
(package private) static int |
MAX_TIMEOUT
Maximum timeout to wait for key response. |
private GaleReadThread |
myThread
|
private static java.lang.String |
PREFIX_SESSION_AKD
|
private static java.lang.String |
s_tty
|
private static java.lang.String |
SESSION_AKD
|
private static java.lang.String |
SESSION_MAIN
|
private static java.lang.String |
SESSION_OWO_AKD
|
private static java.lang.String |
SESSION_OWO_RECEIPT
|
private static java.lang.String |
SESSION_RECEIPT
|
private static java.lang.String |
SESSION_RECIPIENT
|
private static java.lang.String[] |
STATUS_STRINGS
|
| Fields inherited from class wtanaka.praya.Protocol |
descriptionListeners, iAmGarbage, m_buddyList, m_configPanel, m_currentDescription, m_messageListeners, recipientListeners |
| Constructor Summary | |
GaleClient()
Constructor |
|
| Method Summary | |
protected void |
addRecipient(Recipient r,
Status s)
Adds a recipient to this protocol's buddy list. |
private void |
addSessions()
|
(package private) java.lang.String |
arrayToSpaceSeparated(Location[] array)
Helper method which converts an array of Location into a space separated String. |
(package private) void |
assertConnected()
If we are not connected, throw a NotSentException |
private void |
broadcastLoginNotice()
|
private void |
broadcastLogoutMessage()
|
void |
checkForNewMessages(boolean isAutomatic)
New messages are posted from my thread, so this doesn't need to do anything. |
void |
connect()
Connects to the network, if that makes any sense. |
CommandInterface[] |
consoleCommands()
Returns a list of commands available through this console. |
(package private) PuffOperation |
constructOutgoingPuff(Category[] cats,
java.lang.String msg)
Common parts of sendEncrypted() and sendPublic() |
void |
disconnect()
Disconnects from the network, if that makes any sense. |
(package private) PuffOperation |
encryptPuff(PuffOperation puff,
Location[] ids)
encrypts a puff |
(package private) PuffOperation |
encryptPuff(PuffOperation puff,
java.lang.String[] ids)
Deprecated. use encryptPuff (PuffOperation, Location[]) instead |
void |
fetchKeyFor(Location location)
For the given ID, in a new thread, opens a connection to the server, listens for that ID's key, and sends a request out for someone to serve up the key. |
private GalePublicKey |
fetchWaitGetKey(long timeout,
Location id)
|
private void |
gale_set(java.lang.String name,
java.lang.String value)
|
private java.lang.String |
galeConfDir()
|
private void |
generateKeys()
Attempts to generate a signed username@praya.gale.org key. |
ConfigItem[] |
getConfiguration()
|
(package private) GaleConnection |
getConnection()
|
(package private) java.lang.String |
getDefaultDomain()
|
Recipient |
getDefaultRecipient()
|
(package private) java.lang.String |
getFrom()
|
static java.awt.Image |
getIcon()
|
(package private) java.lang.String |
getIdClass()
Gives the id/class of this GaleClient instance. |
(package private) java.lang.String |
getIdInstance()
The correct form for the id/instance fragment is GALE_DOMAIN/HOST/USER/TTY/PID where any "variable" may be replaced with an empty string if it is not applicable. |
(package private) java.lang.String |
getNoticePresence()
Gives the notice/presence of this GaleClient instance. |
private NWOSubscriptionList |
getNWOSubscriptions()
|
private SubscriptionList |
getOWOSubscriptions()
|
private int |
getPort()
|
static java.lang.String |
getProtocolDescription()
Used to describe the class of this protocol, before any instances have been created. |
private java.lang.String |
getServer()
|
(package private) java.lang.String |
getSignAsID()
|
private static java.lang.String |
getTTY()
|
boolean |
isConnected()
Returns if the protocol is connected right now. |
private static void |
populateTTY()
Ensures that the s_tty variable is set. |
private java.lang.String[] |
privateKeyList()
Gets the list of private keys available. |
(package private) void |
readConfigurationFile(java.io.BufferedReader reader)
Reads a gale configuration file. |
private void |
readUserConf()
|
private void |
resubscribeAKD()
|
void |
sendEncrypted(Category[] cats,
java.lang.String msg,
java.lang.String[] ids)
|
void |
sendPublic(Category[] cats,
java.lang.String msg)
|
void |
sendPublic(java.lang.String cat,
java.lang.String msg)
Deprecated. use Category[] version instead |
(package private) void |
sendPuff(PuffOperation puff)
|
private void |
setConnectStatus(boolean connected)
|
private void |
setDefaultDomain(java.lang.String domain)
|
private void |
setFrom(java.lang.String from)
|
void |
setStatus(Status status)
Sends a message to set the status to the given status. |
private void |
setSubs(NWOSubscriptionList subs)
|
(package private) PuffOperation |
signPuff(PuffOperation puff)
|
(package private) Location[] |
spaceSeparatedToArray(java.lang.String spaceSep)
Helper method which converts a space separated string into an array of Location. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private GaleConnection m_connection
private Multiplexer m_multiplexer
private GaleReadThread myThread
private java.lang.String currentServer
private int m_akdCounter
private static final int CONF_GALE_ID
private static final int CONF_GALE_FROM
private static final int CONF_GALE_SERVER
private static final int CONF_GALE_PORT
private static final int CONF_GALE_SUBSCRIBE
private static final int CONF_GALE_CONNECT_STATUS
private static final int CONF_GALE_SYS_DIR
private static final int CONF_GALE_ITEM_COUNT
private static final java.lang.String SESSION_MAIN
private static final java.lang.String SESSION_AKD
private static final java.lang.String SESSION_OWO_AKD
private static final java.lang.String SESSION_RECEIPT
private static final java.lang.String SESSION_OWO_RECEIPT
private static final java.lang.String SESSION_RECIPIENT
private static final java.lang.String PREFIX_SESSION_AKD
public static final java.lang.String DEFAULT_SERVER
private Status m_status
private java.lang.String m_defaultDomain
static final int BACKGROUND_TIMEOUT
static final int MAX_TIMEOUT
private ConfigItem[] m_configItems
private static final java.lang.String[] STATUS_STRINGS
public static final java.lang.String CLASS
private static java.lang.String s_tty
private final int m_pseudoPid
private java.util.Vector m_inMemoryPrivateKeyList
| Constructor Detail |
public GaleClient()
| Method Detail |
private void resubscribeAKD()
throws java.io.IOException
private void generateKeys()
throws java.io.IOException,
java.security.NoSuchAlgorithmException
java.io.IOException - if the signing operation fails.private void readUserConf()
private java.lang.String[] privateKeyList()
private void addSessions()
java.lang.String getDefaultDomain()
private void setDefaultDomain(java.lang.String domain)
private static void populateTTY()
private static java.lang.String getTTY()
java.lang.String getIdInstance()
java.lang.String getIdClass()
CLASSjava.lang.String getNoticePresence()
java.lang.String getSignAsID()
protected void addRecipient(Recipient r,
Status s)
ProtocoladdRecipient in class Protocolprivate java.lang.String galeConfDir()
public ConfigItem[] getConfiguration()
getConfiguration in class Protocolwtanaka.praya.Protocolprivate int getPort()
private java.lang.String getServer()
java.lang.String getFrom()
private void setFrom(java.lang.String from)
private void setSubs(NWOSubscriptionList subs)
throws java.io.IOException
private NWOSubscriptionList getNWOSubscriptions()
private SubscriptionList getOWOSubscriptions()
GaleConnection getConnection()
private void setConnectStatus(boolean connected)
void readConfigurationFile(java.io.BufferedReader reader)
throws java.io.IOException
reader - the BufferedReader from which to read the
configuration file
private void gale_set(java.lang.String name,
java.lang.String value)
throws java.io.IOException
public void checkForNewMessages(boolean isAutomatic)
checkForNewMessages in class Protocolwtanaka.praya.ProtocolisAutomatic - true if the check is generated automatically with a
timer. false if the check is generated manually by the user.public boolean isConnected()
ProtocolisConnected in class Protocol
public void connect()
throws java.io.IOException
Protocolconnect in class Protocolwtanaka.praya.Protocoljava.io.IOException - if the connection fails due to an I/O error.java.lang.InterruptedException - todo, why does it throw this?public void disconnect()
Protocoldisconnect in class Protocol
public void setStatus(Status status)
throws java.io.IOException
setStatus in class Protocolpublic CommandInterface[] consoleCommands()
ProtocolconsoleCommands in class Protocol
public void fetchKeyFor(Location location)
throws java.io.IOException
public Recipient getDefaultRecipient()
getDefaultRecipient in class Protocol
void assertConnected()
throws NotSentException
PuffOperation constructOutgoingPuff(Category[] cats,
java.lang.String msg)
throws java.io.IOException
cat - the category to send on
PuffOperation signPuff(PuffOperation puff)
throws java.io.IOException
private GalePublicKey fetchWaitGetKey(long timeout,
Location id)
throws java.io.IOException
PuffOperation encryptPuff(PuffOperation puff,
java.lang.String[] ids)
throws java.io.IOException,
NotSentException
PuffOperation encryptPuff(PuffOperation puff,
Location[] ids)
throws java.io.IOException,
NotSentException
public void sendEncrypted(Category[] cats,
java.lang.String msg,
java.lang.String[] ids)
throws java.io.IOException,
NotSentException
Location[] spaceSeparatedToArray(java.lang.String spaceSep)
java.lang.String arrayToSpaceSeparated(Location[] array)
void sendPuff(PuffOperation puff)
throws java.io.IOException
public void sendPublic(Category[] cats,
java.lang.String msg)
throws java.io.IOException,
NotSentException
public void sendPublic(java.lang.String cat,
java.lang.String msg)
throws java.io.IOException,
NotSentException
private void broadcastLoginNotice()
private void broadcastLogoutMessage()
public static java.awt.Image getIcon()
public static java.lang.String getProtocolDescription()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||