Example #1
0
 /** @return list of addresses for all servers on which this service is installed */
 public List<String> getAddresses() {
   List<Location> locations = m_locationsManager.getLocationsForService(this);
   List<String> addresses = new ArrayList<String>();
   for (Location location : locations) {
     addresses.add(location.getAddress());
   }
   return addresses;
 }
Example #2
0
 /**
  * This only works for services that have "one per cluster" restrictions. Exception is thrown
  * otherwise.
  *
  * <p>It returns null if non of the locations have this service installed.
  *
  * @return single FQDN of the server on which this service is installed
  */
 public String getFqdn() {
   List<Location> locations = m_locationsManager.getLocationsForService(this);
   if (locations.isEmpty()) {
     LOG.error(NO_LOCATION_FOUND_ERROR + m_beanId);
     return null;
   }
   if (locations.size() > 1) {
     LOG.warn("Returning first location of the service running on multiple servers: " + m_beanId);
   }
   return locations.get(0).getFqdn();
 }