示例#1
0
  public ArraySet<ElectricityTicket> getTickets() {
    try {
      ArraySet<ElectricityTicket> output = lookupHLCServer().getTickets(userId);
      for (ElectricityTicket t : output) {
        handler.setTicket(t);
      }
      return handler.getTkts();
    } catch (RemoteException e) {

    }
    return null;
  }
示例#2
0
 public Twople<String, String> registerUser(
     Double worth, Double generation, Double economic, String pubKey, int port) {
   try {
     return lookupHLCServer()
         .registerUser(
             handler.getSalt(),
             handler.getHash(),
             userId,
             userName,
             pubKey,
             worth,
             generation,
             economic,
             port);
   } catch (RemoteException e) {
     return null;
   }
 }
示例#3
0
  public Boolean setRequirement(ElectricityRequirement req) {
    try {
      if (lookupHLCServer().setRequirement(req)) {
        return handler.setRequirement(req);
      }
    } catch (RemoteException e) {
    }

    return false;
  }
示例#4
0
 public LCClient(
     String eDCHostName,
     int eDCPortNum,
     String hLCHostName,
     int hLCPortNum,
     String name,
     String password) {
   eDCHost = eDCHostName;
   eDCPort = eDCPortNum;
   hLCHost = hLCHostName;
   hLCPort = hLCPortNum;
   userName = name;
   handler = new LCHandler(name, password, 0., 0., 0.); // TODO: make not naughty.
   userId = handler.getId();
   if (System.getSecurityManager() == null) {
     System.setSecurityManager(new RMISecurityManager());
   }
 }
示例#5
0
 public ArraySet<ElectricityTicket> findCompetingTickets(ElectricityRequirement req) {
   return handler.findCompetingTickets(req);
 }
示例#6
0
 public Boolean queryUnsatisfiedReqs() {
   return handler.queryUnsatisfiedReqs();
 }
示例#7
0
 public ArrayList<ElectricityTicket> getUnhappyTickets() {
   return handler.getUnhappyTickets();
 }
示例#8
0
 public boolean queryUnhappyTickets() {
   return handler.queryUnhappyTickets();
 }