public static void cloneServerInstance(SSOToken ssoToken,String serverName,String cloneName,String cloneId) throws SMSException, SSOException, ConfigurationException {
  URL url=null;
  try {
    url=new URL(cloneName);
  }
 catch (  MalformedURLException ex) {
    String[] param={cloneName};
    throw new ConfigurationException("invalid.server.name",param);
  }
  ServiceConfig cfg=getServerConfig(ssoToken,serverName);
  if (cfg != null) {
    Map map=cfg.getAttributes();
    ServiceConfig sc=getRootServerConfigWithRetry(ssoToken);
    if (sc != null) {
      Set setID=new HashSet(2);
      setID.add(cloneId);
      map.put(ATTR_SERVER_ID,setID);
      setProtocolHostPortURI(map,cloneName);
      sc.addSubConfig(cloneName,SUBSCHEMA_SERVER,0,map);
      updateOrganizationAlias(ssoToken,cloneName,true);
    }
  }
}

public static void cloneServerInstance ( SSOToken ssoToken , String serverName , String cloneName , String cloneId ) throws SMSException , SSOException , ConfigurationException { URL url = null ; try { url = new URL ( cloneName ) ; } catch ( MalformedURLException ex ) { String [ ] param = { cloneName } ; throw new ConfigurationException ( "invalid.server.name" , param ) ; } ServiceConfig cfg = getServerConfig ( ssoToken , serverName ) ; if ( cfg != null ) { Map map = cfg . getAttributes ( ) ; ServiceConfig sc = getRootServerConfigWithRetry ( ssoToken ) ; if ( sc != null ) { Set setID = new HashSet ( 2 ) ; setID . add ( cloneId ) ; map . put ( ATTR_SERVER_ID , setID ) ; setProtocolHostPortURI ( map , cloneName ) ; sc . addSubConfig ( cloneName , SUBSCHEMA_SERVER , 0 , map ) ; updateOrganizationAlias ( ssoToken , cloneName , true ) ; } } }
clones a server instance .
