public class VmPropertiesUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
VmPropertiesUtils.ValidationError |
static class |
VmPropertiesUtils.ValidationFailureReason |
static class |
VmPropertiesUtils.VMCustomProperties |
Constructor and Description |
---|
VmPropertiesUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
customProperties(String predefinedProperties,
String userDefinedProperties)
Composes custom properties string from predefined properties and user defined properties strings
|
static List<String> |
generateErrorMessages(List<VmPropertiesUtils.ValidationError> errorsList,
String syntaxErrorMessage,
Map<VmPropertiesUtils.ValidationFailureReason,String> failureReasonsToVdcBllMessagesMap,
Map<VmPropertiesUtils.ValidationFailureReason,String> failureReasonsToParameterFormatStrings)
Generates an error message to be displayed by frontend
|
static Map<String,String> |
getPredefinedProperties(VmStatic vmStatic)
Gets a map containing the predefined properties from VM
|
static Map<String,String> |
getUserDefinedProperties(VmStatic vmStatic)
Get a map containing user defined properties from VM
|
static void |
getVMProperties(Map<String,String> propertiesMap,
String vmPropertiesFieldValue)
Converts VM properties field value (either UserDefined or defined) to a map containing property names & values
|
static Map<String,String> |
getVMProperties(VmStatic vmStatic)
Get a map containing all the VM custom properties
|
static VmPropertiesUtils.VMCustomProperties |
parseProperties(String propertiesStr)
Parses a string containing user defined and predefined custom properties and returns VMCustomProperties object
that contains the properties separated to two strings - one for the predefined properties and one for the user
defined properties
|
static void |
separateValidationErrorsList(List<VmPropertiesUtils.ValidationError> errorsList,
Map<VmPropertiesUtils.ValidationFailureReason,List<VmPropertiesUtils.ValidationError>> resultMap)
Splits the validation errors list to lists of missing keys and wrong key values
|
static void |
separeteCustomPropertiesToUserAndPredefined(VmStatic vmStatic) |
static List<VmPropertiesUtils.ValidationError> |
validateVMProperties(VmStatic vmStatic)
Validates all the custom properties of a VM
|
public static VmPropertiesUtils.VMCustomProperties parseProperties(String propertiesStr)
propertiesStr
- public static List<VmPropertiesUtils.ValidationError> validateVMProperties(VmStatic vmStatic)
vmStatic
- public static Map<String,String> getVMProperties(VmStatic vmStatic)
public static Map<String,String> getUserDefinedProperties(VmStatic vmStatic)
vm
- vm to get the map forpublic static Map<String,String> getPredefinedProperties(VmStatic vmStatic)
vm
- vm to get the map forpublic static void getVMProperties(Map<String,String> propertiesMap, String vmPropertiesFieldValue)
propertiesMap
- map that will hold the conversion resultvmPropertiesFieldValue
- the string value that contains the propertiespublic static String customProperties(String predefinedProperties, String userDefinedProperties)
predefinedProperties
- userDefinedProperties
- public static void separateValidationErrorsList(List<VmPropertiesUtils.ValidationError> errorsList, Map<VmPropertiesUtils.ValidationFailureReason,List<VmPropertiesUtils.ValidationError>> resultMap)
errorsList
- missingKeysList
- wrongKeyValues
- public static List<String> generateErrorMessages(List<VmPropertiesUtils.ValidationError> errorsList, String syntaxErrorMessage, Map<VmPropertiesUtils.ValidationFailureReason,String> failureReasonsToVdcBllMessagesMap, Map<VmPropertiesUtils.ValidationFailureReason,String> failureReasonsToParameterFormatStrings)
errorsList
- list of errors obtained from parsingsyntaxErrorMessage
- error to be displayed in case of syntax errorfailureReasonsToVdcBllMessagesMap
- map of errors to vdc bll messages (for presentation of errors from AppErrors.resx)failureReasonsToParameterFormatStrings
- map of errors to format string (for presentation of values for the errors are defined in
AppError.resx)public static void separeteCustomPropertiesToUserAndPredefined(VmStatic vmStatic)
Copyright © 2012. All Rights Reserved.