Package org.jmule.core.edonkey.packet.tag

Examples of org.jmule.core.edonkey.packet.tag.StringTag


    if (task.getRequestType() == RequestType.STORE) {
      kad_task.task_type = _._("mainwindow.kadtab.store");
      Publisher publisher = _jkad.getPublisher();
      if (publisher.getPublishKeywordTask(task.getTargetID())!=null) {
        PublishKeywordTask publish_keyword = publisher.getPublishKeywordTask(task.getTargetID());
        StringTag file_name = (StringTag)publish_keyword.getTagList().getTag(JKadConstants.TAG_FILENAME);
        kad_task.task_info = (String)file_name.getValue();
      } else
      if (publisher.getPublishSourceTask(task.getTargetID())!=null) {
        PublishSourceTask publish_keyword = publisher.getPublishSourceTask(task.getTargetID());
        StringTag file_name = (StringTag)publish_keyword.getTagList().getTag(JKadConstants.TAG_FILENAME);
        kad_task.task_info = (String)file_name.getValue();
      }
    }
   
    kad_task.task_id = task.getTargetID().toHexString();
    return kad_task;
View Full Code Here


  public TagList getTagList() {
    return tagList;
  }

  void setName(String newName) {
    Tag tag = new StringTag(SL_SERVERNAME, newName);
    tagList.removeTag(SL_SERVERNAME);
    tagList.addTag(tag);
  }
View Full Code Here

      return getAddress();
    }
  }

  void setDesc(String serverDesc) {
    Tag tag = new StringTag(SL_DESCRIPTION, serverDesc);
    tagList.removeTag(SL_DESCRIPTION);
    tagList.addTag(tag);

  }
View Full Code Here

  DownloadSession(ED2KFileLink fileLink) {
    this();
    try {
      TagList tagList = new TagList();
      Tag tag;
      tag = new StringTag(FT_FILENAME, fileLink.getFileName());
      tagList.addTag(tag);
      tag = new IntTag(FT_FILESIZE, Convert.longToInt((fileLink
          .getFileSize())));
      tagList.addTag(tag);
      createDownloadFiles(fileLink.getFileName(), fileLink.getFileSize(),
View Full Code Here

   */
  public static Packet getServerLoginPacket(UserHash userHash, int clientPort,
      String userNickName) throws JMException {
   
    TagList tagList = new TagList();
    tagList.addTag(new StringTag(TAG_NAME_NAME, userNickName));
    tagList.addTag(new IntTag(TAG_NAME_PROTOCOLVERSION,ProtocolVersion ));
    tagList.addTag(new IntTag(TAG_NAME_CLIENTVER, ServerSoftwareVersion));
    tagList.addTag(new IntTag(TAG_NAME_FLAGS, SUPPORTED_FLAGS));
    tagList.addTag(new IntTag(TAG_NAME_UDP_PORT, ConfigurationManagerSingleton.getInstance().getUDP()));
 
View Full Code Here

       
    int misc_optins1 = Utils.peerFeatures1ToInt(clientFeatures);
    int misc_optins2 = Utils.peerFeatures2ToInt(clientFeatures);
   
    TagList tagList = new TagList();
    tagList.addTag(new StringTag(TAG_NAME_NAME, userName));
    tagList.addTag(new IntTag(TAG_NAME_MISC_OPTIONS1,misc_optins1 ));
    tagList.addTag(new IntTag(TAG_NAME_MISC_OPTIONS2,misc_optins2));
   
    tagList.addTag(new IntTag(TAG_NAME_PROTOCOLVERSION,ProtocolVersion ));
    tagList.addTag(new IntTag(TAG_NAME_CLIENTVER, E2DKConstants.getSoftwareVersion()));
View Full Code Here

      throws JMException {

    int misc_optins1 = Utils.peerFeatures1ToInt(clientFeatures);
    int misc_optins2 = Utils.peerFeatures2ToInt(clientFeatures);
    TagList tagList = new TagList();
    tagList.addTag(new StringTag(TAG_NAME_NAME, userName));
    tagList.addTag(new IntTag(TAG_NAME_MISC_OPTIONS1, misc_optins1));
    tagList.addTag(new IntTag(TAG_NAME_MISC_OPTIONS2, misc_optins2));

    tagList.addTag(new IntTag(TAG_NAME_PROTOCOLVERSION, ProtocolVersion));
    tagList.addTag(new IntTag(TAG_NAME_CLIENTVER, E2DKConstants.getSoftwareVersion()));
View Full Code Here

          Int128 id = new Int128(hash);

          if (!publisher.isPublishingSource(id)) {
            filesToPublish++;
            List<Tag> tagList = new LinkedList<Tag>();
            tagList.add(new StringTag(TAG_FILENAME, file
                .getSharingName()));
            tagList.add(new IntTag(TAG_FILESIZE, (int) file
                .length()));
            tagList
                .add(new IntTag(TAG_SOURCEIP,
                    org.jmule.core.utils.Convert
                        .byteToInt(getIPAddress()
                            .getAddress())));
            try {
              tagList.add(new IntTag(TAG_SOURCEPORT,
                  config_manager.getTCP()));
            } catch (ConfigurationManagerException e) {
              e.printStackTrace();
            }

            publisher.publishSource(id, tagList);
          }
          if (!publisher.isPublishingKeyword(id)) {
            filesToPublish++;
            List<Tag> tagList = new LinkedList<Tag>();
            tagList.add(new StringTag(TAG_FILENAME, file
                .getSharingName()));
            tagList.add(new IntTag(TAG_FILESIZE, (int) file
                .length()));

            publisher.publishKeyword(id, tagList);
          }

          if (file.getTagList().hasTag(TAG_FILERATING))
            if (!publisher.isPublishingNote(id)) {
              filesToPublish++;
              List<Tag> tagList = new LinkedList<Tag>();
              tagList.add(new StringTag(TAG_FILENAME, file
                  .getSharingName()));
              tagList.add(new IntTag(TAG_FILESIZE, (int) file
                  .length()));
              tagList.add(new IntTag(TAG_FILERATING, file
                  .getFileQuality().getAsInt()));
View Full Code Here

    return tmpFileName;
  }
 
  public void setTempFileName(String tempFileName) {
    this.tagList.removeTag(FT_TEMPFILE);
    Tag tag = new StringTag(FT_TEMPFILE, tempFileName);
    tagList.addTag(tag);
  }
View Full Code Here

    return realFileName;
  }
 
  public void setRealFileName(String realFileName) {
    this.tagList.removeTag(FT_FILENAME);
    Tag tag = new StringTag(FT_FILENAME, realFileName);
    tagList.addTag(tag);
  }
View Full Code Here

TOP

Related Classes of org.jmule.core.edonkey.packet.tag.StringTag

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.