private static void updatePlatformServerList(String serverURL,String hostName) throws SMSException, SSOException {
  SSOToken token=getAdminSSOToken();
  ServiceSchemaManager ssm=new ServiceSchemaManager("iPlanetAMPlatformService",token);
  ServiceSchema ss=ssm.getGlobalSchema();
  AttributeSchema as=ss.getAttributeSchema("iplanet-am-platform-server-list");
  Set<String> values=as.getDefaultValues();
  if (!isInPlatformList(values,serverURL)) {
    String instanceName=getNextAvailableServerId(values);
    values.add(serverURL + "|" + instanceName);
    as.setDefaultValues(values);
    OrganizationConfigManager ocm=new OrganizationConfigManager(token,"/");
    Map<String,Object> attrs=ocm.getAttributes("sunIdentityRepositoryService");
    Set<String> origValues=(Set<String>)attrs.get("sunOrganizationAliases");
    if (!origValues.contains(hostName)) {
      values=new HashSet<String>();
      values.add(hostName);
      ocm.addAttributeValues("sunIdentityRepositoryService","sunOrganizationAliases",values);
    }
  }
}

private static void updatePlatformServerList ( String serverURL , String hostName ) throws SMSException , SSOException { SSOToken token = getAdminSSOToken ( ) ; ServiceSchemaManager ssm = new ServiceSchemaManager ( "iPlanetAMPlatformService" , token ) ; ServiceSchema ss = ssm . getGlobalSchema ( ) ; AttributeSchema as = ss . getAttributeSchema ( "iplanet-am-platform-server-list" ) ; Set < String > values = as . getDefaultValues ( ) ; if ( ! isInPlatformList ( values , serverURL ) ) { String instanceName = getNextAvailableServerId ( values ) ; values . add ( serverURL + "|" + instanceName ) ; as . setDefaultValues ( values ) ; OrganizationConfigManager ocm = new OrganizationConfigManager ( token , "/" ) ; Map < String , Object > attrs = ocm . getAttributes ( "sunIdentityRepositoryService" ) ; Set < String > origValues = ( Set < String > ) attrs . get ( "sunOrganizationAliases" ) ; if ( ! origValues . contains ( hostName ) ) { values = new HashSet < String > ( ) ; values . add ( hostName ) ; ocm . addAttributeValues ( "sunIdentityRepositoryService" , "sunOrganizationAliases" , values ) ; } } }
update platform server list and organization alias
