Package org.jboss.jca.common.api.validator

Examples of org.jboss.jca.common.api.validator.ValidateException


    * @throws ValidateException in case of error
    */
   private void partialCommonValidate() throws ValidateException
   {
      if (this.backgroundValidationMillis != null && this.backgroundValidationMillis < 0)
         throw new ValidateException(bundle.invalidNegative(Tag.BACKGROUND_VALIDATION_MILLIS.getLocalName()));
   }
View Full Code Here


   @Override
   public void validate() throws ValidateException
   {
      if (this.driverClass != null && (this.connectionUrl == null || this.connectionUrl.trim().length() == 0))
         throw new ValidateException(bundle.requiredElementMissing(Tag.CONNECTION_URL.getLocalName(),
                                                                   this.getClass().getCanonicalName()));
     
      if ((this.driverClass == null || this.driverClass.trim().length() == 0) &&
          (this.dataSourceClass == null || this.dataSourceClass.trim().length() == 0) &&
          (this.driver == null || this.driver.trim().length() == 0))
         throw new ValidateException(bundle.requiredElementMissing(Tag.DRIVER_CLASS.getLocalName(),
                                                                   this.getClass().getCanonicalName()));
   }
View Full Code Here

   @Override
   public void validate() throws ValidateException
   {
      if (this.maxPoolSize != null && this.maxPoolSize < 0)
         throw new ValidateException(bundle.invalidNegative(Tag.MAX_POOL_SIZE.getLocalName()));

      if (this.minPoolSize != null && this.minPoolSize < 0)
         throw new ValidateException(bundle.invalidNegative(Tag.MIN_POOL_SIZE.getLocalName()));

      if (this.minPoolSize != null && this.maxPoolSize != null)
      {
         if (minPoolSize.intValue() > maxPoolSize.intValue())
            throw new ValidateException(bundle.notValidNumber(minPoolSize.toString(),
                                                              Tag.MIN_POOL_SIZE.getLocalName()));
      }

      if (this.flushStrategy == null)
         throw new ValidateException(bundle.nullValue(Tag.FLUSH_STRATEGY.getLocalName()));
   }
View Full Code Here

   @Override
   public void validate() throws ValidateException
   {
      if (this.preparedStatementsCacheSize != null && this.preparedStatementsCacheSize < 0)
         throw new ValidateException(bundle.invalidNegative(Tag.PREPARED_STATEMENT_CACHE_SIZE.getLocalName()));
   }
View Full Code Here

   @Override
   public void validate() throws ValidateException
   {
      if (this.name == null || this.name.trim().length() == 0)
         throw new ValidateException(bundle.requiredAttributeMissing(Attribute.NAME.getLocalName(),
                                                                     this.getClass().getCanonicalName()));

   }
View Full Code Here

   @Override
   public void validate() throws ValidateException
   {
      if (this.queryTimeout != null && this.queryTimeout < 0)
         throw new ValidateException(bundle.invalidNegative(TimeOut.Tag.QUERY_TIMEOUT.getLocalName()));

      if (this.useTryLock != null && this.useTryLock < 0)
         throw new ValidateException(bundle.invalidNegative(TimeOut.Tag.USE_TRY_LOCK.getLocalName()));
   }
View Full Code Here

   @Override
   public void validate() throws ValidateException
   {
      if (this.backgroundValidationMillis != null && this.backgroundValidationMillis < 0)
         throw new ValidateException(
            bundle.invalidNegative(Validation.Tag.BACKGROUND_VALIDATION_MILLIS.getLocalName()));

      if (this.validConnectionChecker != null)
         try
         {
            this.validConnectionChecker.validate();
         }
         catch (ValidateException ve)
         {
            throw new ValidateException(bundle.invalidTag(Validation.Tag.VALID_CONNECTION_CHECKER.getLocalName()), ve);
         }
      if (this.exceptionSorter != null)
         try
         {
            this.exceptionSorter.validate();
         }
         catch (ValidateException ve)
         {
            throw new ValidateException(bundle.invalidTag(Validation.Tag.EXCEPTION_SORTER.getLocalName()), ve);
         }
      if (this.staleConnectionChecker != null)
         try
         {
            this.staleConnectionChecker.validate();
         }
         catch (ValidateException ve)
         {
            throw new ValidateException(bundle.invalidTag(Validation.Tag.STALE_CONNECTION_CHECKER.getLocalName()), ve);
         }
   }
View Full Code Here

    * @throws ValidateException ValidateException
    */
   protected void partialCommonValidation() throws ValidateException
   {
      if (this.jndiName == null)
         throw new ValidateException(bundle.requiredAttributeMissing(DataSource.Attribute.JNDI_NAME.getLocalName(),
                                                                     this.getClass().getCanonicalName()));
      if (this.poolName == null)
         throw new ValidateException(bundle.requiredAttributeMissing(DataSource.Attribute.POOL_NAME.getLocalName(),
                                                                     this.getClass().getCanonicalName()));

      if (this.timeOut != null)
         this.timeOut.validate();
      if (this.security != null)
View Full Code Here

   {
      if (securityDomainManaged != null && !securityDomainManaged.trim().equals(""))
      {
         if (securityDomainAndApplicationManaged != null && !securityDomainAndApplicationManaged.trim().equals(""))
         {
            throw new ValidateException(bundle.invalidSecurityConfiguration());
         }
         if (applicationManaged)
         {
            throw new ValidateException(bundle.invalidSecurityConfiguration());
         }
      }
      else
      {
         if (securityDomainAndApplicationManaged != null && !securityDomainAndApplicationManaged.trim().equals(""))
         {
            if (applicationManaged)
            {
               throw new ValidateException(bundle.invalidSecurityConfiguration());
            }
         }
         else
         {
            if (!applicationManaged)
            {
               throw new ValidateException(bundle.invalidSecurityConfiguration());
            }
         }
      }
   }
View Full Code Here

   }

   private void partialCommonValidate() throws ValidateException
   {
      if (this.allocationRetry != null && this.allocationRetry < 0)
         throw new ValidateException(bundle.invalidNegative(Tag.ALLOCATION_RETRY.getLocalName()));

      if (this.blockingTimeoutMillis != null && this.blockingTimeoutMillis < 0)
         throw new ValidateException(bundle.invalidNegative(Tag.BLOCKING_TIMEOUT_MILLIS.getLocalName()));

      if (this.allocationRetryWaitMillis != null && this.allocationRetryWaitMillis < 0)
         throw new ValidateException(bundle.invalidNegative(Tag.ALLOCATION_RETRY_WAIT_MILLIS.getLocalName()));

      if (this.idleTimeoutMinutes != null && this.idleTimeoutMinutes < 0)
         throw new ValidateException(bundle.invalidNegative(Tag.IDLE_TIMEOUT_MINUTES.getLocalName()));

      if (this.xaResourceTimeout != null && this.xaResourceTimeout < 0)
         throw new ValidateException(bundle.invalidNegative(Tag.XA_RESOURCE_TIMEOUT.getLocalName()));
   }
View Full Code Here

TOP

Related Classes of org.jboss.jca.common.api.validator.ValidateException

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.