use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class ChoiceValidator method isChoiceValid.
/**
* Method isChoiceValid
*
*
* @param choice
* @param props
* @param IStateAccess
*
* @return ValidationResult
*
*/
public ValidationResult isChoiceValid(String choice, Map props, IStateAccess state) {
ValidationResultStatus validRes = ValidationResultStatus.STATUS_FAILED;
LocalizedMessage returnMessage = null;
boolean ignoreCase = getIgnoreCaseStat(props);
if ((choice != null) && (choice.length() > 0)) {
Iterator iter = props.entrySet().iterator();
while (iter.hasNext()) {
Map.Entry me = (Map.Entry) iter.next();
String key = (String) me.getKey();
// We are only interested with keys starting with "value"
if (key.startsWith(STR_VAL_MATCH_PATTERN)) {
String val = (String) me.getValue();
if (val != null) {
if (ignoreCase) {
if (choice.equalsIgnoreCase(val)) {
validRes = ValidationResultStatus.STATUS_SUCCESS;
Debug.log("ChoiceValidator:isChoiceValid(..) " + " comparing value = " + val + ", with choice " + "=" + choice + ", ignore case = " + ignoreCase + ", comparison result = " + true);
break;
}
} else {
if (choice.equals(val)) {
validRes = ValidationResultStatus.STATUS_SUCCESS;
Debug.log("ChoiceValidator:isChoiceValid(..) " + " comparing value = " + val + ", with choice " + "=" + choice + ", ignore case = " + ignoreCase + ", comparison result = " + true);
break;
}
}
}
}
}
}
if (validRes.getIntValue() == ValidationResultStatus.INT_STATUS_FAILED) {
returnMessage = LocalizedMessage.get(LOC_VA_WRN_IN_VAL_CHOICE, new Object[] { choice });
} else {
returnMessage = LocalizedMessage.get(LOC_VA_MSG_VAL_CHOICE, new Object[] { choice });
}
Debug.log("ChoiceValidator:isChoiceValid(..) Is choice valid ? " + validRes.isSuccessful());
return new ValidationResult(validRes, null, returnMessage);
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class CustomInstallDriver method getAgentConfigFilePathMessage.
public LocalizedMessage getAgentConfigFilePathMessage() {
String agentConfigFilePath = (String) getInstallState().getStateAccess().get(STR_CONFIG_AGENT_CONFIG_FILE_PATH_TAG);
Object[] args = { agentConfigFilePath };
LocalizedMessage message = LocalizedMessage.get(LOC_DR_MSG_PRODUCT_AGENT_CONFIG_FILE_NAME, args);
return message;
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class Driver method printConsoleMessage.
/*
* Used to print the welcome and exit message for console mode
*/
public void printConsoleMessage(I18NInfo messageInfo) {
//Only in console mode
if (!isSilentMode()) {
LocalizedMessage message = LocalizedMessage.get(messageInfo.getKey(), messageInfo.getGroup());
Console.println();
Console.println(message);
Console.println();
}
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class Driver method getLogFilePathMessage.
public LocalizedMessage getLogFilePathMessage(InstallLogger installLog, String installLogLocKey) {
Audit installAuditLog = installLog.getLogger();
Object[] args = { installAuditLog.getAuditLogFileName() };
LocalizedMessage message = LocalizedMessage.get(installLogLocKey, args);
return message;
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class CreateLayoutTask method createDir.
private void createDir(String dirName) throws InstallException {
Debug.log("LayoutHandlerTask.createDir() - Creating Dir for: " + dirName);
File dir = new File(dirName);
if (!dir.mkdir()) {
Debug.log("LayoutHandlerTask.createDir() - Error Unable to " + "create Dir for: " + dirName);
// If the creation is not successful throw an Exception
LocalizedMessage lMessage = LocalizedMessage.get(LOC_DR_ERR_DIR_CREATE, new Object[] { dirName });
throw new InstallException(lMessage);
}
}
Aggregations