org.powertac.common.msg
Class BrokerAuthentication

java.lang.Object
  extended by org.powertac.common.msg.BrokerAuthentication

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
BrokerAuthentication(Broker broker)
          Creates an instance from a broker
BrokerAuthentication(String username, String password)
          Creates an instance from a username, password
 
Method Summary
 long getBrokerTime()
          Returns the system time set by the broker.
 String getPassword()
           
 String getUsername()
           
 void setBrokerTime(long time)
          Sets the system time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrokerAuthentication

public BrokerAuthentication(Broker broker)
Creates an instance from a broker


BrokerAuthentication

public BrokerAuthentication(String username,
                            String password)
Creates an instance from a username, password

Method Detail

getUsername

public String getUsername()
Returns:
the broker username

getPassword

public String 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.



Copyright © 2013. All Rights Reserved.