Package org.serviceconnector.cmd

Examples of org.serviceconnector.cmd.SCMPValidatorException


      // needs to set message type at this point
      ex.setMessageType(getKey());
      throw ex;
    } catch (Throwable th) {
      LOGGER.error("validation error", th);
      SCMPValidatorException validatorException = new SCMPValidatorException();
      validatorException.setMessageType(getKey());
      throw validatorException;
    }
  }
View Full Code Here


      ValidatorUtility.validateInt(Constants.MIN_OTI_VALUE_SRV, otiValue, Constants.MAX_OTI_VALUE,
          SCMPError.HV_WRONG_OPERATION_TIMEOUT);
      // sc error code mandatory
      String sec = message.getHeader(SCMPHeaderAttributeKey.SC_ERROR_CODE);
      if (sec == null || sec.equals("")) {
        throw new SCMPValidatorException(SCMPError.HV_WRONG_SC_ERROR_CODE, "sc error code must be set");
      }
      // sc error text mandatory
      String set = message.getHeader(SCMPHeaderAttributeKey.SC_ERROR_TEXT);
      if (set == null || set.equals("")) {
        throw new SCMPValidatorException(SCMPError.HV_WRONG_SC_ERROR_TEXT, "sc error text must be set");
      }
    } catch (HasFaultResponseException ex) {
      // needs to set message type at this point
      ex.setMessageType(getKey());
      throw ex;
    } catch (Throwable th) {
      LOGGER.error("validation error", th);
      SCMPValidatorException validatorException = new SCMPValidatorException();
      validatorException.setMessageType(getKey());
      throw validatorException;
    }
  }
View Full Code Here

    int keepAliveOTISeconds = Integer.parseInt(context.getInitParameter(WebConstants.PROPERTY_KEEPALIVE_OTI));
    this.checkRegistrationIntervalSeconds = Integer.parseInt(context
        .getInitParameter(WebConstants.PROPERTY_CHECK_REGRISTRATION_INTERVAL));

    if (scHost == null) {
      throw new SCMPValidatorException("Host must be set.");
    }
    ValidatorUtility.validateInt(Constants.MIN_PORT_VALUE, scPort, Constants.MAX_PORT_VALUE, SCMPError.HV_WRONG_PORTNR);
    ValidatorUtility
        .validateInt(Constants.MIN_PORT_VALUE, this.tomcatPort, Constants.MAX_PORT_VALUE, SCMPError.HV_WRONG_PORTNR);
    if (scPort == this.tomcatPort) {
      throw new SCMPValidatorException("SC port and tomcat port must not be the same.");
    }
    // init the requester to communicate to SC
    RemoteNodeConfiguration remoteNodeConf = new RemoteNodeConfiguration(remotNodeName, scHost, scPort,
        ConnectionType.NETTY_HTTP.getValue(), keepAliveIntervalToSCSeconds, checkRegistrationIntervalSeconds, 1);
    this.requester = new SCRequester(remoteNodeConf, keepAliveOTISeconds * Constants.SEC_TO_MILLISEC_FACTOR);
 
View Full Code Here

    // 1. checking preconditions and validate
    if (this.attached) {
      throw new SCServiceException("SCClient already attached.");
    }
    if (host == null) {
      throw new SCMPValidatorException("Host is missing.");
    }
    ValidatorUtility.validateInt(Constants.MIN_PORT_VALUE, this.port, Constants.MAX_PORT_VALUE, SCMPError.HV_WRONG_PORTNR);
    // 2. initialize call & invoke
    synchronized (AppContext.communicatorsLock) {
      AppContext.init();
View Full Code Here

  public SCFileService newFileService(String serviceName) throws SCServiceException, SCMPValidatorException {
    if (this.attached == false) {
      throw new SCServiceException("Creating a new file service not possible - client not attached.");
    }
    if (serviceName == null) {
      throw new SCMPValidatorException("Service name must be set.");
    }
    ValidatorUtility
        .validateStringLengthTrim(1, serviceName, Constants.MAX_LENGTH_SERVICENAME, SCMPError.HV_WRONG_SERVICE_NAME);
    return new SCFileService(this, serviceName, this.requester);
  }
View Full Code Here

  public SCSessionService newSessionService(String serviceName) throws SCServiceException, SCMPValidatorException {
    if (this.attached == false) {
      throw new SCServiceException("Creating a new session service not possible - client not attached.");
    }
    if (serviceName == null) {
      throw new SCMPValidatorException("Service name must be set.");
    }
    ValidatorUtility
        .validateStringLengthTrim(1, serviceName, Constants.MAX_LENGTH_SERVICENAME, SCMPError.HV_WRONG_SERVICE_NAME);
    return new SCSessionService(this, serviceName, this.requester);
  }
View Full Code Here

  public synchronized SCPublishService newPublishService(String serviceName) throws SCServiceException, SCMPValidatorException {
    if (this.attached == false) {
      throw new SCServiceException("Creating a new publish service not possible - client not attached.");
    }
    if (serviceName == null) {
      throw new SCMPValidatorException("Service name must be set.");
    }
    ValidatorUtility
        .validateStringLengthTrim(1, serviceName, Constants.MAX_LENGTH_SERVICENAME, SCMPError.HV_WRONG_SERVICE_NAME);
    return new SCPublishService(this, serviceName, this.requester);
  }
View Full Code Here

    if (this.cacheGuardian != null && this.cacheGuardian.isActive() == true) {
      throw new SCServiceException("Cache Guardian already started.");
    }
    if (guardianName == null) {
      throw new SCMPValidatorException("Cache Guardian name must be set.");
    }
    ValidatorUtility.validateStringLengthTrim(1, guardianName, Constants.MAX_LENGTH_SERVICENAME,
        SCMPError.HV_WRONG_SERVICE_NAME);

    this.cacheGuardian = new SCGuardianService(this, guardianName, this.requester);
View Full Code Here

      // needs to set message type at this point
      ex.setMessageType(getKey());
      throw ex;
    } catch (Throwable th) {
      LOGGER.error("validation error", th);
      SCMPValidatorException validatorException = new SCMPValidatorException();
      validatorException.setMessageType(getKey());
      throw validatorException;
    }
  }
View Full Code Here

      // needs to set message type at this point
      ex.setMessageType(getKey());
      throw ex;
    } catch (Throwable th) {
      LOGGER.error("validation error", th);
      SCMPValidatorException validatorException = new SCMPValidatorException();
      validatorException.setMessageType(getKey());
      throw validatorException;
    }
  }
View Full Code Here

TOP

Related Classes of org.serviceconnector.cmd.SCMPValidatorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.