Exemplo n.º 1
0
 public boolean equals(Object o) {
   if (o instanceof TaskEventId) {
     TaskEventId other = (TaskEventId) o;
     return (theTaskUID.equals(other.theTaskUID) && theAspectType == other.theAspectType);
   }
   return false;
 }
Exemplo n.º 2
0
 public boolean execute(Object o) {
   if (o instanceof OrgActivity) {
     if (oplanUID_.equals(((OrgActivity) o).getOplanUID())) {
       return true;
     }
   }
   return false;
 }
 public String toString() {
   StringBuffer buff = new StringBuffer();
   if (uid != null) {
     buff.append(" uid is :" + uid.toString() + "\n");
   }
   buff.append(" status :" + outstandingquery);
   return buff.toString();
 }
Exemplo n.º 4
0
 public int compareTo(Object o) {
   TaskEventId key = (TaskEventId) o;
   int diff = theTaskUID.compareTo(key.theTaskUID);
   if (diff == 0) {
     diff = theAspectType - key.theAspectType;
   }
   return diff;
 }
  private void buildDigestedUserFile(String args[]) {
    // Parse command-line arguments.
    String domain = null;
    String fileName = null;
    for (int i = 0; i < args.length; i++) {
      if (args[i].equals("-d")) {
        if (++i == args.length) {
          usage();
        }
        domain = args[i];
      } else if (args[i].equals("-f")) {
        if (++i == args.length) {
          usage();
        }
        fileName = args[i];
      }
    }
    if (fileName == null) {
      fileName = "UserFile-" + domain + ".xml";
    }

    // The UID is not important. Make a fake one.
    UID uid = UID.toUID("AgentA/1094690973044");
    UserEntries userCache = new UserEntries(uid);
    userCache.setDomain(domain);
    init(userCache);

    UserFileParser ufp = new UserFileParser(userCache);
    System.out.println("Reading user XML file...");
    ufp.readUsers("UserFile.xml");
    OutputStream os = null;
    try {
      os = new FileOutputStream(fileName);
    } catch (FileNotFoundException e) {
      usage();
    }
    System.out.println("Generating user XML file: " + fileName + " for domain: " + domain);
    ufp.saveUsersAndRoles(os);
    try {
      os.close();
    } catch (IOException e) {
      System.out.println("Unable to close file");
    }
  }
Exemplo n.º 6
0
 public String toString() {
   return theTaskUID.toString() + ":" + theAspectType;
 }
Exemplo n.º 7
0
 public TaskEventId(UID aTaskUID, int anAspectType) {
   theTaskUID = aTaskUID;
   theAspectType = anAspectType;
   hc = theTaskUID.hashCode() + theAspectType;
 }