org.starhope.rahab
Class Rahab

java.lang.Object
  extended by org.starhope.rahab.Rahab

public class Rahab
extends Object

WRITEME: Document this type. twheys@gmail.com Dec 29, 2009

Author:
Tim Heys

Nested Class Summary
(package private)  class Rahab.DisplayInterfaceRunner
           
 
Field Summary
static String $EAVES
          WRITEME: Document this field.
static String $MOD
          WRITEME: Document this field.
protected  Timer antiTimeOut
           
protected  SpyUI applicationGUI
           
private  JFrame applicationWindow
           
private static Rahab client
          WRITEME: Document this field.
private  String currentZone
           
private  boolean echoRoomJoins
          Display room joins
(package private) static boolean isConnected
          WRITEME: Document this field.
(package private) static boolean isLoggedIn
          WRITEME: Document this field.
protected  String key
          WRITEME
protected static Logger logger
          WRITEME: Document this field.
static String LOGIN_ZONE
          WRITEME: Document this field.
private  SmartFauxEventListener messageEvent
          WRITEME
private  SmartFauxEventListener onConnection
          WRITEME
private  SmartFauxEventListener onConnectionLost
          WRITEME
private  SmartFauxEventListener onExtensionRequest
          WRITEME
private  SmartFauxEventListener onJoinRoom
          WRITEME
private  SmartFauxEventListener onJoinRoomError
          WRITEME
private  SmartFauxEventListener onRandomKey
          WRITEME
private  SmartFauxEventListener onRoomListUpdate
          WRITEME
private  SmartFauxEventListener onUserEnterRoom
           
private  SmartFauxEventListener onUserLeftRoom
           
private  String password
           
private static String roomPassword
          WRITEME: Document this field.
(package private)  String server
           
static String[] servers
          WRITEME: Document this field.
 SmartFauxClient sfClient
          Smart Fox Server
(package private)  TimerTask task
           
static String unitSep
          WRITEME: Document this field.
private  String userName
           
 
Constructor Summary
Rahab(String userNameAttempt, String passwordAttempt, String serverAttempt)
           twheys@gmail.com Dec 29, 2009
 
Method Summary
static void addJournalEntry(String entryText)
           twheys@gmail.com Jan 28, 2010
private  void connect()
           twheys@gmail.com Dec 30, 2009
protected  SpyUI createAndShowGUI()
          Create the GUI and show it.
static void createAndShowHTMLPage(String url)
           twheys@gmail.com Dec 29, 2009
static void createAndShowLoginPrompt()
           twheys@gmail.com Dec 29, 2009
static void createAndShowShiftJournal()
           twheys@gmail.com Dec 29, 2009
protected  void createAndShowZonePrompt(Vector<Zone> zones)
           twheys@gmail.com Dec 29, 2009
private  void createJournalExtension(String entryText)
           twheys@gmail.com Jan 28, 2010
protected  void disectMessageEvent(String messageEventParam)
           twheys@gmail.com Dec 30, 2009
private  void displayInterface()
           twheys@gmail.com Dec 29, 2009
private  void doMessageEventAction(String user, String room, Actions verb, String message)
           twheys@gmail.com Dec 30, 2009
protected  void extractLoginInfoFromJSON(org.json.JSONObject dataObj)
           twheys@gmail.com Dec 30, 2009
protected  void extractRoomListFromJSON(org.json.JSONObject dataObj)
           twheys@gmail.com Dec 30, 2009
protected  void extractUserListFromJSON(org.json.JSONObject dataObj)
           twheys@gmail.com Dec 30, 2009
protected static String getApple(String key, String pass)
           twheys@gmail.com Dec 30, 2009
private  String getRoomDisplayName(String room)
           twheys@gmail.com Dec 30, 2009
 void getUserAndRoomListsFromServer()
           twheys@gmail.com Jan 22, 2010
private  Vector<String> getUserListFromJSON(org.json.JSONObject userListJSON)
           twheys@gmail.com Dec 30, 2009
 JFrame getWindow()
           twheys@gmail.com Jan 22, 2010
protected  Vector<Zone> getZoneListFromJSON(org.json.JSONObject zoneList)
           twheys@gmail.com Dec 30, 2009
protected  void handleFailedLogin(String message)
           twheys@gmail.com Dec 29, 2009
private  void initSFListeners()
           twheys@gmail.com Dec 29, 2009
 boolean isEchoRoomJoins()
           
 void killSession(boolean andExit)
           twheys@gmail.com Jan 22, 2010
static void killSessionStatically(boolean andExit)
           twheys@gmail.com Feb 3, 2010
protected static void login(String username, String password, String server)
           twheys@gmail.com Dec 29, 2009
static void loginNewUser()
           twheys@gmail.com Jan 22, 2010
protected  void loginToZone(String zone)
           twheys@gmail.com Dec 29, 2009
