Package jade.mtp

Examples of jade.mtp.TransportAddress


   */
  public List getLocalAddresses() throws IMTPException {
    try {
      List l = new LinkedList();
      // The port is meaningful only on the Main container
      TransportAddress addr = new RMIAddress(InetAddress.getLocalHost().getHostName(), String.valueOf(localPort), null, null);
      l.add(addr);
      return l;
    }
    catch (Exception e) {
      throw new IMTPException("Exception reading local addresses", e);
View Full Code Here


  }

  private boolean compareAddresses(String addr1, String addr2) {
    //#MIDP_EXCLUDE_BEGIN
    try {
      TransportAddress ta1 = myIMTPManager.stringToAddr(addr1);
      TransportAddress ta2 = myIMTPManager.stringToAddr(addr2);
      if (CaseInsensitiveString.equalsIgnoreCase(ta1.getProto(), ta2.getProto())) {
        if (CaseInsensitiveString.equalsIgnoreCase(ta1.getPort(), ta2.getPort())) {
          if (Profile.compareHostNames(ta1.getHost(), ta2.getHost())) {
            return true;
          }
        }       
      }
      return false;
View Full Code Here

    List addresses = manager.getLocalAddresses();
    List responseAddresses = new ArrayList(addresses.size());

    Iterator iter = addresses.iterator();
    TransportAddress addr;
    while (iter.hasNext()) {
      addr = (TransportAddress)iter.next();
      if (proto != null) {
        if (proto.equals(addr.getProto())) {
          responseAddresses.add(addr);
          break;
        }
      } else {
        responseAddresses.add(addr);
      }
    }

    if (responseAddresses.size() < 1) {
      response = errorResponse(MainDetectionManager.PROTO_RESP_NOTFOUND, "Cannot manage protocol "+proto);
    } else {
      response = MainDetectionManager.PROTO_RESP_OK;
      iter = responseAddresses.iterator();
      while (iter.hasNext()) {
        addr = (TransportAddress)iter.next();
        // FIXME use toString()
        //response += addr.toString();
        response += addr.getProto()+MainDetectionManager.PROTO_ADDR_SEPARATOR+addr.getHost()+MainDetectionManager.PROTO_ADDR_SEPARATOR+addr.getPort();
        if (iter.hasNext()) {
          response += MainDetectionManager.PROTO_ADDRESSES_SEPARATOR;
        }
      }
    }
View Full Code Here

TOP

Related Classes of jade.mtp.TransportAddress

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.