Package org.apache.juddi.v3.error

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


            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


            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

            if (obj == null) {
                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BindingTemplateNotFound", entityKey));
            }

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

            i++;
        }
    }
View Full Code Here

            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));
            }

            i++;
        }
    }
View Full Code Here

            if (obj != null) {
                entityExists = true;

                // Make sure publisher owns this entity.
                if (!publisher.isOwner((UddiEntity) obj)) {
                    throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
                }
            } else {
                // 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
View Full Code Here

                        businessService.setBusinessKey(parentKey);
                    }

                    // Make sure publisher owns this entity.
                    if (!publisher.isOwner((UddiEntity) obj)) {
                        throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
                    }

                    // If existing service trying to be saved has a different parent key, then we have a problem
                    if (!parentKey.equalsIgnoreCase(bs.getBusinessEntity().getEntityKey())) {
                        // if both businesses are owned by this publisher then we allow it.
                        // we already check the current business is owned, lets see if the old one is too
                        if (!publisher.isOwner(bs.getBusinessEntity())) {
                            throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.businessservice.ParentMismatch", parentKey + ", " + bs.getBusinessEntity().getEntityKey()));
                        } else {
                            if (log.isDebugEnabled()) {
                                log.debug("Services moved from business " + bs.getBusinessEntity() + " to " + businessService.getBusinessKey());
                            }
                        }
                    }

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

                    throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.bindingtemplate.ParentMismatch", parentKey + ", " + bt.getBusinessService().getEntityKey()));
                }

                // Make sure publisher owns this entity.
                if (!publisher.isOwner((UddiEntity) obj)) {
                    throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
                }

            } else {
                // 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));
                }

            }
        }
View Full Code Here

            if (obj != null) {
                entityExists = true;

                // Make sure publisher owns this entity.
                if (!publisher.isOwner((UddiEntity) obj)) {
                    throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
                }
            } else {
                // Inside this block, we have a key proposed by the publisher on a new entity

                // First test to see if this is a Key Generator tModel. The keyGenerator suffix appearing in the key is the indicator, since this is not
View Full Code Here

        if (toObj == null) {
            throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BusinessNotFound", toKey));
        }

        if (!publisher.isOwner((UddiEntity) fromObj) && !publisher.isOwner((UddiEntity) toObj)) {
            throw new UserMismatchException(new ErrorMessage("errors.pubassertion.UserMismatch", fromKey + " & " + toKey));
        }

        try {
            validateKeyedReference(pubAssertion.getKeyedReference(), AppConfig.getConfiguration());
        } catch (ConfigurationException ce) {
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.deletepublisher.AdminReqd"));
        }

        HashSet<String> dupCheck = new HashSet<String>();
        for (String entityKey : entityKeyList) {
            validateKeyLength(entityKey);
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.