All Packages Class Hierarchy This Package Previous Next Index
Class icc.face.Handler
java.lang.Object
|
+----icc.net.EventHandler
|
+----icc.face.Handler
- public final class Handler
- extends EventHandler
- implements DataHandling
The Handler class handles all data and events originating from the
mediator it is connected to. It also provides for the submission of
requests and other communication to the mediator and other delegates on
the project network.
- See Also:
- Speaker
-
Handler(Client, String, String, int)
- Allocates a Handler object for the specified client and
project name, in order to connect to a mediator at the specified host
and port number.
-
agent(String)
- Returns the ID card for the agent with the specified name.
-
agents()
- Returns an array of agent names and scripts, alternating.
-
connect(String, String)
- Attempts to connect to the mediator, authenticating with the
specified username and password.
-
disconnect()
- Disconnects this handler from the mediator.
-
handleAgentEvent(Event)
- Handles the specified event.
-
handleException(Exception)
- Prints out the message of the specified exception.
-
handleFileEvent(Event)
- Handles the specified event.
-
handlePartnerEvent(Event)
- Handles the specified event.
-
handleProjectEvent(Event)
- Handles the specified event.
-
localConnection()
- Tests whether the connection to the mediator is a local connection,
i.e., whether the client and (webtop) server are in the same network.
-
mediator()
- Returns the name of the mediator this client is connected to.
-
process(Package)
- Processes the specified package.
-
projectleader()
- Returns the root project leader's username.
-
projectname()
- Returns the root project name for this handler.
-
projects()
- Returns an array of project identifiers for this handler.
-
query(Request)
- Sends a request to the mediator.
-
send(Package)
- Sends a package to the mediator.
-
user()
- Returns the partner information for the user who authenticated to
this handler, or null if the user authenticated as guest.
-
userid()
- Returns the partner identifier for the user who authenticated to
this handler, or null if the user authenticated as guest.
Handler
public Handler(Client client,
String projectname,
String host,
int port)
- Allocates a Handler object for the specified client and
project name, in order to connect to a mediator at the specified host
and port number.
- See Also:
- connect, Client, Speaker
projectname
public String projectname()
- Returns the root project name for this handler.
- Returns:
- a project name
projects
public Integer[] projects()
- Returns an array of project identifiers for this handler.
- Returns:
- an array of project identifiers
projectleader
public String projectleader()
- Returns the root project leader's username.
- Returns:
- a partner username
userid
public Integer userid()
- Returns the partner identifier for the user who authenticated to
this handler, or null if the user authenticated as guest.
- Returns:
- a partner identifier
user
public Partner user()
- Returns the partner information for the user who authenticated to
this handler, or null if the user authenticated as guest.
- Returns:
- partner information
agent
public IDCard agent(String name)
- Returns the ID card for the agent with the specified name.
- Parameters:
- an - agent name
- Returns:
- an ID card
- See Also:
- IDCard
agents
public String[] agents()
- Returns an array of agent names and scripts, alternating.
- Returns:
- an array of agent names and scripts
localConnection
public boolean localConnection()
- Tests whether the connection to the mediator is a local connection,
i.e., whether the client and (webtop) server are in the same network.
- Returns:
- true if the client and server IP addresses are the
same except for the last number, false otherwise
mediator
public String mediator()
- Returns the name of the mediator this client is connected to.
- Returns:
- the name of the mediator
send
public void send(Package pkg)
- Sends a package to the mediator.
- Parameters:
- pkg - a package
- See Also:
- Package
query
public void query(Request request)
- Sends a request to the mediator.
- Parameters:
- request - a request
- See Also:
- Request
handleException
public void handleException(Exception e)
- Prints out the message of the specified exception.
Handles exceptions that are thrown by the mediator.
- Parameters:
- e - an exception
- See Also:
- Speaker
process
public void process(Package pkg)
- Processes the specified package. Packages that do not contain the
result of a request are discarded. A package containing a successful
authorization request results in a call to the initialize method in
the client applet. Successful data results are stored appropriately.
Some will result in an event sent to the client applet.
- See Also:
- initialize, DataHandling, Event
connect
public boolean connect(String username,
String password)
- Attempts to connect to the mediator, authenticating with the
specified username and password. true is returned if the
connection was successful. However, this connection will only survive
if the authentication was also successful.
- Returns:
- true if the connection was successful, false
otherwise
- See Also:
- connect, process
disconnect
public void disconnect()
- Disconnects this handler from the mediator.
- See Also:
- disconnect
handleAgentEvent
public void handleAgentEvent(Event event)
- Handles the specified event. This event is assumed to be an agent
event. Agent events originating from the mediator result in a call
to this method. After being handled, the event is forwarded to the
client applet.
- Parameters:
- event - an agent event
- Overrides:
- handleAgentEvent in class EventHandler
- See Also:
- EventHandler
handleFileEvent
public void handleFileEvent(Event event)
- Handles the specified event. This event is assumed to be a file
event. File events originating from the mediator result in a call
to this method. After being handled, the event is forwarded to the
client applet.
- Parameters:
- event - a file event
- Overrides:
- handleFileEvent in class EventHandler
- See Also:
- EventHandler
handlePartnerEvent
public void handlePartnerEvent(Event event)
- Handles the specified event. This event is assumed to be a partner
event. Partner events originating from the mediator result in a call
to this method. After being handled, the event is forwarded to the
client applet.
- Parameters:
- event - a partner event
- Overrides:
- handlePartnerEvent in class EventHandler
- See Also:
- EventHandler
handleProjectEvent
public void handleProjectEvent(Event event)
- Handles the specified event. This event is assumed to be a project
event. Project events originating from the mediator result in a call
to this method. After being handled, the event is forwarded to the
client applet.
- Parameters:
- event - a project event
- Overrides:
- handleProjectEvent in class EventHandler
- See Also:
- EventHandler
All Packages Class Hierarchy This Package Previous Next Index
This website has been archived and is no longer maintained.