Package org.apache.juddi.error

Examples of org.apache.juddi.error.ValueNotAllowedException


  }
 
  public void validateOverviewDoc(org.uddi.api_v3.OverviewDoc overviewDoc) throws DispositionReportFaultMessage {
    // OverviewDoc can't be null
    if (overviewDoc == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.overviewdoc.NullInput"));
   
    // At least one description or overview URL must be supplied
    List<org.uddi.api_v3.Description> elems = overviewDoc.getDescription();
    if ((elems == null || elems.size() == 0 ) && overviewDoc.getOverviewURL() == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.overviewdoc.NoDescOrUrl"));
  }
View Full Code Here


    if (body == null)
      throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
   
    // infoSelection is required
    if (body.getInfoSelection() == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.getregisteredinfo.NoInfoSelection"));
     
  }
View Full Code Here

      throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
   
    // No null or empty list
    List<org.apache.juddi.api_v3.Publisher> entityList = body.getPublisher();
    if (entityList == null || entityList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.savepublisher.NoInput"));
   
    if (!((Publisher)publisher).isAdmin())
      throw new UserMismatchException(new ErrorMessage("errors.savepublisher.AdminReqd"));
   
    for (org.apache.juddi.api_v3.Publisher entity : entityList) {
View Full Code Here

  public void validatePublisher(EntityManager em, org.apache.juddi.api_v3.Publisher publisher) throws DispositionReportFaultMessage {

    // No null input
    if (publisher == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.publisher.NullInput"));
   
    String authorizedName = publisher.getAuthorizedName();
    if (authorizedName == null || authorizedName.length() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.publisher.NoAuthorizedName"));
 
    String publisherName = publisher.getPublisherName();
    if (publisherName == null || publisherName.length() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.publisher.NoPublisherName"));

  }
View Full Code Here

  private static void validateRootBusinessEntity(org.uddi.api_v3.BusinessEntity businessEntity, UddiEntityPublisher rootPublisher, String rootPartition)
  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 {
      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());
    validatePublish.validateIdentifierBag(businessEntity.getIdentifierBag());

    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);
      }
    }
View Full Code Here

  private static void validateRootBusinessService(org.uddi.api_v3.BusinessService businessService, org.uddi.api_v3.BusinessEntity parent, UddiEntityPublisher rootPublisher, String rootPartition)
  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 {
      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());

    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);
      }
    }
View Full Code Here

  private static void validateRootBindingTemplate(org.uddi.api_v3.BindingTemplate bindingTemplate, org.uddi.api_v3.BusinessService parent, UddiEntityPublisher rootPublisher, String rootPartition)
  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

    KeyedReference keyedRef = body.getKeyedReference();
    if (keyedRef != null) {
      if (keyedRef.getTModelKey() == null || keyedRef.getTModelKey().length() == 0 ||
        keyedRef.getKeyName() == null || keyedRef.getKeyName().length() == 0 ||
        keyedRef.getKeyValue() == null || keyedRef.getKeyValue().length() == 0)
        throw new ValueNotAllowedException(new ErrorMessage("errors.findrelatedbusiness.BlankKeyedRef"));
    }
     
  }
View Full Code Here

  public void validateNames(List<org.uddi.api_v3.Name> names) throws DispositionReportFaultMessage {
    if (names != null) {
      for (Name n : names) {
        if (n.getValue() == null || n.getValue().length() == 0)
          throw new ValueNotAllowedException(new ErrorMessage("errors.names.NoValue"));
      }
    }
  }
View Full Code Here

    // tmodelBag is optional
    if (tmodelBag == null)
      return;
   
    if (tmodelBag.getTModelKey() == null || tmodelBag.getTModelKey().size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.tmodelbag.NoInput"));
   
  }
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.