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

Constructor Index

 o 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.

Method Index

 o agent(String)
Returns the ID card for the agent with the specified name.
 o agents()
Returns an array of agent names and scripts, alternating.
 o connect(String, String)
Attempts to connect to the mediator, authenticating with the specified username and password.
 o disconnect()
Disconnects this handler from the mediator.
 o handleAgentEvent(Event)
Handles the specified event.
 o handleException(Exception)
Prints out the message of the specified exception.
 o handleFileEvent(Event)
Handles the specified event.
 o handlePartnerEvent(Event)
Handles the specified event.
 o handleProjectEvent(Event)
Handles the specified event.
 o 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.
 o mediator()
Returns the name of the mediator this client is connected to.
 o process(Package)
Processes the specified package.
 o projectleader()
Returns the root project leader's username.
 o projectname()
Returns the root project name for this handler.
 o projects()
Returns an array of project identifiers for this handler.
 o query(Request)
Sends a request to the mediator.
 o send(Package)
Sends a package to the mediator.
 o user()
Returns the partner information for the user who authenticated to this handler, or null if the user authenticated as guest.
 o userid()
Returns the partner identifier for the user who authenticated to this handler, or null if the user authenticated as guest.

Constructors

 o 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

Methods

 o projectname
 public String projectname()
Returns the root project name for this handler.

Returns:
a project name
 o projects
 public Integer[] projects()
Returns an array of project identifiers for this handler.

Returns:
an array of project identifiers
 o projectleader
 public String projectleader()
Returns the root project leader's username.

Returns:
a partner username
 o 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
 o 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
 o 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
 o agents
 public String[] agents()
Returns an array of agent names and scripts, alternating.

Returns:
an array of agent names and scripts
 o 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
 o mediator
 public String mediator()
Returns the name of the mediator this client is connected to.

Returns:
the name of the mediator
 o send
 public void send(Package pkg)
Sends a package to the mediator.

Parameters:
pkg - a package
See Also:
Package
 o query
 public void query(Request request)
Sends a request to the mediator.

Parameters:
request - a request
See Also:
Request
 o 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
 o 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
 o 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
 o disconnect
 public void disconnect()
Disconnects this handler from the mediator.

See Also:
disconnect
 o 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
 o 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
 o 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
 o 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.