Package org.powertac.common.msg
Class BrokerAuthentication
java.lang.Object
org.powertac.common.msg.BrokerAuthentication
@Domain public class BrokerAuthentication extends Object
This message is used for authenticating a broker with the server.
Broker sends this message to the server with its username, password, and
the name of the queue through which it wishes to receive messages. The
password is ignored by a standalone server; in a tournament situation it is
the game-token received from the tournament manager. The queue name may be
the username, but in a tournament situation using some sort of
difficult-to-guess hash (or possibly the game token) will make it more
difficult (but not impossible) for other brokers to intercept its messages.
If the login is accepted, a
BrokerAccept message is returned.- Author:
- John Collins
-
Constructor Summary
Constructors Constructor Description BrokerAuthentication(String username, String password)Creates an instance from a username, passwordBrokerAuthentication(Broker broker)Creates an instance from a broker -
Method Summary
Modifier and Type Method Description longgetBrokerTime()Returns the system time set by the broker.StringgetPassword()StringgetUsername()voidsetBrokerTime(long time)Sets the system time.
-
Constructor Details
-
BrokerAuthentication
Creates an instance from a broker -
BrokerAuthentication
Creates an instance from a username, password
-
-
Method Details
-
getUsername
- Returns:
- the broker username
-
getPassword
- Returns:
- the password
-
setBrokerTime
public void setBrokerTime(long time)Sets the system time. Should be set immediately before sending the message to the server. -
getBrokerTime
public long getBrokerTime()Returns the system time set by the broker. Used by the server to estimate clock offset.
-