Package org.serviceconnector.cmd

Examples of org.serviceconnector.cmd.SCMPValidatorException


  public SCPublishServer newPublishServer(String serviceName) throws SCServiceException, SCMPValidatorException {
    if (this.listening == false) {
      throw new SCServiceException("newPublishServer not possible - server not listening.");
    }
    if (serviceName == null) {
      throw new SCMPValidatorException("service name must be set");
    }
    return new SCPublishServer(this, serviceName, 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

    }
    String fileName = fileAppender.getFile();
    String fs = System.getProperty("file.separator");
    int index = fileName.lastIndexOf(fs);
    if (index == -1) {
      throw new SCMPValidatorException(SCMPError.V_WRONG_CONFIGURATION_FILE, "invalid log directory=" + fileName);
    }
    String path = null;
    if (fileName.lastIndexOf(":") == -1) {
      path = System.getProperty("user.dir") + fs + fileName.substring(0, index); // relative path
    } else {
View Full Code Here

  }

  /** {@inheritDoc} */
  @Override
  public void validate(IRequest request) throws Exception {
    throw new SCMPValidatorException(SCMPError.HV_ERROR, "validator is not implemented");
  }
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 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

   * @throws SCMPValidatorException
   *             the SCMP validator exception
   */
  public static void validateDateTime(String dateTimeString, SCMPError error) throws SCMPValidatorException {
    if (dateTimeString == null) {
      throw new SCMPValidatorException(SCMPError.HV_ERROR, "date time value is missing");
    }
    try {
      DateTimeUtility.parseDateString(dateTimeString);
    } catch (ParseException ex) {
      throw new SCMPValidatorException(SCMPError.HV_WRONG_LDT, dateTimeString + " should be="
          + Constants.SCMP_FORMAT_OF_DATE_TIME);
    }
  }
View Full Code Here

   * @throws SCMPValidatorException
   *             the SCMP validator exception
   */
  public static void validateDateTime(Date dateTime, SCMPError error) throws SCMPValidatorException {
    if (dateTime == null) {
      throw new SCMPValidatorException(SCMPError.HV_ERROR, "date time value is missing");
    }

    validateDateTime(DATE_TIME_FORMAT.format(dateTime), error);
  }
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.