public static boolean createServerInstance(SSOToken ssoToken,String instanceName,String instanceId,Set values,String serverConfigXML) throws SMSException, SSOException, ConfigurationException, UnknownPropertyNameException {
  boolean created=false;
  if (!instanceName.equals(DEFAULT_SERVER_CONFIG)) {
    validateProperty(ssoToken,values);
  }
  ServiceConfig sc=getRootServerConfigWithRetry(ssoToken);
  if (sc != null) {
    if (!instanceName.equals(DEFAULT_SERVER_CONFIG)) {
      try {
        new URL(instanceName);
      }
 catch (      MalformedURLException ex) {
        String[] param={instanceName};
        throw new ConfigurationException("invalid.server.name",param);
      }
    }
    Map serverValues=new HashMap(4);
    Set setServerId=new HashSet(2);
    setServerId.add(instanceId);
    serverValues.put(ATTR_SERVER_ID,setServerId);
    if (values.isEmpty()) {
      values=new HashSet(2);
    }
    values.add(Constants.PROPERTY_NAME_LB_COOKIE_VALUE + "=" + instanceId);
    Set setServerConfigXML=new HashSet(2);
    setServerConfigXML.add(serverConfigXML);
    serverValues.put(ATTR_SERVER_CONFIG_XML,setServerConfigXML);
    serverValues.put(ATTR_SERVER_CONFIG,values);
    if (!instanceName.equals(DEFAULT_SERVER_CONFIG)) {
      setProtocolHostPortURI(serverValues,instanceName);
    }
    sc.addSubConfig(instanceName,SUBSCHEMA_SERVER,0,serverValues);
    created=true;
  }
  if (created && !instanceName.equals(DEFAULT_SERVER_CONFIG)) {
    updateOrganizationAlias(ssoToken,instanceName,true);
  }
  return created;
}

public static boolean createServerInstance ( SSOToken ssoToken , String instanceName , String instanceId , Set values , String serverConfigXML ) throws SMSException , SSOException , ConfigurationException , UnknownPropertyNameException { boolean created = false ; if ( ! instanceName . equals ( DEFAULT_SERVER_CONFIG ) ) { validateProperty ( ssoToken , values ) ; } ServiceConfig sc = getRootServerConfigWithRetry ( ssoToken ) ; if ( sc != null ) { if ( ! instanceName . equals ( DEFAULT_SERVER_CONFIG ) ) { try { new URL ( instanceName ) ; } catch ( MalformedURLException ex ) { String [ ] param = { instanceName } ; throw new ConfigurationException ( "invalid.server.name" , param ) ; } } Map serverValues = new HashMap ( 4 ) ; Set setServerId = new HashSet ( 2 ) ; setServerId . add ( instanceId ) ; serverValues . put ( ATTR_SERVER_ID , setServerId ) ; if ( values . isEmpty ( ) ) { values = new HashSet ( 2 ) ; } values . add ( Constants . PROPERTY_NAME_LB_COOKIE_VALUE + "=" + instanceId ) ; Set setServerConfigXML = new HashSet ( 2 ) ; setServerConfigXML . add ( serverConfigXML ) ; serverValues . put ( ATTR_SERVER_CONFIG_XML , setServerConfigXML ) ; serverValues . put ( ATTR_SERVER_CONFIG , values ) ; if ( ! instanceName . equals ( DEFAULT_SERVER_CONFIG ) ) { setProtocolHostPortURI ( serverValues , instanceName ) ; } sc . addSubConfig ( instanceName , SUBSCHEMA_SERVER , 0 , serverValues ) ; created = true ; } if ( created && ! instanceName . equals ( DEFAULT_SERVER_CONFIG ) ) { updateOrganizationAlias ( ssoToken , instanceName , true ) ; } return created ; }
creates a server instance .
