ServerIDValidator.java revision f2b7e2373c5d1aacf05b91ab8e316d6aea0b948b
/**
* 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: ServerIDValidator.java,v 1.3 2008/06/25 05:44:05 qcheng Exp $
*
*/
/**
* Portions Copyrighted 2011-2016 ForgeRock AS.
*/
/**
* The class <code>ServerIDValidator</code> is used to validate the correct
* string format for the attribute iplanet-am-platform-server-list in
* iPlanetAMPlatformService. e.g. proto://host.port|xx where xx is an unique
* identifier and could any two bytes value
*/
public class ServerIDValidator implements ServiceAttributeValidator {
/**
* Validates the values for the attribute iplanet-am-platform-server-list.
*
* @param values
* the set of values to be validated
* @return true if all of the values are valid; false otherwise
*/
return true;
}
boolean siteLookup;
siteLookup = getSiteDetails();
int count = 0;
while (tok.hasMoreTokens()) {
return false;
}
switch (count) {
case 0:
if (siteLookup) {
return false;
}
}
break;
default:
if (count > 0) {
if (idx > -1) {
return false;
}
if (siteLookup) {
if (!validateID(lbid)) {
return false;
}
} else {
// Just log the message for validation
if (debug.messageEnabled()) {
"information. Site validation cannot " +
"be performed");
}
}
} else {
return false;
}
break;
}
if (tok.hasMoreTokens()) {
count++;
}
return false;
} else {
}
}
return false;
} else {
}
return false;
}
}
return true;
}
/**
* Internal method for checking if ServerID exits in SiteID list
*
* @param sId
* serverID
* @return true if serverID exits in Site list, false otherwise
*/
}
/**
* Internal method for getting the Site list
*
* @return true if Site list is obtained, false otherwise
*/
private boolean getSiteDetails() {
if (!siteAddrSet.isEmpty()) {
return true;
}
try {
}
}
}
}
return true;
} catch (SMSException se) {
if (debug.messageEnabled()) {
"config: SMSException", se);
}
} catch (SSOException ssoe) {
if (debug.messageEnabled()) {
"config: SSOException", ssoe);
}
}
return false;
}
}