Package org.apache.juddi.v3.error

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


    }
    else {
      ValidateUDDIKey.validateUDDIv3Key(result);
      String keyPartition = result.substring(0, result.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR));
      if (!rootPartition.equalsIgnoreCase(keyPartition))
        throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", userNodeId));
    }
    return result;
  }
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()))
        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ParentServiceNotFound", parentKey));
    }
   
    // Retrieve the service's passed key
    String entityKey = bindingTemplate.getBindingKey();
    if (entityKey == null || entityKey.length() == 0) {
      entityKey = rootPartition + KeyGenerator.PARTITION_SEPARATOR + UUID.randomUUID();
      bindingTemplate.setBindingKey(entityKey);
    }
    else {
      // Per section 4.4: keys must be case-folded
      entityKey = entityKey.toLowerCase();
      bindingTemplate.setBindingKey(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.validateCategoryBag(bindingTemplate.getCategoryBag(), config);
View Full Code Here

        else if (fq.equalsIgnoreCase(SUPPRESS_PROJECTED_SERVICES) || fq.equalsIgnoreCase(SUPPRESS_PROJECTED_SERVICES_TMODEL))
          this.setSuppressProjectedServices(true);
        else if (fq.equalsIgnoreCase(UTS_10) || fq.equalsIgnoreCase(UTS_10_TMODEL))
          this.setUts10(true);
        else
          throw new UnsupportedException(new ErrorMessage("errors.Unsupported.findQualifier", fq));
      }
    }
  }
View Full Code Here

    try {
      tx.begin();
      boolean seedAlways = config.getBoolean("juddi.seed.always", false);
      boolean alreadyInstalled = alreadyInstalled(config);
      if (!seedAlways && alreadyInstalled)
        new FatalErrorException(new ErrorMessage("errors.install.AlreadyInstalled"));
     
     
      String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER);
      String fileRootTModelKeygen = rootPublisherStr + FILE_TMODELKEYGEN;
      TModel rootTModelKeyGen = (TModel)buildInstallEntity(fileRootTModelKeygen, "org.uddi.api_v3", config);
View Full Code Here

 
  protected static String getRootPartition(TModel rootTModelKeyGen) throws JAXBException, IOException, DispositionReportFaultMessage {
    String result = rootTModelKeyGen.getTModelKey().substring(0, rootTModelKeyGen.getTModelKey().lastIndexOf(KeyGenerator.PARTITION_SEPARATOR));
   
    if (result == null || result.length() == 0)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", result));
   
    // Must validate the root partition.  The first component should be a domain key and the any following
    // tokens should be a valid KSS.
    result = result.trim();
    if (result.endsWith(KeyGenerator.PARTITION_SEPARATOR) || result.startsWith(KeyGenerator.PARTITION_SEPARATOR))
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", result));
   
    StringTokenizer tokenizer = new StringTokenizer(result.toLowerCase(), KeyGenerator.PARTITION_SEPARATOR);
    for(int count = 0; tokenizer.hasMoreTokens(); count++) {
      String nextToken = tokenizer.nextToken();

      if (count == 0) {
        if(!ValidateUDDIKey.isValidDomainKey(nextToken))
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", result));
      }
      else {
        if (!ValidateUDDIKey.isValidKSS(nextToken))
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", result));
      }
    }

    return result;
  }
View Full Code Here

    }
    else {
      ValidateUDDIKey.validateUDDIv3Key(result);
      String keyPartition = result.substring(0, result.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR));
      if (!rootPartition.equalsIgnoreCase(keyPartition))
        throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", userNodeId));
    }
    return result;
  }
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.ErrorMessage

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.