Package org.apache.juddi.error

Examples of org.apache.juddi.error.ValueNotAllowedException


  public void validateSubscriptions(EntityManager em, List<org.uddi.sub_v3.Subscription> entityList) throws DispositionReportFaultMessage {

    // No null or empty list
    if (entityList == null || entityList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.savesubscription.NoInput"));
   
    for (org.uddi.sub_v3.Subscription entity : entityList) {
      validateSubscription(em, entity);
    }
  }
View Full Code Here


 
  public void validateSubscription(EntityManager em, org.uddi.sub_v3.Subscription subscription) throws DispositionReportFaultMessage {

    // A supplied subscription can't be null
    if (subscription == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.subscription.NullInput"));
   
    boolean entityExists = false;
    String entityKey = subscription.getSubscriptionKey();
    if (entityKey == null || entityKey.length() == 0) {
      KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
View Full Code Here

    validateSubscriptionFilter(subscription.getSubscriptionFilter(), entityExists);
  }

  public void validateSubscriptionFilter(SubscriptionFilter subscriptionFilter, boolean entityExists) throws DispositionReportFaultMessage {
    if (!entityExists && subscriptionFilter == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.subscription.NoFilterOnNewSubscription"));
     
    if (subscriptionFilter != null) {
      int filterCount = 0;
      ValidateInquiry validateInquiry = new ValidateInquiry(publisher);
      if (subscriptionFilter.getFindBinding() != null) {
        filterCount++;
        validateInquiry.validateFindBinding(subscriptionFilter.getFindBinding());
      }
      if (subscriptionFilter.getFindBusiness() != null) {
        filterCount++;
        validateInquiry.validateFindBusiness(subscriptionFilter.getFindBusiness());
      }
      if (subscriptionFilter.getFindService() != null) {
        filterCount++;
        validateInquiry.validateFindService(subscriptionFilter.getFindService());
      }
      if (subscriptionFilter.getFindTModel() != null) {
        filterCount++;
        validateInquiry.validateFindTModel(subscriptionFilter.getFindTModel(), false);
      }
      if (subscriptionFilter.getFindRelatedBusinesses() != null) {
        filterCount++;
        validateInquiry.validateFindRelatedBusinesses(subscriptionFilter.getFindRelatedBusinesses(), false);
      }
      if (subscriptionFilter.getGetBindingDetail() != null) {
        filterCount++;
        validateInquiry.validateGetBindingDetail(subscriptionFilter.getGetBindingDetail());
      }
      if (subscriptionFilter.getGetBusinessDetail() != null) {
        filterCount++;
        validateInquiry.validateGetBusinessDetail(subscriptionFilter.getGetBusinessDetail());
      }
      if (subscriptionFilter.getGetServiceDetail() != null) {
        filterCount++;
        validateInquiry.validateGetServiceDetail(subscriptionFilter.getGetServiceDetail());
      }
      if (subscriptionFilter.getGetTModelDetail() != null) {
        filterCount++;
        validateInquiry.validateGetTModelDetail(subscriptionFilter.getGetTModelDetail());
      }
      if (subscriptionFilter.getGetAssertionStatusReport() != null) {
        filterCount++;
      }

      if (filterCount == 0)
        throw new ValueNotAllowedException(new ErrorMessage("errors.subscription.BlankFilter"));
     
      if (filterCount > 1)
        throw new ValueNotAllowedException(new ErrorMessage("errors.subscription.TooManyFilters", String.valueOf(filterCount)));

    }
   
  }
View Full Code Here

    validateUDDIv3Key(key.substring(0, key.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR)));
  }
 
  public static void validateUDDIv3KeyGeneratorTModel(org.uddi.api_v3.TModel tModel) throws DispositionReportFaultMessage {
    if (tModel == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.tmodel.NullInput"));
   
    validateUDDIv3KeyGeneratorKey(tModel.getTModelKey());

    // A key generator key should have exactly one category and it's key value should be 'keyGenerator'
    org.uddi.api_v3.CategoryBag categories = tModel.getCategoryBag();
    if (categories != null) {
      List<org.uddi.api_v3.KeyedReference> elems = categories.getKeyedReference();
      if (elems != null && elems.size() == 1) {
        org.uddi.api_v3.KeyedReference elem = elems.get(0);
        if (elem != null) {
          if (elem != null && elem instanceof org.uddi.api_v3.KeyedReference) {
            String keyedValue = ((org.uddi.api_v3.KeyedReference)elem).getKeyValue();
            if (keyedValue != null) {
              if (keyedValue.equalsIgnoreCase(KeyGenerator.KEYGENERATOR_SUFFIX))
                return;
            }
          }
        }
      }
    }

    throw new ValueNotAllowedException(new ErrorMessage("errors.tmodel.keygenerator.BadCategory"));
  }
View Full Code Here

      throw new FatalErrorException(new ErrorMessage("errors.discardtransfertoken.NoInput"));
   
    if (keyBag != null) {
      List<String> keyList = keyBag.getKey();
      if (keyList == null || keyList.size() == 0)
        throw new ValueNotAllowedException(new ErrorMessage("errors.keybag.NoInput"));
     
      // Test that publisher owns keys using operational info.
      for (String key : keyList) {
        UddiEntity uddiEntity = em.find(UddiEntity.class, key);
       
View Full Code Here

    if (keyBag == null)
      throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
   
    List<String> keyList = keyBag.getKey();
    if (keyList == null || keyList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.keybag.NoInput"));
   
    // Test that publisher owns keys using operational info.
    Vector<DynamicQuery.Parameter> params = new Vector<DynamicQuery.Parameter>(0);
    for (String key : keyList) {
      UddiEntity uddiEntity = em.find(UddiEntity.class, key);
View Full Code Here

    if (keyBag == null)
      throw new FatalErrorException(new ErrorMessage("errors.keybag.NullInput"));
   
    List<String> apiKeyList = keyBag.getKey();
    if (apiKeyList == null || apiKeyList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.keybag.NoInput"));
   
    String transferTokenId = new String(apiTransferToken.getOpaqueToken());
    org.apache.juddi.model.TransferToken modelTransferToken = em.find(org.apache.juddi.model.TransferToken.class, transferTokenId);
    if (modelTransferToken == null)
      throw new TransferNotAllowedException(new ErrorMessage("errors.transferentities.TokenNotFound", transferTokenId));
View Full Code Here

      throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
   
    // No null or empty list
    List<org.uddi.api_v3.BusinessEntity> entityList = body.getBusinessEntity();
    if (entityList == null || entityList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.savebusiness.NoInput"));
   
    for (org.uddi.api_v3.BusinessEntity entity : entityList) {
      validateBusinessEntity(em, entity);
    }
  }
View Full Code Here

      throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
   
    // No null or empty list
    List<org.uddi.api_v3.BusinessService> entityList = body.getBusinessService();
    if (entityList == null || entityList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.saveservice.NoInput"));
   
    for (org.uddi.api_v3.BusinessService entity : entityList) {
      // Entity specific data validation
      validateBusinessService(em, entity, null);
    }
View Full Code Here

      throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
   
    // No null or empty list
    List<org.uddi.api_v3.BindingTemplate> entityList = body.getBindingTemplate();
    if (entityList == null || entityList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.savebinding.NoInput"));
   
    for (org.uddi.api_v3.BindingTemplate entity : entityList) {
      validateBindingTemplate(em, entity, null);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.juddi.error.ValueNotAllowedException

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.