Пример #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();
 }