Examples of Delay


Examples of com.calclab.emite.xep.delay.Delay

    final XmppURI uri = uri("name@domain/resource");
    final XMLPacket delayNode = XMLBuilder.create("delay", "urn:xmpp:delay").getXML();
    delayNode.setAttribute("from", "name@domain/resource");
    delayNode.setAttribute("stamp", "1980-04-15T17:15:02.159+01:00");
    final Delay delay = new Delay(delayNode);
    assertNotNull(delay);
    final Date date = new Date(324663302159L);
    assertEquals(uri, delay.getFrom());
    assertEquals(date, delay.getStamp());
  }
View Full Code Here

Examples of com.calclab.emite.xep.delay.Delay

    final XmppURI uri = uri("name@domain/resource");
    final XMLPacket delayNode = XMLBuilder.create("x", "jabber:x:delay").getXML();
    delayNode.setAttribute("xmlns", "jabber:x:delay");
    delayNode.setAttribute("from", "name@domain/resource");
    delayNode.setAttribute("stamp", "19800415T17:15:02");
    final Delay delay = new Delay(delayNode);
    assertNotNull(delay);

    final Date date = new Date(80, 3, 15, 17, 15, 2);
    date.setTime(date.getTime() - (date.getTimezoneOffset() * 60000));
   
    assertEquals(uri, delay.getFrom());
    assertEquals(date, delay.getStamp());
  }
View Full Code Here

Examples of com.calclab.emite.xep.delay.Delay

    stanza.setTo((XmppURI) null);
    final XMLPacket delayNode = stanza.getXML().addChild("delay");
    delayNode.setAttribute("xmlns", "urn:xmpp:delay");
    delayNode.setAttribute("from", "name@domain/resource");
    delayNode.setAttribute("stamp", "1980-04-15T17:15:02.159+01:00");
    final Delay delay = DelayHelper.getDelay(stanza);
    assertNotNull(delay);
   
    final Date date = new Date(324663302159L);
    assertEquals(uri, delay.getFrom());
    assertEquals(date, delay.getStamp());
  }
View Full Code Here

Examples of com.calclab.emite.xep.delay.Delay

    stanza.setTo(null);
    final XMLPacket delayNode = stanza.getXML().addChild("x");
    delayNode.setAttribute("xmlns", "jabber:x:delay");
    delayNode.setAttribute("from", "name@domain/resource");
    delayNode.setAttribute("stamp", "19800415T15:15:02");
    final Delay delay = DelayHelper.getDelay(stanza);
    assertNotNull(delay);

    final Date date = new Date(80, 3, 15, 15, 15, 2);
    date.setTime(date.getTime() - (date.getTimezoneOffset() * 60000));
   
    assertEquals(uri, delay.getFrom());
    assertEquals(date, delay.getStamp());
  }
View Full Code Here

Examples of com.sissi.protocol.offline.Delay

   * @param message
   * @return
   */
  protected Delay delay(JID jid, Map<String, Object> element, Message message) {
    JID group = super.jidBuilder.build(element.get(Dictionary.FIELD_TO).toString());
    return new Delay(super.tip, this.room.build(group).allowed(jid, RoomConfig.WHOISALLOW, group) ? null : element.get(Dictionary.FIELD_SOURCE).toString(), element.get(Dictionary.FIELD_DELAY).toString());
  }
View Full Code Here

Examples of com.sissi.protocol.offline.Delay

   * @param element
   * @param message
   * @return
   */
  protected Delay delay(Map<String, Object> element, Message message) {
    return new Delay(super.tip, message.getFrom(), element.get(Dictionary.FIELD_DELAY).toString());
  }
View Full Code Here

Examples of com.sissi.protocol.offline.Delay

  private final FastDateFormat format = FastDateFormat.getInstance("yyyy-MM-dd'T'HH:mm:ssZ");
 
  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    protocol.cast(Message.class).delay(new Delay().setStamp(this.format.format(new Date())));
    return true;
  }
View Full Code Here

Examples of com.sissi.protocol.offline.Delay

  public String getXmlns() {
    return XMLNS;
  }

  public Si delay(String timestamp) {
    this.delay = timestamp != null ? new Delay().setStamp(timestamp) : null;
    return this;
  }
View Full Code Here

Examples of com.sissi.protocol.offline.Delay

    XMuc x = protocol.cast(Presence.class).findField(XMuc.NAME, XMuc.class);
    if (x.hasHistory()) {
      JID group = super.build(protocol.getTo());
      Room room = this.room.build(group);
      for (Element message : this.recover.pull(group, x.history())) {
        Delay delay = Message.class.cast(message).getDelay();
        delay.setFrom(room.allowed(context.jid(), RoomConfig.WHOISALLOW, super.build(delay.getFrom())) ? super.build(message.getFrom()).asStringWithBare() : delay.getFrom());
        context.write(message);
      }
  }
    return true;
  }
View Full Code Here

Examples of jmt.engine.NodeSections.Delay

      int[] numJobs = { N }; //variable population

      ServiceTimeStrategy[] ds = { new ServiceTimeStrategy(DelayExp[0], DelayPar[0]) };

      sim.addNode("terminal", new Terminal(numJobs), new Delay(ds), new Router(rrs_term));

      //server 1
      ServiceStrategy[] serv_strat1 = new ServiceStrategy[1];
      serv_strat1[0] = new ServiceTimeStrategy(serverExp1[0], serverPar1[0]);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.