コード例 #1
0
 /**
  * Returns a representation of a base DN for a set of servers.
  *
  * @param baseDN the base DN.
  * @param servers the servers.
  * @return a representation of a base DN for a set of servers.
  */
 public static String getSuffixDisplay(String baseDN, Set<ServerDescriptor> servers) {
   StringBuilder sb = new StringBuilder();
   sb.append(baseDN);
   for (ServerDescriptor server : servers) {
     sb.append(Constants.LINE_SEPARATOR + "    ");
     sb.append(server.getHostPort(true));
   }
   return sb.toString();
 }
コード例 #2
0
 /**
  * Returns an Id that is unique for this server.
  *
  * @return an Id that is unique for this server.
  */
 public String getId() {
   StringBuilder buf = new StringBuilder();
   if (serverProperties.size() > 0) {
     buf.append(serverProperties.get(ServerProperty.HOST_NAME));
     ServerProperty[] props = {
       ServerProperty.LDAP_PORT,
       ServerProperty.LDAPS_PORT,
       ServerProperty.ADMIN_PORT,
       ServerProperty.LDAP_ENABLED,
       ServerProperty.LDAPS_ENABLED,
       ServerProperty.ADMIN_ENABLED
     };
     for (ServerProperty prop : props) {
       ArrayList<?> s = (ArrayList<?>) serverProperties.get(prop);
       for (Object o : s) {
         buf.append(":").append(o);
       }
     }
   } else {
     ADSContext.ServerProperty[] props = {
       ADSContext.ServerProperty.HOST_NAME,
       ADSContext.ServerProperty.LDAP_PORT,
       ADSContext.ServerProperty.LDAPS_PORT,
       ADSContext.ServerProperty.ADMIN_PORT,
       ADSContext.ServerProperty.LDAP_ENABLED,
       ADSContext.ServerProperty.LDAPS_ENABLED,
       ADSContext.ServerProperty.ADMIN_ENABLED
     };
     for (int i = 0; i < props.length; i++) {
       if (i != 0) {
         buf.append(":");
       }
       buf.append(adsProperties.get(props[i]));
     }
   }
   return buf.toString();
 }