static void main(String[] args)
           twheys@gmail.com Dec 29, 2009
private  void moveUser(String user, String room)
           twheys@gmail.com Dec 30, 2009
static void openResource(String url)
           twheys@gmail.com Jan 22, 2010
 void promptForZone(Vector<Zone> zones)
           twheys@gmail.com Dec 29, 2009
static void reloadUserAndRoomLists()
           
private  void removeUser(String user, String room)
           twheys@gmail.com Dec 30, 2009
private  void reportUser(String user, String room, String reportedUser)
           twheys@gmail.com Jan 5, 2010
 void retrieveZoneList()
           twheys@gmail.com Jan 22, 2010
static void retrieveZoneListStatically()
           twheys@gmail.com Feb 3, 2010
protected  void sendPublicCommand(String command, String[] params)
           twheys@gmail.com Dec 30, 2009
protected  void sendPublicMessage(String message)
           twheys@gmail.com Dec 30, 2009
private  void setAutoscrolls(boolean selected)
           twheys@gmail.com Feb 8, 2010
static void setAutoScrollsStatically(boolean selected)
           twheys@gmail.com Feb 8, 2010
static void setEchoJoinsStatically(boolean selected)
           twheys@gmail.com Mar 3, 2010
 void setEchoRoomJoins(boolean newEchoRoomJoins)
           
private  void showMessage(String user, String room, String message)
          Deprecated. use SpyUI.showSaidMessage(String, String, String) instead
private  void updateRoomListWithMovedUser(String user, String room)
           twheys@gmail.com Dec 30, 2009
static void validateUserStaffLevelOrExit(int staffLevel)
           twheys@gmail.com Dec 29, 2009
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

$EAVES

public static final String $EAVES
WRITEME: Document this field. twheys@gmail.com Dec 30, 2009

See Also:
Constant Field Values

$MOD

public static final String $MOD
WRITEME: Document this field. twheys@gmail.com Dec 30, 2009

See Also:
Constant Field Values

client

private static Rahab client
WRITEME: Document this field. twheys@gmail.com Dec 30, 2009


isConnected

static boolean isConnected
WRITEME: Document this field. twheys@gmail.com Dec 30, 2009


isLoggedIn

static boolean isLoggedIn
WRITEME: Document this field. twheys@gmail.com Dec 30, 2009


logger

protected static final Logger logger
WRITEME: Document this field. twheys@gmail.com Dec 30, 2009


LOGIN_ZONE

public static final String LOGIN_ZONE
WRITEME: Document this field. twheys@gmail.com Dec 30, 2009

See Also:
Constant Field Values

roomPassword

private static final String roomPassword
WRITEME: Document this field. twheys@gmail.com Dec 30, 2009

See Also:
Constant Field Values

servers

public static final String[] servers
WRITEME: Document this field. twheys@gmail.com Dec 30, 2009


unitSep

public static final String unitSep
WRITEME: Document this field. twheys@gmail.com Dec 30, 2009

See Also:
Constant Field Values

antiTimeOut

protected transient Timer antiTimeOut

applicationGUI

protected SpyUI applicationGUI

applicationWindow

private JFrame applicationWindow

currentZone

private String currentZone

echoRoomJoins

private boolean echoRoomJoins
Display room joins


key

protected String key
WRITEME


messageEvent

private final SmartFauxEventListener messageEvent
WRITEME


onConnection

private final SmartFauxEventListener onConnection
WRITEME


onConnectionLost

private final SmartFauxEventListener onConnectionLost
WRITEME


onExtensionRequest

private final SmartFauxEventListener onExtensionRequest
WRITEME


onJoinRoom

private final SmartFauxEventListener onJoinRoom
WRITEME


onJoinRoomError

private final SmartFauxEventListener onJoinRoomError
WRITEME


onRandomKey

private final SmartFauxEventListener onRandomKey
WRITEME


onRoomListUpdate

private final SmartFauxEventListener onRoomListUpdate
WRITEME


onUserEnterRoom

private final SmartFauxEventListener onUserEnterRoom

onUserLeftRoom

private final SmartFauxEventListener onUserLeftRoom

password

private final String password

server

final String server

sfClient

public final transient SmartFauxClient sfClient
Smart Fox Server


task

transient TimerTask task

userName

private final String userName
Constructor Detail

Rahab

public Rahab(String userNameAttempt,
             String passwordAttempt,
             String serverAttempt)
 twheys@gmail.com Dec 29, 2009
 
A Spy WRITEME...

Parameters:
userNameAttempt - WRITEME
passwordAttempt - WRITEME
serverAttempt - WRITEME
Method Detail

addJournalEntry

public static void addJournalEntry(String entryText)
 twheys@gmail.com Jan 28, 2010
 
TO addJournalEntry WRITEME...

