Package org.apache.juddi.v3.error

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


 
  public void validateKeyedReference(KeyedReference kr, Configuration config) throws DispositionReportFaultMessage {
    String tmodelKey = kr.getTModelKey();

    if (tmodelKey == null || tmodelKey.length() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NoTModelKey"));
   
    // Per section 4.4: keys must be case-folded
    tmodelKey = tmodelKey.toLowerCase();
    kr.setTModelKey(tmodelKey);
     
    if (kr.getKeyValue() == null || kr.getKeyValue().length() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NoKeyValue"));
     
    String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER);
    // Per section 6.2.2.1 of the specification, no publishers (except the root) are allowed to use the node categorization tmodelKey
    if (Constants.NODE_CATEGORY_TMODEL.equalsIgnoreCase(kr.getTModelKey())) {
      if (!rootPublisherStr.equals(publisher.getAuthorizedName()))
        throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NodeCategoryTModel", Constants.NODE_CATEGORY_TMODEL));
    }
  }
View Full Code Here


      return;
   
    // If tmodelInstDetails does exist, it must have at least one element
    List<org.uddi.api_v3.TModelInstanceInfo> tmodelInstInfoList = tmodelInstDetails.getTModelInstanceInfo();
    if (tmodelInstInfoList == null || tmodelInstInfoList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.tmodelinstdetails.NoInput"));
   
    for (org.uddi.api_v3.TModelInstanceInfo tmodelInstInfo : tmodelInstInfoList) {
      validateTModelInstanceInfo(tmodelInstInfo);
    }
  }
View Full Code Here

  }

  public void validateTModelInstanceInfo(org.uddi.api_v3.TModelInstanceInfo tmodelInstInfo) throws DispositionReportFaultMessage {
    // tModel Instance Info can't be null
    if (tmodelInstInfo == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.tmodelinstinfo.NullInput"));
   
    // TModel key is required
    if (tmodelInstInfo.getTModelKey() == null || tmodelInstInfo.getTModelKey().length() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.tmodelinstinfo.NoTModelKey"));
   
    // Per section 4.4: keys must be case-folded
    tmodelInstInfo.setTModelKey((tmodelInstInfo.getTModelKey().toLowerCase()));
   
    validateInstanceDetails(tmodelInstInfo.getInstanceDetails());
View Full Code Here

      return;
   
    // At least one OverviewDoc or instanceParms must be supplied
    List<OverviewDoc> elems = instDetails.getOverviewDoc();
    if (instDetails.getInstanceParms() == null && elems.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.instdetails.NoOverviewOrParms"));
   
  }
View Full Code Here

  }
 
  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

      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

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.