Package com.sun.identity.cli
Class AttributeValues
- java.lang.Object
-
- com.sun.identity.cli.AttributeValues
-
public class AttributeValues extends Object
This class provides utilities for process attribute values. The attribute values are passed into the CLI via properties file.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CLIExceptioncreateIncorrectFormatException(CommandManager mgr, String line)static booleanmergeAttributeValues(Map map1, Map map2, boolean bAdd)Merage two attribute values map.static booleanmergeAttributeValues(Map map1, Map map2, Map<String,Boolean> multipleAttributesMap, boolean bAdd)Merage two attribute values map.static Map<String,Set<String>>parse(CommandManager mgr, String fileName)Returns a map of attribute name to set of values.static Map<String,Set<String>>parse(CommandManager mgr, String fileName, List listAttributeValues)Returns a map of attribute name to set of values.static Map<String,Set<String>>parse(CommandManager mgr, List listAttributeValues)Returns a map of attribute name to set of values.static ListparseValues(String fileName)Returns a set of values.
-
-
-
Method Detail
-
parse
public static Map<String,Set<String>> parse(CommandManager mgr, String fileName, List listAttributeValues) throws CLIException
Returns a map of attribute name to set of values.- Parameters:
mgr- Command Manager object.fileName- Name of file that contains the attribute values data.listAttributeValues- list of attribute values in the format.<attribute-name>=<attribute-value>.- Returns:
- service attribute values.
- Throws:
CLIException- if the file contains data of incorrect format.
-
parse
public static Map<String,Set<String>> parse(CommandManager mgr, List listAttributeValues) throws CLIException
Returns a map of attribute name to set of values.- Parameters:
mgr- Command Manager object.listAttributeValues- list of attribute values in the format.<attribute-name>=<attribute-value>.- Returns:
- service attribute values.
- Throws:
CLIException- if the file contains data of incorrect format.
-
parse
public static Map<String,Set<String>> parse(CommandManager mgr, String fileName) throws CLIException
Returns a map of attribute name to set of values.- Parameters:
mgr- Command Manager object.fileName- Name of file that contains the attribute values data.- Returns:
- service attribute values.
- Throws:
CLIException- if the file contains data of incorrect format.
-
parseValues
public static List parseValues(String fileName) throws CLIException
Returns a set of values.- Parameters:
fileName- Name of file that contains the values data.- Returns:
- values.
- Throws:
CLIException- if the file contains data of incorrect format.
-
mergeAttributeValues
public static boolean mergeAttributeValues(Map map1, Map map2, Map<String,Boolean> multipleAttributesMap, boolean bAdd)
Merage two attribute values map.- Parameters:
map1- Map of String of Set of String.map2- Map of String of Set of String.multipleAttributesMap- map of attribute name totrueif the attribute type is multiple.bAdd-trueto add the values ofmap2map1.falseto remove values ofmap2frommap1.- Returns:
truemap1is altered.
-
mergeAttributeValues
public static boolean mergeAttributeValues(Map map1, Map map2, boolean bAdd)
Merage two attribute values map.- Parameters:
map1- Map of String of Set of String.map2- Map of String of Set of String.bAdd-trueto add the values ofmap2map1.falseto remove values ofmap2frommap1.- Returns:
truemap1is altered.
-
createIncorrectFormatException
public static CLIException createIncorrectFormatException(CommandManager mgr, String line)
-
-