Parameters:
entryText - WRITEME

createAndShowHTMLPage

public static void createAndShowHTMLPage(String url)
 twheys@gmail.com Dec 29, 2009
 
TO createAndShowLoginScreen WRITEME...

Parameters:
url - WRITEME

createAndShowLoginPrompt

public static void createAndShowLoginPrompt()
 twheys@gmail.com Dec 29, 2009
 
TO createAndShowLoginScreen WRITEME...


createAndShowShiftJournal

public static void createAndShowShiftJournal()
 twheys@gmail.com Dec 29, 2009
 
TO createAndShowLoginScreen WRITEME...


getApple

protected static String getApple(String key,
                                 String pass)
 twheys@gmail.com Dec 30, 2009
 
TO getApple WRITEME...

Parameters:
key - The secret key to hash the password with.
pass - The password to be encrypted
Returns:
a sha1 hash "apple" that allows access into $Eden

killSessionStatically

public static void killSessionStatically(boolean andExit)
 twheys@gmail.com Feb 3, 2010
 
TO killSession WRITEME...

Parameters:
andExit - WRITEME

login

protected static void login(String username,
                            String password,
                            String server)
 twheys@gmail.com Dec 29, 2009
 
TO login WRITEME...

Parameters:
username - WRITEME
password - WRITEME
server - WRITEME

loginNewUser

public static void loginNewUser()
 twheys@gmail.com Jan 22, 2010
 
TO loginNewUser WRITEME...


main

public static void main(String[] args)
 twheys@gmail.com Dec 29, 2009
 
TO main WRITEME...

Parameters:
args - WRITEME

openResource

public static void openResource(String url)
 twheys@gmail.com Jan 22, 2010
 
TO openWebPage WRITEME...

Parameters:
url - WRITEME

reloadUserAndRoomLists

public static void reloadUserAndRoomLists()

retrieveZoneListStatically

public static void retrieveZoneListStatically()
 twheys@gmail.com Feb 3, 2010
 
TO retrieveZoneListStatically WRITEME...


setAutoScrollsStatically

public static void setAutoScrollsStatically(boolean selected)
 twheys@gmail.com Feb 8, 2010
 
TO setAutoScrolls WRITEME...

Parameters:
selected - WRITEME

setEchoJoinsStatically

public static void setEchoJoinsStatically(boolean selected)
 twheys@gmail.com Mar 3, 2010
 
TO setEchoJoinsStatically WRITEME...

Parameters:
selected - WRITEME

validateUserStaffLevelOrExit

public static void validateUserStaffLevelOrExit(int staffLevel)
 twheys@gmail.com Dec 29, 2009
 
TO validateUserStaffLevelOrExit WRITEME...

Parameters:
staffLevel - WRITEME

connect

private void connect()
 twheys@gmail.com Dec 30, 2009
 
TO connect WRITEME...


createAndShowGUI

protected SpyUI createAndShowGUI()
Create the GUI and show it. For thread safety, this method should be invoked from the event-dispatching thread.

Returns:
a pointer to a SpyUI object that displays the interface.

createAndShowZonePrompt

protected void createAndShowZonePrompt(Vector<Zone> zones)
 twheys@gmail.com Dec 29, 2009
 
TO createAndShowLoginScreen WRITEME...

Parameters:
zones - WRITEME

createJournalExtension

private void createJournalExtension(String entryText)
 twheys@gmail.com Jan 28, 2010
 
TO createJournalExtension WRITEME...

Parameters:
entryText - WRITEME

disectMessageEvent

protected void disectMessageEvent(String messageEventParam)
 twheys@gmail.com Dec 30, 2009
 
TO readMessage WRITEME...

Parameters:
messageEventParam - WRITEME

displayInterface

private void displayInterface()
 twheys@gmail.com Dec 29, 2009
 
TO displayInterface WRITEME...


doMessageEventAction

private void doMessageEventAction(String user,
                                  String room,
                                  Actions verb,
                                  String message)
 twheys@gmail.com Dec 30, 2009
 
TO doMessageEventAction WRITEME...

Parameters:
user - WRITEME
room - WRITEME
verb - WRITEME
message - WRITEME

extractLoginInfoFromJSON

protected void extractLoginInfoFromJSON(org.json.JSONObject dataObj)
                                 throws org.json.JSONException
 twheys@gmail.com Dec 30, 2009
 
TO extractLoginInfoFromJSON WRITEME...

Parameters:
dataObj - WRITEME
Throws:
org.json.JSONException - WRITEME

extractRoomListFromJSON

protected void extractRoomListFromJSON(org.json.JSONObject dataObj)
                                throws org.json.JSONException
 twheys@gmail.com Dec 30, 2009
 
TO extractUserListFromJSON WRITEME...

Parameters:
dataObj - WRITEME
Throws:
org.json.JSONException - WRITEME

