Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mitre.cvw
Class WhoUserProcessor  view WhoUserProcessor download WhoUserProcessor.java

java.lang.Object
  extended byorg.mitre.cvw.WhoUserProcessor

public class WhoUserProcessor
extends java.lang.Object

This class processes the results of a cvw-lookup-who-request or the old moo command "who". For each cvw-lookup-who-user that the CVW server sends, a formatted string is created with the proper spacing. The beginning of each string contains a time stamp of either the last active time or the last disconnect time of the user followed by >>!<< this is followed by the actual formatted string to be displayed. This time stamp is used by the sorting algorithm and stripped when the string is actually being displayed.

Version:

Field Summary
(package private)  CVWCoordinator cvw
           
private static WhoUserProcessor instance
           
(package private)  java.util.Vector whoUser
           
(package private)  int whoUserActiveCount
           
(package private)  java.lang.String whoUserBlankStr
           
(package private)  java.util.Vector whoUserDisconnect
           
(package private) static java.lang.String whoUserDisconnectTitle
           
(package private) static java.lang.String whoUserDisconnectTitleSep
           
(package private) static int[] whoUserTabs
           
(package private) static java.lang.String whoUserTitle
           
(package private) static java.lang.String whoUserTitleSep
           
 
Constructor Summary
protected WhoUserProcessor(int count)
           
protected WhoUserProcessor(java.lang.String users)
          Constructor First time called, this sets up an array of tab values and the titles for both the connected user list and the disconnected user list using those tabbed values.
 
Method Summary
private static void clearInstance()
          Clears the current instance of the who user processor.
static WhoUserProcessor getInstance()
          Returns the current who processor.
static WhoUserProcessor startProcess(java.lang.String users)
          Creates an instance of the who processor given a list of users the user has asked for (blank if all users).
 void whoUserInfo(java.lang.String n, java.lang.String oNum, java.lang.String loc, java.lang.String iState, java.lang.String idle, java.lang.String iMsg, java.lang.String busy)
          Processes information about connected users, starting the string with the active time followed by >>!<< and then the formatted information to be displayed.
 void whoUserInfoDisconnected(java.lang.String name, java.lang.String oNum, java.lang.String disTime)
          Processes information about disconnected users, starting the string with the last disconnect time followed by >>!<< and then the formatted information.
 java.lang.String whoUserInfoDisconnectedTitle(java.lang.String n, java.lang.String l)
          Formats the title string using the tab values found in the whoUserTabs array.
 void whoUserInfoEnd()
          Begins to display all information about the users since the CVW server has sent a notification that there is no more information about users to be sent.
 void whoUserInfoError(java.lang.String n, java.lang.String e)
          Processes information requested that resulted in an error from the CVW server.
 java.util.Vector whoUserInfoSort(java.util.Vector who)
          Sorts a given vector of strings by time active, the active time is at the beginning of the string and is followed by >>!<<.
 java.lang.String whoUserInfoTitle(java.lang.String n, java.lang.String l, java.lang.String t, java.lang.String m)
          Formats the title string using the tab values found in the whoUserTabs array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static WhoUserProcessor instance

whoUserTitle

static java.lang.String whoUserTitle

whoUserDisconnectTitle

static java.lang.String whoUserDisconnectTitle

whoUserTitleSep

static java.lang.String whoUserTitleSep

whoUserDisconnectTitleSep

static java.lang.String whoUserDisconnectTitleSep

whoUserTabs

static int[] whoUserTabs

whoUser

java.util.Vector whoUser

whoUserDisconnect

java.util.Vector whoUserDisconnect

whoUserBlankStr

java.lang.String whoUserBlankStr

whoUserActiveCount

int whoUserActiveCount

cvw

CVWCoordinator cvw
Constructor Detail

WhoUserProcessor

protected WhoUserProcessor(java.lang.String users)
Constructor First time called, this sets up an array of tab values and the titles for both the connected user list and the disconnected user list using those tabbed values.


WhoUserProcessor

protected WhoUserProcessor(int count)
Method Detail

startProcess

public static WhoUserProcessor startProcess(java.lang.String users)
Creates an instance of the who processor given a list of users the user has asked for (blank if all users).


getInstance

public static WhoUserProcessor getInstance()
Returns the current who processor.


clearInstance

private static void clearInstance()
Clears the current instance of the who user processor.


whoUserInfo

public void whoUserInfo(java.lang.String n,
                        java.lang.String oNum,
                        java.lang.String loc,
                        java.lang.String iState,
                        java.lang.String idle,
                        java.lang.String iMsg,
                        java.lang.String busy)
Processes information about connected users, starting the string with the active time followed by >>!<< and then the formatted information to be displayed. This active time and >>!<< will be used by whoUserInfoSort and stripped by whoUserInfoEnd method.
MCP receive cvw-lookup-who-user


whoUserInfoDisconnected

public void whoUserInfoDisconnected(java.lang.String name,
                                    java.lang.String oNum,
                                    java.lang.String disTime)
Processes information about disconnected users, starting the string with the last disconnect time followed by >>!<< and then the formatted information. This last disconnect time and >>!<< will be stripped by whoUserInfoSort and stripped by whoUserInfoEnd method.
MCP receive cvw-lookup-who-user
MCP receive cvw-lookup-who-user


whoUserInfoTitle

public java.lang.String whoUserInfoTitle(java.lang.String n,
                                         java.lang.String l,
                                         java.lang.String t,
                                         java.lang.String m)
Formats the title string using the tab values found in the whoUserTabs array.


whoUserInfoDisconnectedTitle

public java.lang.String whoUserInfoDisconnectedTitle(java.lang.String n,
                                                     java.lang.String l)
Formats the title string using the tab values found in the whoUserTabs array.


whoUserInfoError

public void whoUserInfoError(java.lang.String n,
                             java.lang.String e)
Processes information requested that resulted in an error from the CVW server.
MCP receive cvw-lookup-who-problem


whoUserInfoEnd

public void whoUserInfoEnd()
Begins to display all information about the users since the CVW server has sent a notification that there is no more information about users to be sent. For each formatted string in the vectors, strip off the time and tht >>!<<
MCP receive cvw-lookup-who-end


whoUserInfoSort

public java.util.Vector whoUserInfoSort(java.util.Vector who)
Sorts a given vector of strings by time active, the active time is at the beginning of the string and is followed by >>!<<.