org.pandora.sense.chat
Class IRC

java.lang.Object
  extended by org.pandora.sense.BasicSense
      extended by org.pandora.sense.chat.IRC
All Implemented Interfaces:
Sense

public class IRC
extends BasicSense

Connect to and interact on IRC chat networks.


Field Summary
static int LAST_USERS
           
static int MAX_SPAM
           
static int SLEEP
           
 
Fields inherited from class org.pandora.sense.BasicSense
DEFAULT_SPEAKER, RETRY
 
Constructor Summary
IRC()
           
 
Method Summary
 void addLastUser(java.lang.String user)
           
 void addUser(java.lang.String user)
           
 boolean checkSpam(java.lang.String user, java.lang.String text)
          Ignore users that spam the same message repeatedly.
 void connect()
           
 void disconnect()
           
 org.relayirc.chatengine.Channel getChannel()
           
 java.util.List<org.relayirc.chatengine.ChannelListener> getChannelListeners()
           
 java.lang.String getChannelName()
           
 Vertex getConversation()
          Return the current conversation.
 java.lang.String getNick()
           
 java.lang.String getNickAlt()
           
 int getPort()
           
 java.lang.String getRealName()
           
 org.relayirc.chatengine.Server getServer()
           
 java.lang.String getServerName()
           
 java.lang.String getUserName()
           
 java.util.Map<java.lang.String,java.lang.String> getUserNicks()
           
 java.util.Set<java.lang.String> getUsers()
           
 void initialize()
           
 void input(java.lang.Object inputText, Network network)
          Process the input chat event.
 void inputSentence(java.lang.String text, java.lang.String userName, java.util.List<java.lang.String> targetUserNames, Network network)
          Process the text sentence.
 boolean isConnected()
           
 void output(Vertex output)
          Output the vertex to text.
 void removeUser(java.lang.String user)
           
 void setChannel(org.relayirc.chatengine.Channel channel)
           
 void setChannelListeners(java.util.List<org.relayirc.chatengine.ChannelListener> channelListeners)
           
 void setChannelName(java.lang.String channelName)
           
 void setConnected(boolean isConnected)
           
 void setConversation(Vertex conversation)
          Set the current conversation.
 void setNick(java.lang.String nick)
           
 void setNickAlt(java.lang.String nickAlt)
           
 void setPort(int port)
           
 void setRealName(java.lang.String realName)
           
 void setServer(org.relayirc.chatengine.Server server)
           
 void setServerName(java.lang.String serverName)
           
 void setUserName(java.lang.String userName)
           
 void setUserNicks(java.util.Map<java.lang.String,java.lang.String> userNicks)
           
 void setUsers(java.util.Set<java.lang.String> users)
           
 void shutdown()
          Stop sensing.
 java.lang.String trimSpecialChars(java.lang.String text)
          Trim special IRC command chars from the text.
 java.lang.String trimUserName(java.lang.String text)
          Trim non-letters and lower case.
 
Methods inherited from class org.pandora.sense.BasicSense
awake, getEmotionalState, getLanguageState, getName, getPandora, getPrimitive, getShortTermMemory, initialize, input, isEnabled, log, log, log, setEmotionalState, setIsEnabled, setLanguageState, setName, setPandora, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SLEEP

public static int SLEEP

MAX_SPAM

public static int MAX_SPAM

LAST_USERS

public static int LAST_USERS
Constructor Detail

IRC

public IRC()
Method Detail

initialize

public void initialize()

connect

public void connect()

shutdown

public void shutdown()
Stop sensing.

Specified by:
shutdown in interface Sense
Overrides:
shutdown in class BasicSense

disconnect

public void disconnect()

trimSpecialChars

public java.lang.String trimSpecialChars(java.lang.String text)
Trim special IRC command chars from the text.


trimUserName

public java.lang.String trimUserName(java.lang.String text)
Trim non-letters and lower case.


input

public void input(java.lang.Object inputText,
                  Network network)
Process the input chat event. Check the source user and check for a targeted user. Ignore if spam.

Specified by:
input in interface Sense
Overrides:
input in class BasicSense

checkSpam

public boolean checkSpam(java.lang.String user,
                         java.lang.String text)
Ignore users that spam the same message repeatedly.


inputSentence

public void inputSentence(java.lang.String text,
                          java.lang.String userName,
                          java.util.List<java.lang.String> targetUserNames,
                          Network network)
Process the text sentence.


output

public void output(Vertex output)
Output the vertex to text.

Specified by:
output in interface Sense
Overrides:
output in class BasicSense

addLastUser

public void addLastUser(java.lang.String user)

getServerName

public java.lang.String getServerName()

setServerName

public void setServerName(java.lang.String serverName)

getPort

public int getPort()

setPort

public void setPort(int port)

getNick

public java.lang.String getNick()

setNick

public void setNick(java.lang.String nick)

getNickAlt

public java.lang.String getNickAlt()

setNickAlt

public void setNickAlt(java.lang.String nickAlt)

getUserName

public java.lang.String getUserName()

setUserName

public void setUserName(java.lang.String userName)

getRealName

public java.lang.String getRealName()

setRealName

public void setRealName(java.lang.String realName)

getServer

public org.relayirc.chatengine.Server getServer()

setServer

public void setServer(org.relayirc.chatengine.Server server)

getChannel

public org.relayirc.chatengine.Channel getChannel()

setChannel

public void setChannel(org.relayirc.chatengine.Channel channel)

getChannelName

public java.lang.String getChannelName()

setChannelName

public void setChannelName(java.lang.String channelName)

getChannelListeners

public java.util.List<org.relayirc.chatengine.ChannelListener> getChannelListeners()

setChannelListeners

public void setChannelListeners(java.util.List<org.relayirc.chatengine.ChannelListener> channelListeners)

addUser

public void addUser(java.lang.String user)

removeUser

public void removeUser(java.lang.String user)

getUsers

public java.util.Set<java.lang.String> getUsers()

setUsers

public void setUsers(java.util.Set<java.lang.String> users)

isConnected

public boolean isConnected()

setConnected

public void setConnected(boolean isConnected)

getUserNicks

public java.util.Map<java.lang.String,java.lang.String> getUserNicks()

setUserNicks

public void setUserNicks(java.util.Map<java.lang.String,java.lang.String> userNicks)

getConversation

public Vertex getConversation()
Return the current conversation.


setConversation

public void setConversation(Vertex conversation)
Set the current conversation.