edu.csus.ecs.pc2.api
Interface IClient

All Known Subinterfaces:
ITeam

public interface IClient

This interface defines the view which is visible through the PC2 API of a PC2 "Client". "Client" in this context refers to a piece of code logged in to a PC2 server via an account which has been created by the Contest Administrator; for example, an instance of a PC2 Team, Judge, Administrator, or Scoreboard, or a separate user-written client which logs in using a contest account.

This documentation describes the current draft of the PC2 API, which is subject to change.

Version:
$Id: IClient.java 2068 2010-03-26 04:55:27Z laned $
Author:
pc2@ecs.csus.edu

Nested Class Summary
static class IClient.ClientType
          This enumerates the Client types defined in the system (that is, the types of Clients visible through the PC2 API).
 
Method Summary
 boolean equals(Object obj)
          Check whether this client is the same as some other client.
 int getAccountNumber()
          Get the client account number for this client.
 String getDisplayName()
          Get the client's "display name".
 String getLoginName()
          Get the client's login name.
 int getSiteNumber()
          Get the site number for this client.
 IClient.ClientType getType()
          Get the client Type.
 int hashCode()
          Get the hashcode associated with this client.
 boolean isDisplayableOnScoreboard()
          Return a boolean indicating whether this client should be displayed on the scoreboard or not.
 

Method Detail

getLoginName

String getLoginName()
Get the client's login name. Returns a String giving the login name (account name) currently used by this client to connect to the PC2 server. For example, for a team at site 5 logging in using the account "team4" the method would return "team4"".

Returns:
client's login name

getType

IClient.ClientType getType()
Get the client Type. Returns an enum element identifying the type of this client.

Returns:
IClient.ClientType enum element

getDisplayName

String getDisplayName()
Get the client's "display name". "Display name" refers to the printable description of the client as configured by the Contest Administrator. For example, a Team's "display name" might be configured to consist of a combination of the team name and the Team's school name.

Returns:
Client's display name.

getSiteNumber

int getSiteNumber()
Get the site number for this client. Returns the number of the site which this client is logged into.

Returns:
site number for this client.

getAccountNumber

int getAccountNumber()
Get the client account number for this client. Returns a numerical identifier for this client's login name (account). The combination of account number, client type, and site number uniquely identifies any client in the contest.

Returns:
a numerical identifier for this client's login name (account)

equals

boolean equals(Object obj)
Check whether this client is the same as some other client.

Determination of whether two clients are equal is based on whether they refer to the same client account as originally created in PC2 by the Contest Administrator. Note in particular that subsequent changes to a client account made by the Contest Administrator (for example, changes to the account display name, password, etc.) do not affect the result of the equals() method; if this client refers to the same client as the one indicated by the specified parameter, this method will return true regardless of whether the internal contents of the two client objects is identical or not.

Overrides:
equals in class Object
Parameters:
obj - the Client which is to be compared with this client for equality.
Returns:
True if the specified object refers to the same client as this client (regardless of the actual content of the two clients).

hashCode

int hashCode()
Get the hashcode associated with this client.

Overrides:
hashCode in class Object
Returns:
An integer hashcode for this object.

isDisplayableOnScoreboard

boolean isDisplayableOnScoreboard()
Return a boolean indicating whether this client should be displayed on the scoreboard or not.

Returns:
true if this client should be displayed on the scoreboard, else false.