logger.log(Logger.FINER, "MulticastMainDetectionListener::serveGetMain(): my platform is \""+myPlatform+"\" while request is for platform \""+platformName+"\" --> Do not reply");
return null;
}
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();