Package org.apache.juddi.v3.error

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


        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) {
            validatePublisher(em, entity);
        }
View Full Code Here


        if (entityKeyList == null || entityKeyList.size() == 0) {
            throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
        }

        if (!((Publisher) publisher).isAdmin()) {
            throw new UserMismatchException(new ErrorMessage("errors.AdminReqd"));
        }

        HashSet<String> dupCheck = new HashSet<String>();
        for (String entityKey : entityKeyList) {
            validateKeyLength(entityKey);
            boolean inserted = dupCheck.add(entityKey);
            if (!inserted) {
                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.DuplicateKey", entityKey));
            }

            Object obj = em.find(org.apache.juddi.model.Tmodel.class, entityKey);
            if (obj == null) {
                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.TModelNotFound", entityKey));
            }

            if (!publisher.isOwner((UddiEntity) obj)) {
                throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
            }

        }
    }
View Full Code Here

       
        // According to spec, it's ok if a key doesn't match any known entities, it will just be ignored.  However, the publisher must own
        // the entity in order to discard the associated token.
        if (uddiEntity != null) {
          if (!publisher.isOwner(uddiEntity))
            throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", key));
         
        }
     
        i++;
      }
View Full Code Here

      if (!(uddiEntity instanceof org.apache.juddi.model.BusinessEntity) &&
        !(uddiEntity instanceof org.apache.juddi.model.Tmodel))
        throw new InvalidKeyPassedException(new ErrorMessage("errors.gettransfertoken.InvalidEntity", key));
     
      if (!publisher.isOwner(uddiEntity))
        throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", key));
     
      // Creating parameters for key-checking query
      DynamicQuery.Parameter param = new DynamicQuery.Parameter("UPPER(ttk.entityKey)",
                                    key.toUpperCase(),
                                    DynamicQuery.PREDICATE_EQUALS);
View Full Code Here

       
        // According to spec, it's ok if a key doesn't match any known entities, it will just be ignored.  However, the publisher must own
        // the entity in order to discard the associated token.
        if (uddiEntity != null) {
          if (!publisher.isOwner(uddiEntity))
            throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", key));
         
        }
     
        i++;
      }
View Full Code Here

      if (!(uddiEntity instanceof org.apache.juddi.model.BusinessEntity) &&
        !(uddiEntity instanceof org.apache.juddi.model.Tmodel))
        throw new InvalidKeyPassedException(new ErrorMessage("errors.gettransfertoken.InvalidEntity", key));
     
      if (!publisher.isOwner(uddiEntity))
        throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", key));
     
      // Creating parameters for key-checking query
      DynamicQuery.Parameter param = new DynamicQuery.Parameter("UPPER(ttk.entityKey)",
                                    key.toUpperCase(),
                                    DynamicQuery.PREDICATE_EQUALS);
View Full Code Here

            if (obj != null) {
                entityExists = true;
                //revising a new item
                // Make sure publisher owns this entity.
                if (!publisher.getAuthorizedName().equals(((org.apache.juddi.model.Subscription) obj).getAuthorizedName())) {
                    throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
                }
            } else {
                //new item
                // Inside this block, we have a key proposed by the publisher on a new entity
View Full Code Here

                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.SubscriptionNotFound", entityKey));
            }

            // Make sure publisher owns this entity.
            if (!publisher.getAuthorizedName().equals(((org.apache.juddi.model.Subscription) obj).getAuthorizedName())) {
                throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
            }

            i++;
        }
    }
View Full Code Here

      Object obj = em.find(org.apache.juddi.model.BusinessEntity.class, entityKey);
      if (obj == null)
        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BusinessNotFound", entityKey));
     
      if (!publisher.isOwner((UddiEntity)obj))
        throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
     
      i++;
    }
  }
View Full Code Here

      Object obj = em.find(org.apache.juddi.model.BusinessService.class, entityKey);
      if (obj == null)
        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ServiceNotFound", entityKey));
     
      if (!publisher.isOwner((UddiEntity)obj))
        throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
     
      i++;
    }
  }
View Full Code Here

TOP

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

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.