/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: AMGenerateServerID.java,v 1.4 2008/06/25 05:41:27 qcheng Exp $
*
*/
/**
* This class is basically used to generate two byte string server id that can
* be used to update the platform server list. This class will be used either
* during multiserver install or during existing dit install to update the
* server entry list. By default, during our install, our platform server list
* has it's default server id as "01" separated by delimiter "|". This class
* also takes care for not generating existing server id in the current platform
* server list.
*/
public class AMGenerateServerID {
.toCharArray();
" Usage: AMGenerateServerID create|delete " +
"<serverurl> amadminDN amadminPassword");
}
try {
password);
}
}
if (debug.messageEnabled()) {
}
} else {
+ serverUrl);
}
} else {
}
} catch (Exception e) {
}
}
/**
* This method returns server id for a corresponding server
*/
continue;
}
if (index != -1) {
.length());
return serverId;
}
}
return serverId;
}
/**
* This function returns a two byte string but by skipping if finds it in
* the passing hashed set. This function generates two byte strings in an
* order starting from "01, 02, 03,.........,aa, ab,.....,zz,...ZZ"
*/
char[] out = new char[2];
continue;
}
return temp;
}
}
// Return a random string, it should never come to this.
return "xx";
}
}