* encoding of request URL failed<br />
*/
public boolean isServiceEnabled(int operationTimeout, String serviceName) throws SCServiceException,
UnsupportedEncodingException {
if (this.attached == false) {
throw new SCServiceException("Client not attached - isServiceEnabled not possible.");
}
String urlString = URLString.toURLRequestString(Constants.CC_CMD_STATE, Constants.SERVICE_NAME, serviceName);
try {
String body = this.inspectCall(operationTimeout, urlString);
URLString urlResponse = new URLString();
urlResponse.parseResponseURLString(body);
String value = urlResponse.getParamValue(serviceName);
if (value != null && value.equals(Constants.STATE_ENABLED)) {
return true;
}
return false;
} catch (SCServiceException e) {
if (e.getSCErrorCode() == SCMPError.SERVICE_NOT_FOUND.getErrorCode()) {
return false;
}
throw e;
} catch (UnsupportedEncodingException e) {
throw new SCServiceException(e.toString());
}
}