AttributeValues.java revision 80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 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: AttributeValues.java,v 1.10 2009/10/09 23:14:26 veiming Exp $
*
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
/**
* This class provides utilities for process attribute values. The attribute
* values are passed into the CLI via properties file.
*/
public class AttributeValues {
private AttributeValues() {
}
/**
* Returns a map of attribute name to set of values.
*
* @param mgr Command Manager object.
* @param fileName Name of file that contains the attribute values data.
* @param listAttributeValues list of attribute values in the format.
* <code><attribute-name>=<attribute-value></code>.
* @return service attribute values.
* @throws CLIException if the file contains data of incorrect format.
*/
) throws CLIException {
}
} else {
}
}
}
/**
* Returns a map of attribute name to set of values.
*
* @param mgr Command Manager object.
* @param listAttributeValues list of attribute values in the format.
* <code><attribute-name>=<attribute-value></code>.
* @return service attribute values.
* @throws CLIException if the file contains data of incorrect format.
*/
throws CLIException {
new HashMap();
boolean retry = true;
int idx = 0;
while (retry) {
if (idx == -1) {
throw createIncorrectFormatException(mgr, s);
}
}
}
}
}
}
return attrValues;
}
/**
* Returns a map of attribute name to set of values.
*
* @param mgr Command Manager object.
* @param fileName Name of file that contains the attribute values data.
* @return service attribute values.
* @throws CLIException if the file contains data of incorrect format.
*/
throws CLIException {
try {
boolean retry = true;
int idx = 0;
while (retry) {
if (idx == -1) {
}
}
}
}
}
} catch (IOException e) {
} finally {
try {
} catch (IOException e) {
//ignore cannot close input stream
}
}
}
return attrValues;
}
while (idx != -1) {
}
}
/**
* Returns a set of values.
*
* @param fileName Name of file that contains the values data.
* @return values.
* @throws CLIException if the file contains data of incorrect format.
*/
throws CLIException
{
try {
}
}
} catch (IOException e) {
} finally {
try {
} catch (IOException e) {
//ignore cannot close input stream
}
}
}
return values;
}
/**
* Merage two attribute values map.
*
* @param map1 Map of String of Set of String.
* @param map2 Map of String of Set of String.
* @param multipleAttributesMap map of attribute name to <code>true</code>
* if the attribute type is multiple.
* @param bAdd <code>true</code> to add the values of <code>map2</code>
* <code>map1</code>. <code>false</code> to remove values of
* <code>map2</code> from <code>map1</code>.
* @return <code>true</code. is <code>map1</code> is altered.
*/
public static boolean mergeAttributeValues(
boolean bAdd
) {
boolean modified = false;
if (!multipleTyped) {
modified = true;
} else if (bAdd) {
modified = true;
}
}
return modified;
}
/**
* Merage two attribute values map.
*
* @param map1 Map of String of Set of String.
* @param map2 Map of String of Set of String.
* @param bAdd <code>true</code> to add the values of <code>map2</code>
* <code>map1</code>. <code>false</code> to remove values of
* <code>map2</code> from <code>map1</code>.
* @return <code>true</code. is <code>map1</code> is altered.
*/
public static boolean mergeAttributeValues(
boolean bAdd
) {
boolean modified = false;
} else if (bAdd) {
modified = true;
}
}
return modified;
}
public static CLIException createIncorrectFormatException(
) {
}
while (idx != -1) {
boolean done = false;
if (idx > 0) {
done = true;
}
}
if (!done) {
.append(
}
}
}
}