Package com.almende.util.uuid

Examples of com.almende.util.uuid.UUID


   *            the node
   */
  public AgentConfig(final ObjectNode node) {
    super(node);
    if (!node.has("id")) {
      this.put("id", new UUID().toString());
    }
  }
View Full Code Here


            + " in method '" + method.getName() + "' is null.");
      }
    }
    JsonNode id = null;
    try {
      id = JOM.getInstance().valueToTree(new UUID().toString());
    } catch (final Exception e) {
      LOG.log(Level.SEVERE, "Failed to generate UUID for request", e);
    }
    return new JSONRequest(id, method.getName(), params);
  }
View Full Code Here

   *            the due
   * @param message
   *            the message
   */
  public TaskEntry(final DateTime due, final Object message) {
    taskId = new UUID().toString();
    setMessage(message);
    this.due = due;
  }
View Full Code Here

  @Override
  public String schedule(final Object msg, final DateTime due) {
    if (clock == null) {
      clock = new RunnableClock();
    }
    final String uuid = new UUID().toString();
    clock.requestTrigger(uuid, due, new Runnable() {
     
      @Override
      public void run() {
        handle.get().receive(msg, schedulerUrl, null);
View Full Code Here

   * @param id
   *            the new id
   */
  public void setId(final JsonNode id) {
    if (id == null || id.isNull()) {
      req.put(ID, new UUID().toString());
    } else {
      req.put(ID, id);
    }
  }
View Full Code Here

   * @throws IOException
   *             Signals that an I/O exception has occurred.
   */
  public String receive(final String body, final URI senderUrl)
      throws IOException {
    final String tag = new UUID().toString();
    final SyncCallback<String> callback = new SyncCallback<String>() {
    };
    callbacks.push(tag, "", callback);
   
    super.getHandle().get().receive(body, senderUrl, tag);
View Full Code Here

  public TokenRet create() {
    TokenRet result;
    if (tokens.size() == 0 || tokens.get(last.toString()) == null
        || last.plus(3600000).isBeforeNow()) {
      final DateTime now = DateTime.now();
      final String token = new UUID().toString();
      result = new TokenRet(token, now);
      tokens.put(now.toString(), token);
      last = now;
     
      if (tokens.size() > SIZE + 2) {
View Full Code Here

   * @throws IOException
   *             Signals that an I/O exception has occurred.
   */
  public String receive(final String body, final URI senderUrl)
      throws IOException {
    final String tag = new UUID().toString();
    final SyncCallback<String> callback = new SyncCallback<String>(){};
    callbacks.push(tag, "", callback);
   
    super.getHandle().get().receive(body, senderUrl, tag);
    try {
View Full Code Here

      TokenRet result;
      if (tokens.size() == 0
          || tokens.get(last.toString(), String.class) == null
          || last.plus(3600000).isBeforeNow()) {
        final DateTime now = DateTime.now();
        final String token = new UUID().toString();
        result = new TokenRet(token, now);
        tokens.put(now.toString(), token);
        last = now;
       
        if (tokens.size() > SIZE + 2) {
View Full Code Here

      }
      // Callback already exists, returning existing callbackId.
      return subscription.getId();
    }
    // create new callback
    final String subscriptionId = new UUID().toString();
    final Callback callback = new Callback(subscriptionId, callbackUrl,
        callbackMethod, params);
   
    // Callback didn't exist, store new callback.
    subscriptions.add(callback);
View Full Code Here

TOP

Related Classes of com.almende.util.uuid.UUID

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.