Package org.apache.juddi.v3.error

Examples of org.apache.juddi.v3.error.ValueNotAllowedException


 
  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

      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

      String rootPartition, Configuration config)
  throws DispositionReportFaultMessage {

    // A supplied businessService can't be null
    if (businessEntity == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.businessentity.NullInput"));
   
    // The business key should already be set to the previously calculated and validated nodeId.  This validation is unnecessary but kept for
    // symmetry with the other entity validations.
    String entityKey = businessEntity.getBusinessKey();
    if (entityKey == null || entityKey.length() == 0) {
      entityKey = rootPartition + KeyGenerator.PARTITION_SEPARATOR + UUID.randomUUID();
      businessEntity.setBusinessKey(entityKey);
    }
    else {
      // Per section 4.4: keys must be case-folded
      entityKey = entityKey.toLowerCase();
      businessEntity.setBusinessKey(entityKey);
     
      ValidateUDDIKey.validateUDDIv3Key(entityKey);
      String keyPartition = entityKey.substring(0, entityKey.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR));
      if (!rootPartition.equalsIgnoreCase(keyPartition))
        throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
    }

    ValidatePublish validatePublish = new ValidatePublish(rootPublisher);
   
    validatePublish.validateNames(businessEntity.getName());
    validatePublish.validateDiscoveryUrls(businessEntity.getDiscoveryURLs());
    validatePublish.validateContacts(businessEntity.getContacts());
    validatePublish.validateCategoryBag(businessEntity.getCategoryBag(),config);
    validatePublish.validateIdentifierBag(businessEntity.getIdentifierBag(),config);

    org.uddi.api_v3.BusinessServices businessServices = businessEntity.getBusinessServices();
    if (businessServices != null) {
      List<org.uddi.api_v3.BusinessService> businessServiceList = businessServices.getBusinessService();
      if (businessServiceList == null || businessServiceList.size() == 0)
        throw new ValueNotAllowedException(new ErrorMessage("errors.businessservices.NoInput"));
     
      for (org.uddi.api_v3.BusinessService businessService : businessServiceList) {
        validateRootBusinessService(businessService, businessEntity, rootPublisher, rootPartition, config);
      }
    }
View Full Code Here

      UddiEntityPublisher rootPublisher, String rootPartition, Configuration config)
  throws DispositionReportFaultMessage {

    // A supplied businessService can't be null
    if (businessService == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.businessservice.NullInput"));
 
    // A business key doesn't have to be provided, but if it is, it should match the parent business's key
    String parentKey = businessService.getBusinessKey();
    if (parentKey != null && parentKey.length()> 0) {
      if (!parentKey.equalsIgnoreCase(parent.getBusinessKey()))
        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ParentBusinessNotFound", parentKey));
    }
   
    // Retrieve the service's passed key
    String entityKey = businessService.getServiceKey();
    if (entityKey == null || entityKey.length() == 0) {
      entityKey = rootPartition + KeyGenerator.PARTITION_SEPARATOR + UUID.randomUUID();
      businessService.setServiceKey(entityKey);
    }
    else {
      // Per section 4.4: keys must be case-folded
      entityKey = entityKey.toLowerCase();
      businessService.setServiceKey(entityKey);
     
      ValidateUDDIKey.validateUDDIv3Key(entityKey);
      String keyPartition = entityKey.substring(0, entityKey.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR));
      if (!rootPartition.equalsIgnoreCase(keyPartition))
        throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
    }
   
    ValidatePublish validatePublish = new ValidatePublish(rootPublisher);
   
    validatePublish.validateNames(businessService.getName());
    validatePublish.validateCategoryBag(businessService.getCategoryBag(), config);

    org.uddi.api_v3.BindingTemplates bindingTemplates = businessService.getBindingTemplates();
    if (bindingTemplates != null) {
      List<org.uddi.api_v3.BindingTemplate> bindingTemplateList = bindingTemplates.getBindingTemplate();
      if (bindingTemplateList == null || bindingTemplateList.size() == 0)
        throw new ValueNotAllowedException(new ErrorMessage("errors.bindingtemplates.NoInput"));
     
      for (org.uddi.api_v3.BindingTemplate bindingTemplate : bindingTemplateList) {
        validateRootBindingTemplate(bindingTemplate, businessService, rootPublisher, rootPartition, config);
      }
    }
View Full Code Here

      UddiEntityPublisher rootPublisher, String rootPartition, Configuration config)
  throws DispositionReportFaultMessage {

    // A supplied businessService can't be null
    if (bindingTemplate == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.bindingtemplate.NullInput"));
 
    // A service key doesn't have to be provided, but if it is, it should match the parent service's key
    String parentKey = bindingTemplate.getServiceKey();
    if (parentKey != null && parentKey.length()> 0) {
      if (!parentKey.equalsIgnoreCase(parent.getServiceKey()))
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, config);
    }
  }
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, config);
    }
View Full Code Here

TOP

Related Classes of org.apache.juddi.v3.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.