* @return the host name
*/
public static String getHostName(final Map<String, String[]> parameterMap) {
+ if (parameterMap == null) {
+ return null;
+ }
+
if (!parameterMap.containsKey(HOSTNAME_PAR)) {
LOGGER.warn(PARAMETER + HOSTNAME_PAR + NOT_FOUND);
return null;
final String[] hostNameValue = parameterMap.get(HOSTNAME_PAR);
+ if (hostNameValue == null) {
+ return null;
+ }
+
if (hostNameValue.length == 0 || hostNameValue[0].trim().length() == 0) {
LOGGER.warn("value of parameter \"" + HOSTNAME_PAR + NOT_FOUND);
return null;
* @return the port
*/
public static int getPort(final Map<String, String[]> parameterMap) {
+ if (parameterMap == null) {
+ return -1;
+ }
+
if (!parameterMap.containsKey(PORT_PAR)) {
LOGGER.warn(PARAMETER + PORT_PAR + NOT_FOUND);
return -1;
}
final String[] portValue = parameterMap.get(PORT_PAR);
-
+
+ if (portValue == null) {
+ return -1;
+ }
+
if (portValue.length == 0 || portValue[0].trim().length() == 0) {
LOGGER.warn("value of parameter \"" + PORT_PAR + NOT_FOUND);
return -1;
* @return the engine key
*/
public static AxArtifactKey getEngineKey(final Map<String, String[]> parameterMap) {
+ if (parameterMap == null) {
+ return null;
+ }
+
String artifactKeyParameter = null;
for (final String parameter : parameterMap.keySet()) {
// Check for an AxArtifactKey parameter
return null;
}
- return new AxArtifactKey(axArtifactKeyArray[1]);
+ try {
+ return new AxArtifactKey(axArtifactKeyArray[1]);
+ }
+ catch (Exception apEx) {
+ LOGGER.trace("invalid artifact key ID {}", axArtifactKeyArray[1], apEx);
+ return null;
+ }
}
/**
*/
public static ParameterCheck.StartStop getStartStop(final Map<String, String[]> parameterMap,
final AxArtifactKey engineKey) {
+ if (parameterMap == null || engineKey == null) {
+ return null;
+ }
+
final String startStopPar = AXARTIFACTKEY_PAR + '#' + engineKey.getId();
if (!parameterMap.containsKey(startStopPar)) {
LOGGER.warn("parameter \"{}\" not found", startStopPar);
}
final String[] startStopValue = parameterMap.get(startStopPar);
+
+ if (startStopValue == null) {
+ return null;
+ }
if (startStopValue.length == 0 || startStopValue[0].trim().length() == 0) {
LOGGER.warn("value of parameter \"{}\" not found", startStopPar);
* @return The long value
*/
public static long getLong(final Map<String, String[]> parameterMap, final String longName) {
+ if (parameterMap == null || longName == null) {
+ return -1;
+ }
+
if (!parameterMap.containsKey(longName)) {
LOGGER.warn("parameter \"{}\" not found", longName);
return -1;
final String[] longValue = parameterMap.get(longName);
+ if (longValue == null) {
+ return -1;
+ }
+
if (longValue.length == 0 || longValue[0].trim().length() == 0) {
LOGGER.warn("value of parameter \"{}\" not found", longName);
return -1;