extractUserListFromJSON

protected void extractUserListFromJSON(org.json.JSONObject dataObj)
                                throws org.json.JSONException
 twheys@gmail.com Dec 30, 2009
 
TO extractUserListFromJSON WRITEME...

Parameters:
dataObj - WRITEME
Throws:
org.json.JSONException - WRITEME

getRoomDisplayName

private String getRoomDisplayName(String room)
 twheys@gmail.com Dec 30, 2009
 
TO getRoomDisplayName WRITEME...

Parameters:
room - WRITEME
Returns:
a displayable name for a room

getUserAndRoomListsFromServer

public void getUserAndRoomListsFromServer()
 twheys@gmail.com Jan 22, 2010
 
TO getUserAndRoomListsFromServer WRITEME...


getUserListFromJSON

private Vector<String> getUserListFromJSON(org.json.JSONObject userListJSON)
 twheys@gmail.com Dec 30, 2009
 
TO getUserListFromJSON WRITEME...

Parameters:
userListJSON - WRITEME
Returns:
a Vector of user names

getWindow

public JFrame getWindow()
 twheys@gmail.com Jan 22, 2010
 
TO getWindow WRITEME...

Returns:
the application JFrame window

getZoneListFromJSON

protected Vector<Zone> getZoneListFromJSON(org.json.JSONObject zoneList)
                                    throws org.json.JSONException
 twheys@gmail.com Dec 30, 2009
 
TO getZoneListFromJSON WRITEME...

Parameters:
zoneList - WRITEME
Returns:
A Vector with the zone list
Throws:
org.json.JSONException - WRITEME

handleFailedLogin

protected void handleFailedLogin(String message)
 twheys@gmail.com Dec 29, 2009
 
TO handleFailedLogin WRITEME...

Parameters:
message - WRITEME

initSFListeners

private void initSFListeners()
 twheys@gmail.com Dec 29, 2009
 
TO initAppiusListener WRITEME...


isEchoRoomJoins

public boolean isEchoRoomJoins()
Returns:
the echoRoomJoins

killSession

public void killSession(boolean andExit)
 twheys@gmail.com Jan 22, 2010
 
TO quit WRITEME...

Parameters:
andExit - WRITEME

loginToZone

protected void loginToZone(String zone)
 twheys@gmail.com Dec 29, 2009
 
TO login WRITEME...

Parameters:
zone - WRITEME

moveUser

private void moveUser(String user,
                      String room)
 twheys@gmail.com Dec 30, 2009
 
TO moveUser WRITEME...

Parameters:
user - WRITEME
room - WRITEME

promptForZone

public void promptForZone(Vector<Zone> zones)
 twheys@gmail.com Dec 29, 2009
 
TO promptForZone WRITEME...

Parameters:
zones - WRITEME

removeUser

private void removeUser(String user,
                        String room)
 twheys@gmail.com Dec 30, 2009
 
TO removeUser WRITEME...

Parameters:
user - WRITEME
room - WRITEME

reportUser

private void reportUser(String user,
                        String room,
                        String reportedUser)
 twheys@gmail.com Jan 5, 2010
 
TO reportUser WRITEME...

Parameters:
user - WRITEME
room - WRITEME
reportedUser - WRITEME

retrieveZoneList

public void retrieveZoneList()
 twheys@gmail.com Jan 22, 2010
 
THIS WILL DISCONNECT FROM THE CURRENT ZONE.


sendPublicCommand

protected void sendPublicCommand(String command,
                                 String[] params)
 twheys@gmail.com Dec 30, 2009
 
TO sendActionCommand WRITEME...

Parameters:
command - WRITEME
params - WRITEME

sendPublicMessage

protected void sendPublicMessage(String message)
 twheys@gmail.com Dec 30, 2009
 
TO sendPublicMessage WRITEME...

Parameters:
message - WRITEME

setAutoscrolls

private void setAutoscrolls(boolean selected)
 twheys@gmail.com Feb 8, 2010
 
TO setAutoscrolls WRITEME...

Parameters:
selected - WRITEME

setEchoRoomJoins

public void setEchoRoomJoins(boolean newEchoRoomJoins)
Parameters:
newEchoRoomJoins - the echoRoomJoins to set

showMessage

@Deprecated
private void showMessage(String user,
                                    String room,
                                    String message)
Deprecated. use SpyUI.showSaidMessage(String, String, String) instead

 twheys@gmail.com Dec 30, 2009
 

Parameters:
user - WRITEME
room - WRITEME
message - WRITEME

updateRoomListWithMovedUser

private void updateRoomListWithMovedUser(String user,
                                         String room)
 twheys@gmail.com Dec 30, 2009
 
TO updateRoomListWithMovedUser WRITEME...

Parameters:
user - WRITEME
room - WRITEME