Package org.apache.juddi.v3.error

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


      List<String> publisherIdList = body.getPublisherId();
      for (String publisherId : publisherIdList) {
       
        org.apache.juddi.model.Publisher modelPublisher = em.find(org.apache.juddi.model.Publisher.class, publisherId);
        if (modelPublisher == null) {
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.PublisherNotFound", publisherId));
        }
       
        org.apache.juddi.api_v3.Publisher apiPublisher = new org.apache.juddi.api_v3.Publisher();
       
        MappingModelToApi.mapPublisher(modelPublisher, apiPublisher);
View Full Code Here


      for (String subscriptionKey : subscriptionKeyList) {
       
        org.apache.juddi.model.ClientSubscriptionInfo modelClientSubscriptionInfo =
          em.find(org.apache.juddi.model.ClientSubscriptionInfo.class, subscriptionKey);
        if (modelClientSubscriptionInfo == null) {
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.SubscripKeyNotFound", subscriptionKey));
        }
       
        org.apache.juddi.api_v3.ClientSubscriptionInfo apiClientSubscriptionInfo = new org.apache.juddi.api_v3.ClientSubscriptionInfo();
       
        MappingModelToApi.mapClientSubscriptionInfo(modelClientSubscriptionInfo, apiClientSubscriptionInfo);
View Full Code Here

      for (GetSubscriptionResults getSubscriptionResult : body.getGetSubscriptionResultsList()) {
        String subscriptionKey = getSubscriptionResult.getSubscriptionKey();
        org.apache.juddi.model.ClientSubscriptionInfo modelClientSubscriptionInfo =
          em.find(org.apache.juddi.model.ClientSubscriptionInfo.class, subscriptionKey);
        if (modelClientSubscriptionInfo == null) {
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.SubscripKeyNotFound", subscriptionKey));
        }
        org.apache.juddi.api_v3.ClientSubscriptionInfo apiClientSubscriptionInfo = new org.apache.juddi.api_v3.ClientSubscriptionInfo();
        MappingModelToApi.mapClientSubscriptionInfo(modelClientSubscriptionInfo, apiClientSubscriptionInfo);
        clientSubscriptionInfoMap.put(apiClientSubscriptionInfo.getSubscriptionKey(),apiClientSubscriptionInfo);
      }
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

 
    // 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) {
View Full Code Here

 
    // 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) {
View Full Code Here

*/
public class ValidateUDDIKey {

  public static void validateUDDIv3Key(String key) throws DispositionReportFaultMessage {
    if (key == null)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NullKey"));
   
    String keyToTest = key.trim();
    if (keyToTest.endsWith(KeyGenerator.PARTITION_SEPARATOR))
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));

    StringTokenizer tokenizer = new StringTokenizer(key.toLowerCase(), KeyGenerator.PARTITION_SEPARATOR);
    int tokensCount = tokenizer.countTokens();
    if(tokensCount <= 1)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
    for(int count = 0; tokenizer.hasMoreTokens(); count++) {
      String nextToken = tokenizer.nextToken();

      if (count == 0) {
        if (!ValidateUDDIKey.isValidUDDIScheme(nextToken))
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
      }
      else if (count == 1) {
        if(!ValidateUDDIKey.isValidDomainKey(nextToken))
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
      }
      else {
        if (!isValidKSS(nextToken))
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
      }
    }
  }
View Full Code Here

    }
  }
 
  public static void validateUDDIv3KeyGeneratorKey(String key) throws DispositionReportFaultMessage {
    if (key == null)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NullKeys"));
   
    if ( !(key.toUpperCase().endsWith(KeyGenerator.KEYGENERATOR_SUFFIX.toUpperCase())) )
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.KeyGenSuffix", key));
   
    validateUDDIv3Key(key.substring(0, key.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR)));
  }
View Full Code Here

    if (relatedBusinessInfos == null)
      relatedBusinessInfos = new org.uddi.api_v3.RelatedBusinessInfos();
   
    org.apache.juddi.model.BusinessEntity focalBusiness = em.find(org.apache.juddi.model.BusinessEntity.class, focalKey);
    if (focalBusiness == null)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BusinessNotFound", focalKey));

    List<org.apache.juddi.model.PublisherAssertion> pubAssertList = null;
    if (direction == Direction.FROM_KEY)
      pubAssertList = focalBusiness.getPublisherAssertionsForFromKey();
    else
View Full Code Here

      List<String> bindingKeyList = body.getBindingKey();
      for (String bindingKey : bindingKeyList) {
       
        org.apache.juddi.model.BindingTemplate modelBindingTemplate = em.find(org.apache.juddi.model.BindingTemplate.class, bindingKey);
        if (modelBindingTemplate == null)
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BindingTemplateNotFound", bindingKey));
       
        org.uddi.api_v3.BindingTemplate apiBindingTemplate = new org.uddi.api_v3.BindingTemplate();
       
        MappingModelToApi.mapBindingTemplate(modelBindingTemplate, apiBindingTemplate);
       
View Full Code Here

TOP

Related Classes of org.apache.juddi.v3.error.InvalidKeyPassedException

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.