Package com.sissi.protocol.iq.si

Examples of com.sissi.protocol.iq.si.Si


    this.delegation = delegation;
  }

  @Override
  public Map<String, Object> write(Element element) {
    Si si = Si.class.cast(element);
    Map<String, Object> entity = super.write(si.parent().reply().setType(ProtocolType.SET.toString()));
    entity.put(Dictionary.FIELD_SID, si.getId());
    entity.put(Dictionary.FIELD_SIZE, si.getFile().getSize());
    entity.put(Dictionary.FIELD_NAME, si.getFile().getName());
    entity.put(Dictionary.FIELD_CLASS, element.getClass().getSimpleName());
    entity.put(Dictionary.FIELD_HOST, new String[] { si.host(this.delegation, super.jidBuilder.build(si.parent().getTo()).asStringWithBare()) });
    if (si.delay()) {
      entity.put(Dictionary.FIELD_DELAY, si.getDelay().getStamp());
    }
    return entity;
  }
View Full Code Here


   *
   * @see com.sissi.persistent.PersistentElement#read(java.util.Map)
   */
  @Override
  public Element read(Map<String, Object> element) {
    return IQ.class.cast(super.read(element, new IQ())).setId(element.get(Dictionary.FIELD_SID).toString()).setFrom(this.delegation).add(new Si().setId(element.get(Dictionary.FIELD_SID).toString()).setSource(element.get(Dictionary.FIELD_FROM).toString()).setProfile(this.profile).setFeature(this.feature).setFile(new File().setName(element.get(Dictionary.FIELD_NAME).toString()).setSize(element.get(Dictionary.FIELD_SIZE).toString())).delay(super.toString(element, Dictionary.FIELD_DELAY)));
  }
View Full Code Here

    this.resource = resource;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Si si = protocol.cast(Si.class).setFeature(this.feature);
    this.exchangerContext.wait(si.host(context.jid().asString(this.resource), super.build(si.parent().getTo()).asString(this.resource)), true, this.transferBuilder.build(new SiTransferParam(si)));
    context.write(si.parent().reply().setType(ProtocolType.RESULT));
    return true;
  }
View Full Code Here

    this.tracerContext = tracerContext;
  }

  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    Si si = protocol.cast(Si.class);
    return si.file() ? this.trace(context, si) : true;
  }
View Full Code Here

  }

  @Override
  public Map<String, Object> plus() {
    Map<String, Object> plus = new HashMap<String, Object>();
    plus.put(Dictionary.FIELD_HOST, new Si().setId(this.getSid()).host(this.parent().getFrom(), this.parent().getTo()));
    return plus;
  }
View Full Code Here

TOP

Related Classes of com.sissi.protocol.iq.si.Si

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.