Package org.apache.juddi.error

Examples of org.apache.juddi.error.KeyUnavailableException


        // Inside this block, we have a key proposed by the publisher on a new entity

        // Validate key and then check to see that the proposed key is valid for this publisher
        ValidateUDDIKey.validateUDDIv3Key(entityKey);
        if (!publisher.isValidPublisherKey(em, entityKey))
          throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));

      }
     
    }

    if (!entityExists) {
      // Check to make sure key isn't used by another entity.
      if (!isUniqueKey(em, entityKey))
        throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
    }
   
   
    validateSubscriptionFilter(subscription.getSubscriptionFilter(), entityExists);
  }
View Full Code Here


        // Inside this block, we have a key proposed by the publisher on a new entity

        // Validate key and then check to see that the proposed key is valid for this publisher
        ValidateUDDIKey.validateUDDIv3Key(entityKey);
        if (!publisher.isValidPublisherKey(em, entityKey))
          throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));

      }
    }

    if (!entityExists) {
      // Check to make sure key isn't used by another entity.
      if (!isUniqueKey(em, entityKey))
        throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
    }
   
    // TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
   
    validateNames(businessEntity.getName());
View Full Code Here

          // Inside this block, we have a key proposed by the publisher on a new entity

          // Validate key and then check to see that the proposed key is valid for this publisher
          ValidateUDDIKey.validateUDDIv3Key(entityKey);
          if (!publisher.isValidPublisherKey(em, entityKey))
            throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));

        }
       
      }
     
      // Parent key must be passed if this is a new entity
      if (!entityExists) {
        if (parentKey == null || parentKey.length() == 0)
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ParentBusinessNotFound", parentKey));
      }

      // If parent key IS passed, whether new entity or not, it must be valid.  Additionally, the current publisher must be the owner of the parent.  Note that
      // if a parent ENTITY was passed in, then we don't need to check for any of this since this is part of a higher call.
      if (parentKey != null) {
        if (parent == null) {
          Object parentTemp = em.find(org.apache.juddi.model.BusinessEntity.class, parentKey);
          if (parentTemp == null)
            throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ParentBusinessNotFound", parentKey));

          // Make sure publisher owns this parent entity.
          if (!publisher.isOwner((UddiEntity)parentTemp))
            throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwnerParent", parentKey));
        }
      }

      if (!entityExists) {
        // Check to make sure key isn't used by another entity.
        if (!isUniqueKey(em, entityKey))
          throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
      }
     
      // TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
     
      validateNames(businessService.getName());
View Full Code Here

        // Inside this block, we have a key proposed by the publisher on a new entity

        // Validate key and then check to see that the proposed key is valid for this publisher
        ValidateUDDIKey.validateUDDIv3Key(entityKey);
        if (!publisher.isValidPublisherKey(em, entityKey))
          throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));

      }
     
    }
   
    // Parent key must be passed if this is a new entity
    if (!entityExists) {
      if (parentKey == null || parentKey.length() == 0)
        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ParentServiceNotFound", parentKey));
    }

    // If parent key IS passed, whether new entity or not, it must be valid.  Additionally, the current publisher must be the owner of the parent.  Note that
    // if a parent ENTITY was passed in, then we don't need to check for any of this since this is part of a higher call.
    if (parentKey != null) {
      if (parent == null) {
        Object parentTemp = em.find(org.apache.juddi.model.BusinessService.class, parentKey);
        if (parentTemp == null)
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ParentBusinessNotFound", parentKey));

        // Make sure publisher owns this parent entity.
        if (!publisher.isOwner((UddiEntity)parentTemp))
          throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwnerParent", parentKey));

      }
    }

    if (!entityExists) {
      // Check to make sure key isn't used by another entity.
      if (!isUniqueKey(em, entityKey))
        throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
    }
   
    // TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
   
   
View Full Code Here

          if (publisher.getAuthorizedName().equals(Constants.ROOT_PUBLISHER))
            throw new FatalErrorException(new ErrorMessage("errors.tmodel.keygenerator.RootKeyGen"));
         
          // It's a valid Key Generator, but is it available for this publisher?
          if (!publisher.isKeyGeneratorAvailable(em, entityKey))
            throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
       
        }
        else {
          // If not a key generator, then simply validate key and then check to see that the proposed key is valid for this publisher
          ValidateUDDIKey.validateUDDIv3Key(entityKey);
          if (!publisher.isValidPublisherKey(em, entityKey))
            throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
        }
      }
    }

    if (!entityExists) {
      // Check to make sure key isn't used by another entity.
      if (!isUniqueKey(em, entityKey))
        throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
    }
   
    // TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
   
    if (tModel.getName() == null)
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

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

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

    }
    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.validateCategoryBag(bindingTemplate.getCategoryBag());
View Full Code Here

TOP

Related Classes of org.apache.juddi.error.KeyUnavailableException

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.