You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by al...@apache.org on 2013/12/07 00:39:12 UTC

svn commit: r1548758 [2/3] - in /juddi/branches/juddi-3.3.x: juddi-client.net/example/AspnetServiceLifeCycle/ juddi-client.net/example/WcfServiceLifeCycle/ juddi-client.net/juddi-client.net-integration.test/resource/ juddi-client.net/juddi-client.net-s...

Modified: juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java
URL: http://svn.apache.org/viewvc/juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java?rev=1548758&r1=1548757&r2=1548758&view=diff
==============================================================================
--- juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java (original)
+++ juddi/branches/juddi-3.3.x/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java Fri Dec  6 23:39:10 2013
@@ -18,6 +18,8 @@ package org.apache.juddi.validation;
 
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 
@@ -39,12 +41,16 @@ import org.apache.juddi.config.Persisten
 import org.apache.juddi.config.Property;
 import org.apache.juddi.keygen.KeyGenerator;
 import org.apache.juddi.keygen.KeyGeneratorFactory;
+import org.apache.juddi.mapping.MappingModelToApi;
+import org.apache.juddi.model.BindingTemplate;
 import org.apache.juddi.model.Publisher;
 import org.apache.juddi.model.Tmodel;
+import org.apache.juddi.model.TmodelIdentifier;
 import org.apache.juddi.model.UddiEntity;
 import org.apache.juddi.model.UddiEntityPublisher;
 import org.apache.juddi.query.FindBusinessByPublisherQuery;
 import org.apache.juddi.query.FindTModelByPublisherQuery;
+import org.apache.juddi.v3.client.UDDIConstants;
 import org.apache.juddi.v3.error.AssertionNotFoundException;
 import org.apache.juddi.v3.error.ErrorMessage;
 import org.apache.juddi.v3.error.FatalErrorException;
@@ -76,14 +82,16 @@ import org.uddi.api_v3.SaveBinding;
 import org.uddi.api_v3.SaveBusiness;
 import org.uddi.api_v3.SaveService;
 import org.uddi.api_v3.SaveTModel;
+import org.uddi.api_v3.TModel;
 import org.uddi.v3_service.DispositionReportFaultMessage;
 
 /**
  * Provides validation of publish requests to Juddi
  *
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
- * @author <a href="mailto:tcunning@apache.org">Tom Cunningham</a> 
- * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a> Modified March 2013 to validate string length and ref integrity
+ * @author <a href="mailto:tcunning@apache.org">Tom Cunningham</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a> Modified March
+ * 2013 to validate string length and ref integrity
  *
  * Advisory, be careful calling AppConfig.getConfiguration() from within
  * validation functions, it may inadvertently cause infinite loops during the
@@ -92,1775 +100,1860 @@ import org.uddi.v3_service.DispositionRe
  */
 public class ValidatePublish extends ValidateUDDIApi {
 
-    /**
-     * This flag will add additional output to stdout for debugging purposes,
-     * set this to true if
-     */
-    private Log log = LogFactory.getLog(this.getClass());
+        /**
+         * This flag will add additional output to stdout for debugging
+         * purposes, set this to true if
+         */
+        private static Log log = LogFactory.getLog(ValidatePublish.class);
 
-    public ValidatePublish(UddiEntityPublisher publisher) {
-        super(publisher);
-    }
+        public ValidatePublish(UddiEntityPublisher publisher) {
+                super(publisher);
+        }
 
-    public void validateDeleteBusiness(EntityManager em, DeleteBusiness body) throws DispositionReportFaultMessage {
+        public void validateDeleteBusiness(EntityManager em, DeleteBusiness body) throws DispositionReportFaultMessage {
 
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
-        }
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                }
 
-        // No null or empty list
-        List<String> entityKeyList = body.getBusinessKey();
-        if (entityKeyList == null || entityKeyList.size() == 0) {
-            throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
-        }
+                // No null or empty list
+                List<String> entityKeyList = body.getBusinessKey();
+                if (entityKeyList == null || entityKeyList.size() == 0) {
+                        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
+                }
 
-        HashSet<String> dupCheck = new HashSet<String>();
-        int i = 0;
-        for (String entityKey : entityKeyList) {
+                HashSet<String> dupCheck = new HashSet<String>();
+                int i = 0;
+                for (String entityKey : entityKeyList) {
 
-            // Per section 4.4: keys must be case-folded
-            entityKey = entityKey.toLowerCase();
-            entityKeyList.set(i, entityKey);
+                        // Per section 4.4: keys must be case-folded
+                        entityKey = entityKey.toLowerCase();
+                        entityKeyList.set(i, entityKey);
 
-            boolean inserted = dupCheck.add(entityKey);
-            if (!inserted) {
-                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.DuplicateKey", 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.BusinessEntity.class, entityKey);
-            if (obj == null) {
-                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BusinessNotFound", entityKey));
-            }
+                        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));
-            }
+                        if (!publisher.isOwner((UddiEntity) obj)) {
+                                throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
+                        }
 
-            i++;
+                        i++;
+                }
         }
-    }
 
-    public void validateDeleteService(EntityManager em, DeleteService body) throws DispositionReportFaultMessage {
+        public void validateDeleteService(EntityManager em, DeleteService body) throws DispositionReportFaultMessage {
 
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
-        }
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                }
 
-        // No null or empty list
-        List<String> entityKeyList = body.getServiceKey();
-        if (entityKeyList == null || entityKeyList.size() == 0) {
-            throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
-        }
+                // No null or empty list
+                List<String> entityKeyList = body.getServiceKey();
+                if (entityKeyList == null || entityKeyList.size() == 0) {
+                        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
+                }
 
-        HashSet<String> dupCheck = new HashSet<String>();
-        int i = 0;
-        for (String entityKey : entityKeyList) {
+                HashSet<String> dupCheck = new HashSet<String>();
+                int i = 0;
+                for (String entityKey : entityKeyList) {
 
-            // Per section 4.4: keys must be case-folded
-            entityKey = entityKey.toLowerCase();
-            entityKeyList.set(i, entityKey);
+                        // Per section 4.4: keys must be case-folded
+                        entityKey = entityKey.toLowerCase();
+                        entityKeyList.set(i, entityKey);
 
-            boolean inserted = dupCheck.add(entityKey);
-            if (!inserted) {
-                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.DuplicateKey", 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.BusinessService.class, entityKey);
-            if (obj == null) {
-                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ServiceNotFound", entityKey));
-            }
+                        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));
-            }
+                        if (!publisher.isOwner((UddiEntity) obj)) {
+                                throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
+                        }
 
-            i++;
+                        i++;
+                }
         }
-    }
 
-    public void validateDeleteBinding(EntityManager em, DeleteBinding body) throws DispositionReportFaultMessage {
+        public void validateDeleteBinding(EntityManager em, DeleteBinding body) throws DispositionReportFaultMessage {
 
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
-        }
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                }
 
-        // No null or empty list
-        List<String> entityKeyList = body.getBindingKey();
-        if (entityKeyList == null || entityKeyList.size() == 0) {
-            throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
-        }
+                // No null or empty list
+                List<String> entityKeyList = body.getBindingKey();
+                if (entityKeyList == null || entityKeyList.size() == 0) {
+                        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
+                }
 
-        // Checking for duplicates and existence
-        HashSet<String> dupCheck = new HashSet<String>();
-        int i = 0;
-        for (String entityKey : entityKeyList) {
-            validateKeyLength(entityKey);
-            // Per section 4.4: keys must be case-folded
-            entityKey = entityKey.toLowerCase();
-            entityKeyList.set(i, entityKey);
+                // Checking for duplicates and existence
+                HashSet<String> dupCheck = new HashSet<String>();
+                int i = 0;
+                for (String entityKey : entityKeyList) {
+                        validateKeyLength(entityKey);
+                        // Per section 4.4: keys must be case-folded
+                        entityKey = entityKey.toLowerCase();
+                        entityKeyList.set(i, entityKey);
 
-            boolean inserted = dupCheck.add(entityKey);
-            if (!inserted) {
-                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.DuplicateKey", 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.BindingTemplate.class, entityKey);
-            if (obj == null) {
-                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BindingTemplateNotFound", entityKey));
-            }
+                        Object obj = em.find(org.apache.juddi.model.BindingTemplate.class, entityKey);
+                        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));
-            }
+                        if (!publisher.isOwner((UddiEntity) obj)) {
+                                throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
+                        }
 
-            i++;
+                        i++;
+                }
         }
-    }
 
-    public void validateDeleteTModel(EntityManager em, DeleteTModel body) throws DispositionReportFaultMessage {
+        public void validateDeleteTModel(EntityManager em, DeleteTModel body) throws DispositionReportFaultMessage {
 
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
-        }
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                }
 
-        // No null or empty list
-        List<String> entityKeyList = body.getTModelKey();
-        if (entityKeyList == null || entityKeyList.size() == 0) {
-            throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
-        }
+                // No null or empty list
+                List<String> entityKeyList = body.getTModelKey();
+                if (entityKeyList == null || entityKeyList.size() == 0) {
+                        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
+                }
 
-        HashSet<String> dupCheck = new HashSet<String>();
-        int i = 0;
-        for (String entityKey : entityKeyList) {
-            validateKeyLength(entityKey);
-            // Per section 4.4: keys must be case-folded
-            entityKey = entityKey.toLowerCase();
-            entityKeyList.set(i, entityKey);
+                HashSet<String> dupCheck = new HashSet<String>();
+                int i = 0;
+                for (String entityKey : entityKeyList) {
+                        validateKeyLength(entityKey);
+                        // Per section 4.4: keys must be case-folded
+                        entityKey = entityKey.toLowerCase();
+                        entityKeyList.set(i, entityKey);
 
-            boolean inserted = dupCheck.add(entityKey);
-            if (!inserted) {
-                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.DuplicateKey", 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));
-            }
+                        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));
-            }
+                        if (!publisher.isOwner((UddiEntity) obj)) {
+                                throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
+                        }
 
-            i++;
+                        i++;
+                }
         }
-    }
 
-    public void validateDeletePublisherAssertions(EntityManager em, DeletePublisherAssertions body) throws DispositionReportFaultMessage {
+        public void validateDeletePublisherAssertions(EntityManager em, DeletePublisherAssertions body) throws DispositionReportFaultMessage {
 
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
-        }
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                }
 
-        // No null or empty list
-        List<org.uddi.api_v3.PublisherAssertion> entityList = body.getPublisherAssertion();
-        if (entityList == null || entityList.size() == 0) {
-            throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.NoPubAssertions"));
-        }
+                // No null or empty list
+                List<org.uddi.api_v3.PublisherAssertion> entityList = body.getPublisherAssertion();
+                if (entityList == null || entityList.size() == 0) {
+                        throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.NoPubAssertions"));
+                }
+
+                for (org.uddi.api_v3.PublisherAssertion entity : entityList) {
+                        validateKeyLength(entity.getFromKey());
+                        validateKeyLength(entity.getToKey());
+                        validatePublisherAssertion(em, entity);
+
+                        org.apache.juddi.model.PublisherAssertionId pubAssertionId = new org.apache.juddi.model.PublisherAssertionId(entity.getFromKey(), entity.getToKey());
+                        Object obj = em.find(org.apache.juddi.model.PublisherAssertion.class, pubAssertionId);
+                        if (obj == null) {
+                                throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.AssertionNotFound", entity.getFromKey() + ", " + entity.getToKey()));
+                        } else {
+                                org.apache.juddi.model.PublisherAssertion pubAssertion = (org.apache.juddi.model.PublisherAssertion) obj;
+                                org.uddi.api_v3.KeyedReference keyedRef = entity.getKeyedReference();
+                                if (keyedRef == null) {
+                                        throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.AssertionNotFound", entity.getFromKey() + ", " + entity.getToKey()));
+                                }
+
+                                if (!pubAssertion.getTmodelKey().equalsIgnoreCase(keyedRef.getTModelKey())
+                                        || !pubAssertion.getKeyName().equalsIgnoreCase(keyedRef.getKeyName())
+                                        || !pubAssertion.getKeyValue().equalsIgnoreCase(keyedRef.getKeyValue())) {
+                                        throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.AssertionNotFound", entity.getFromKey() + ", " + entity.getToKey()));
+                                }
 
-        for (org.uddi.api_v3.PublisherAssertion entity : entityList) {
-            validateKeyLength(entity.getFromKey());
-            validateKeyLength(entity.getToKey());
-            validatePublisherAssertion(em, entity);
+                        }
 
-            org.apache.juddi.model.PublisherAssertionId pubAssertionId = new org.apache.juddi.model.PublisherAssertionId(entity.getFromKey(), entity.getToKey());
-            Object obj = em.find(org.apache.juddi.model.PublisherAssertion.class, pubAssertionId);
-            if (obj == null) {
-                throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.AssertionNotFound", entity.getFromKey() + ", " + entity.getToKey()));
-            } else {
-                org.apache.juddi.model.PublisherAssertion pubAssertion = (org.apache.juddi.model.PublisherAssertion) obj;
-                org.uddi.api_v3.KeyedReference keyedRef = entity.getKeyedReference();
-                if (keyedRef == null) {
-                    throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.AssertionNotFound", entity.getFromKey() + ", " + entity.getToKey()));
                 }
+        }
 
-                if (!pubAssertion.getTmodelKey().equalsIgnoreCase(keyedRef.getTModelKey())
-                        || !pubAssertion.getKeyName().equalsIgnoreCase(keyedRef.getKeyName())
-                        || !pubAssertion.getKeyValue().equalsIgnoreCase(keyedRef.getKeyValue())) {
-                    throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.AssertionNotFound", entity.getFromKey() + ", " + entity.getToKey()));
+        public void validateSaveBusiness(EntityManager em, SaveBusiness body, Configuration config) throws DispositionReportFaultMessage {
+
+                if (config == null) {
+                        try {
+                                config = AppConfig.getConfiguration();
+                        } catch (ConfigurationException ce) {
+                                log.error("Could not optain config. " + ce.getMessage(), ce);
+                        }
+                }
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
                 }
 
-            }
+                // No null or empty list
+                List<org.uddi.api_v3.BusinessEntity> entityList = body.getBusinessEntity();
+                if (entityList == null || entityList.size() == 0) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.savebusiness.NoInput"));
+                }
 
+                for (org.uddi.api_v3.BusinessEntity entity : entityList) {
+                        validateBusinessEntity(em, entity, config);
+                }
         }
-    }
 
-    public void validateSaveBusiness(EntityManager em, SaveBusiness body, Configuration config) throws DispositionReportFaultMessage {
+        public void validateSaveBusinessMax(EntityManager em) throws DispositionReportFaultMessage {
 
-        if (config == null) {
-            try {
-                config = AppConfig.getConfiguration();
-            } catch (ConfigurationException ce) {
-                log.error("Could not optain config. " + ce.getMessage(), ce);
-            }
-        }
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
-        }
+                //Obtain the maxSettings for this publisher or get the defaults
+                Publisher publisher = em.find(Publisher.class, getPublisher().getAuthorizedName());
+                Integer maxBusinesses = publisher.getMaxBusinesses();
+                try {
+                        if (maxBusinesses == null) {
+                                if (AppConfig.getConfiguration().containsKey(Property.JUDDI_MAX_BUSINESSES_PER_PUBLISHER)) {
+                                        maxBusinesses = AppConfig.getConfiguration().getInteger(Property.JUDDI_MAX_BUSINESSES_PER_PUBLISHER, -1);
+                                } else {
+                                        maxBusinesses = -1;
+                                }
+                        }
+                } catch (ConfigurationException e) {
+                        log.error(e.getMessage(), e);
+                        maxBusinesses = -1; //in case the configuration is not available
+                }
+                //if we have the maxBusinesses set for this publisher then we need to make sure we did not exceed it.
+                if (maxBusinesses > 0) {
+                        //get the businesses owned by this publisher
+                        List<?> businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, null);
+                        if (businessKeysFound != null && businessKeysFound.size() > maxBusinesses) {
+                                throw new MaxEntitiesExceededException(new ErrorMessage("errors.save.maxBusinessesExceeded"));
+                        }
+                }
 
-        // No null or empty list
-        List<org.uddi.api_v3.BusinessEntity> entityList = body.getBusinessEntity();
-        if (entityList == null || entityList.size() == 0) {
-            throw new ValueNotAllowedException(new ErrorMessage("errors.savebusiness.NoInput"));
         }
 
-        for (org.uddi.api_v3.BusinessEntity entity : entityList) {
-            validateBusinessEntity(em, entity, config);
-        }
-    }
+        public void validateSaveService(EntityManager em, SaveService body, Configuration config) throws DispositionReportFaultMessage {
+
+                if (config == null) {
+                        try {
+                                config = AppConfig.getConfiguration();
+                        } catch (ConfigurationException ce) {
+                                log.error("Could not optain config. " + ce.getMessage(), ce);
+                        }
+                }
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                }
 
-    public void validateSaveBusinessMax(EntityManager em) throws DispositionReportFaultMessage {
+                // No null or empty list
+                List<org.uddi.api_v3.BusinessService> entityList = body.getBusinessService();
+                if (entityList == null || entityList.size() == 0) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.saveservice.NoInput"));
+                }
 
-        //Obtain the maxSettings for this publisher or get the defaults
-        Publisher publisher = em.find(Publisher.class, getPublisher().getAuthorizedName());
-        Integer maxBusinesses = publisher.getMaxBusinesses();
-        try {
-            if (maxBusinesses == null) {
-                if (AppConfig.getConfiguration().containsKey(Property.JUDDI_MAX_BUSINESSES_PER_PUBLISHER)) {
-                    maxBusinesses = AppConfig.getConfiguration().getInteger(Property.JUDDI_MAX_BUSINESSES_PER_PUBLISHER, -1);
-                } else {
-                    maxBusinesses = -1;
+                for (org.uddi.api_v3.BusinessService entity : entityList) {
+                        // Entity specific data validation
+                        validateBusinessService(em, entity, null, config);
                 }
-            }
-        } catch (ConfigurationException e) {
-            log.error(e.getMessage(), e);
-            maxBusinesses = -1; //in case the configuration is not available
         }
-        //if we have the maxBusinesses set for this publisher then we need to make sure we did not exceed it.
-        if (maxBusinesses > 0) {
-            //get the businesses owned by this publisher
-            List<?> businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, null);
-            if (businessKeysFound != null && businessKeysFound.size() > maxBusinesses) {
-                throw new MaxEntitiesExceededException(new ErrorMessage("errors.save.maxBusinessesExceeded"));
-            }
+
+        public void validateSaveServiceMax(EntityManager em, String businessKey) throws DispositionReportFaultMessage {
+
+                //Obtain the maxSettings for this publisher or get the defaults
+                Publisher publisher = em.find(Publisher.class, getPublisher().getAuthorizedName());
+                Integer maxServices = publisher.getMaxBusinesses();
+                try {
+                        if (maxServices == null) {
+                                if (AppConfig.getConfiguration().containsKey(Property.JUDDI_MAX_SERVICES_PER_BUSINESS)) {
+                                        maxServices = AppConfig.getConfiguration().getInteger(Property.JUDDI_MAX_SERVICES_PER_BUSINESS, -1);
+                                } else {
+                                        maxServices = -1;
+                                }
+                        }
+                } catch (ConfigurationException e) {
+                        log.error(e.getMessage(), e);
+                        maxServices = -1; //incase the configuration isn't available
+                }
+                //if we have the maxServices set for a business then we need to make sure we did not exceed it.
+                if (maxServices > 0) {
+                        //get the businesses owned by this publisher
+                        org.apache.juddi.model.BusinessEntity modelBusinessEntity = em.find(org.apache.juddi.model.BusinessEntity.class, businessKey);
+                        if (modelBusinessEntity.getBusinessServices() != null && modelBusinessEntity.getBusinessServices().size() > maxServices) {
+                                throw new MaxEntitiesExceededException(new ErrorMessage("errors.save.maxServicesExceeded"));
+                        }
+                }
         }
 
-    }
+        public void validateSaveBinding(EntityManager em, SaveBinding body, Configuration config) throws DispositionReportFaultMessage {
+
+                if (config == null) {
+                        try {
+                                config = AppConfig.getConfiguration();
+                        } catch (ConfigurationException ce) {
+                                log.error("Could not optain config. " + ce.getMessage(), ce);
+                        }
+                }
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                }
 
-    public void validateSaveService(EntityManager em, SaveService body, Configuration config) throws DispositionReportFaultMessage {
+                // No null or empty list
+                List<org.uddi.api_v3.BindingTemplate> entityList = body.getBindingTemplate();
+                if (entityList == null || entityList.size() == 0) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.savebinding.NoInput"));
+                }
 
-        if (config == null) {
-            try {
-                config = AppConfig.getConfiguration();
-            } catch (ConfigurationException ce) {
-                log.error("Could not optain config. " + ce.getMessage(), ce);
-            }
-        }
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                for (org.uddi.api_v3.BindingTemplate entity : entityList) {
+                        validateBindingTemplate(em, entity, null, config);
+                }
         }
 
-        // No null or empty list
-        List<org.uddi.api_v3.BusinessService> entityList = body.getBusinessService();
-        if (entityList == null || entityList.size() == 0) {
-            throw new ValueNotAllowedException(new ErrorMessage("errors.saveservice.NoInput"));
-        }
+        public void validateSaveBindingMax(EntityManager em, String serviceKey) throws DispositionReportFaultMessage {
 
-        for (org.uddi.api_v3.BusinessService entity : entityList) {
-            // Entity specific data validation
-            validateBusinessService(em, entity, null, config);
+                //Obtain the maxSettings for this publisher or get the defaults
+                Publisher publisher = em.find(Publisher.class, getPublisher().getAuthorizedName());
+                Integer maxBindings = publisher.getMaxBindingsPerService();
+                try {
+                        if (maxBindings == null) {
+                                if (AppConfig.getConfiguration().containsKey(Property.JUDDI_MAX_BINDINGS_PER_SERVICE)) {
+                                        maxBindings = AppConfig.getConfiguration().getInteger(Property.JUDDI_MAX_BINDINGS_PER_SERVICE, -1);
+                                } else {
+                                        maxBindings = -1;
+                                }
+                        }
+                } catch (ConfigurationException e) {
+                        log.error(e.getMessage(), e);
+                        maxBindings = -1; //incase the config isn't available
+                }
+                //if we have the maxBindings set for a service then we need to make sure we did not exceed it.
+                if (maxBindings > 0) {
+                        //get the bindings owned by this service
+                        org.apache.juddi.model.BusinessService modelBusinessService = em.find(org.apache.juddi.model.BusinessService.class, serviceKey);
+                        if (modelBusinessService.getBindingTemplates() != null && modelBusinessService.getBindingTemplates().size() > maxBindings) {
+                                throw new MaxEntitiesExceededException(new ErrorMessage("errors.save.maxBindingsExceeded"));
+                        }
+                }
         }
-    }
 
-    public void validateSaveServiceMax(EntityManager em, String businessKey) throws DispositionReportFaultMessage {
+        public void validateSaveTModel(EntityManager em, SaveTModel body, Configuration config) throws DispositionReportFaultMessage {
 
-        //Obtain the maxSettings for this publisher or get the defaults
-        Publisher publisher = em.find(Publisher.class, getPublisher().getAuthorizedName());
-        Integer maxServices = publisher.getMaxBusinesses();
-        try {
-            if (maxServices == null) {
-                if (AppConfig.getConfiguration().containsKey(Property.JUDDI_MAX_SERVICES_PER_BUSINESS)) {
-                    maxServices = AppConfig.getConfiguration().getInteger(Property.JUDDI_MAX_SERVICES_PER_BUSINESS, -1);
-                } else {
-                    maxServices = -1;
+                if (config == null) {
+                        try {
+                                config = AppConfig.getConfiguration();
+                        } catch (ConfigurationException ce) {
+                                log.error("Could not optain config. " + ce.getMessage(), ce);
+                        }
+                }
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
                 }
-            }
-        } catch (ConfigurationException e) {
-            log.error(e.getMessage(), e);
-            maxServices = -1; //incase the configuration isn't available
-        }
-        //if we have the maxServices set for a business then we need to make sure we did not exceed it.
-        if (maxServices > 0) {
-            //get the businesses owned by this publisher
-            org.apache.juddi.model.BusinessEntity modelBusinessEntity = em.find(org.apache.juddi.model.BusinessEntity.class, businessKey);
-            if (modelBusinessEntity.getBusinessServices() != null && modelBusinessEntity.getBusinessServices().size() > maxServices) {
-                throw new MaxEntitiesExceededException(new ErrorMessage("errors.save.maxServicesExceeded"));
-            }
-        }
-    }
 
-    public void validateSaveBinding(EntityManager em, SaveBinding body, Configuration config) throws DispositionReportFaultMessage {
+                // No null or empty list
+                List<org.uddi.api_v3.TModel> entityList = body.getTModel();
+                if (entityList == null || entityList.size() == 0) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.savetmodel.NoInput"));
+                }
 
-        if (config == null) {
-            try {
-                config = AppConfig.getConfiguration();
-            } catch (ConfigurationException ce) {
-                log.error("Could not optain config. " + ce.getMessage(), ce);
-            }
-        }
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                for (org.uddi.api_v3.TModel entity : entityList) {
+                        validateTModel(em, entity, config);
+                }
         }
 
-        // No null or empty list
-        List<org.uddi.api_v3.BindingTemplate> entityList = body.getBindingTemplate();
-        if (entityList == null || entityList.size() == 0) {
-            throw new ValueNotAllowedException(new ErrorMessage("errors.savebinding.NoInput"));
-        }
+        public void validateSaveTModelMax(EntityManager em) throws DispositionReportFaultMessage {
 
-        for (org.uddi.api_v3.BindingTemplate entity : entityList) {
-            validateBindingTemplate(em, entity, null, config);
+                //Obtain the maxSettings for this publisher or get the defaults
+                Publisher publisher = em.find(Publisher.class, getPublisher().getAuthorizedName());
+                Integer maxTModels = publisher.getMaxTmodels();
+                try {
+                        if (maxTModels == null) {
+                                if (AppConfig.getConfiguration().containsKey(Property.JUDDI_MAX_TMODELS_PER_PUBLISHER)) {
+                                        maxTModels = AppConfig.getConfiguration().getInteger(Property.JUDDI_MAX_TMODELS_PER_PUBLISHER, -1);
+                                } else {
+                                        maxTModels = -1;
+                                }
+                        }
+                } catch (ConfigurationException e) {
+                        log.error(e.getMessage(), e);
+                        maxTModels = -1; //incase the config isn't available
+                }
+                //if we have the TModels set for a publisher then we need to make sure we did not exceed it.
+                if (maxTModels > 0) {
+                        //get the tmodels owned by this publisher
+                        List<?> tmodelKeysFound = FindTModelByPublisherQuery.select(em, null, publisher, null);
+                        if (tmodelKeysFound != null && tmodelKeysFound.size() > maxTModels) {
+                                throw new MaxEntitiesExceededException(new ErrorMessage("errors.save.maxTModelsExceeded"));
+                        }
+                }
         }
-    }
 
-    public void validateSaveBindingMax(EntityManager em, String serviceKey) throws DispositionReportFaultMessage {
+        public void validateAddPublisherAssertions(EntityManager em, AddPublisherAssertions body) throws DispositionReportFaultMessage {
 
-        //Obtain the maxSettings for this publisher or get the defaults
-        Publisher publisher = em.find(Publisher.class, getPublisher().getAuthorizedName());
-        Integer maxBindings = publisher.getMaxBindingsPerService();
-        try {
-            if (maxBindings == null) {
-                if (AppConfig.getConfiguration().containsKey(Property.JUDDI_MAX_BINDINGS_PER_SERVICE)) {
-                    maxBindings = AppConfig.getConfiguration().getInteger(Property.JUDDI_MAX_BINDINGS_PER_SERVICE, -1);
-                } else {
-                    maxBindings = -1;
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                }
+
+                // No null or empty list
+                List<org.uddi.api_v3.PublisherAssertion> entityList = body.getPublisherAssertion();
+                if (entityList == null || entityList.size() == 0) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.addpublisherassertions.NoInput"));
+                }
+
+                for (org.uddi.api_v3.PublisherAssertion entity : entityList) {
+                        validatePublisherAssertion(em, entity);
                 }
-            }
-        } catch (ConfigurationException e) {
-            log.error(e.getMessage(), e);
-            maxBindings = -1; //incase the config isn't available
-        }
-        //if we have the maxBindings set for a service then we need to make sure we did not exceed it.
-        if (maxBindings > 0) {
-            //get the bindings owned by this service
-            org.apache.juddi.model.BusinessService modelBusinessService = em.find(org.apache.juddi.model.BusinessService.class, serviceKey);
-            if (modelBusinessService.getBindingTemplates() != null && modelBusinessService.getBindingTemplates().size() > maxBindings) {
-                throw new MaxEntitiesExceededException(new ErrorMessage("errors.save.maxBindingsExceeded"));
-            }
         }
-    }
 
-    public void validateSaveTModel(EntityManager em, SaveTModel body, Configuration config) throws DispositionReportFaultMessage {
+        public void validateSetPublisherAssertions(EntityManager em, Holder<List<org.uddi.api_v3.PublisherAssertion>> body) throws DispositionReportFaultMessage {
+
+                // No null input
+                if (body == null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+                }
+
+                // Assertion list can be null or empty - it signifies that publisher is deleting all their assertions
+                List<org.uddi.api_v3.PublisherAssertion> entityList = body.value;
+                if (entityList != null && entityList.size() > 0) {
 
-        if (config == null) {
-            try {
-                config = AppConfig.getConfiguration();
-            } catch (ConfigurationException ce) {
-                log.error("Could not optain config. " + ce.getMessage(), ce);
-            }
+                        for (org.uddi.api_v3.PublisherAssertion entity : entityList) {
+                                validatePublisherAssertion(em, entity);
+                        }
+                }
+        }
+
+        void validateNotSigned(org.uddi.api_v3.BusinessEntity item) throws ValueNotAllowedException {
+                if (item == null) {
+                        return;
+                }
+                if (item.getBusinessKey() == null && !item.getSignature().isEmpty()) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessKey"));
+                }
+                if (item.getBusinessServices() != null && !item.getSignature().isEmpty()) {
+                        for (int i = 0; i < item.getBusinessServices().getBusinessService().size(); i++) {
+                                if (item.getBusinessServices().getBusinessService().get(i).getBusinessKey() == null
+                                        || item.getBusinessServices().getBusinessService().get(i).getBusinessKey().length() == 0) {
+                                        throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service(" + i + ")/businessKey"));
+                                }
+                                if (item.getBusinessServices().getBusinessService().get(i).getServiceKey() == null
+                                        || item.getBusinessServices().getBusinessService().get(i).getServiceKey().length() == 0) {
+                                        throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service(" + i + ")/serviceKey"));
+                                }
+                                if (item.getBusinessServices().getBusinessService().get(i).getBindingTemplates() != null) {
+                                        for (int k = 0; k < item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) {
+                                                if (item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).getBindingKey() == null
+                                                        || item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).getBindingKey().length() == 0) {
+                                                        throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service(" + i + ")/bindingTemplate)" + k + ")/bindingKey"));
+                                                }
+                                        }
+                                }
+                        }
+                }
         }
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
+
+        void validateNotSigned(org.uddi.api_v3.BindingTemplate item) throws ValueNotAllowedException {
+                if (item == null) {
+                        return;
+                }
+                if (item.getBindingKey() == null && !item.getSignature().isEmpty()) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "bindingKey"));
+                }
+                if (item.getServiceKey() == null && !item.getSignature().isEmpty()) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "serviceKey"));
+                }
         }
 
-        // No null or empty list
-        List<org.uddi.api_v3.TModel> entityList = body.getTModel();
-        if (entityList == null || entityList.size() == 0) {
-            throw new ValueNotAllowedException(new ErrorMessage("errors.savetmodel.NoInput"));
+        void validateNotSigned(org.uddi.api_v3.TModel item) throws ValueNotAllowedException {
+                if (item == null) {
+                        return;
+                }
+                if (item.getTModelKey() == null && !item.getSignature().isEmpty()) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "tModelKey"));
+                }
         }
 
-        for (org.uddi.api_v3.TModel entity : entityList) {
-            validateTModel(em, entity, config);
+        void validateNotSigned(org.uddi.api_v3.BusinessService item) throws ValueNotAllowedException {
+                if (item == null) {
+                        return;
+                }
+                if (item.getBusinessKey() == null && !item.getSignature().isEmpty()) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessKey"));
+                }
+                if (item.getServiceKey() == null && !item.getSignature().isEmpty()) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "serviceKey"));
+                }
+                //if i'm signed and a key isn't defined in a bt
+                if (item.getBindingTemplates() != null && !item.getSignature().isEmpty()) {
+                        for (int i = 0; i < item.getBindingTemplates().getBindingTemplate().size(); i++) {
+                                if (item.getBindingTemplates().getBindingTemplate().get(i).getBindingKey() == null
+                                        || item.getBindingTemplates().getBindingTemplate().get(i).getBindingKey().length() == 0) {
+                                        throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessService/bindingTemplate(" + i + ")/bindingKey"));
+                                }
+                        }
+                }
         }
-    }
 
-    public void validateSaveTModelMax(EntityManager em) throws DispositionReportFaultMessage {
+        public void validateBusinessEntity(EntityManager em, org.uddi.api_v3.BusinessEntity businessEntity, Configuration config) throws DispositionReportFaultMessage {
 
-        //Obtain the maxSettings for this publisher or get the defaults
-        Publisher publisher = em.find(Publisher.class, getPublisher().getAuthorizedName());
-        Integer maxTModels = publisher.getMaxTmodels();
-        try {
-            if (maxTModels == null) {
-                if (AppConfig.getConfiguration().containsKey(Property.JUDDI_MAX_TMODELS_PER_PUBLISHER)) {
-                    maxTModels = AppConfig.getConfiguration().getInteger(Property.JUDDI_MAX_TMODELS_PER_PUBLISHER, -1);
-                } else {
-                    maxTModels = -1;
+                // A supplied businessEntity can't be null
+                if (businessEntity == null) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.businessentity.NullInput"));
                 }
-            }
-        } catch (ConfigurationException e) {
-            log.error(e.getMessage(), e);
-            maxTModels = -1; //incase the config isn't available
-        }
-        //if we have the TModels set for a publisher then we need to make sure we did not exceed it.
-        if (maxTModels > 0) {
-            //get the tmodels owned by this publisher
-            List<?> tmodelKeysFound = FindTModelByPublisherQuery.select(em, null, publisher, null);
-            if (tmodelKeysFound != null && tmodelKeysFound.size() > maxTModels) {
-                throw new MaxEntitiesExceededException(new ErrorMessage("errors.save.maxTModelsExceeded"));
-            }
-        }
-    }
-
-    public void validateAddPublisherAssertions(EntityManager em, AddPublisherAssertions body) throws DispositionReportFaultMessage {
-
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
-        }
-
-        // No null or empty list
-        List<org.uddi.api_v3.PublisherAssertion> entityList = body.getPublisherAssertion();
-        if (entityList == null || entityList.size() == 0) {
-            throw new ValueNotAllowedException(new ErrorMessage("errors.addpublisherassertions.NoInput"));
-        }
-
-        for (org.uddi.api_v3.PublisherAssertion entity : entityList) {
-            validatePublisherAssertion(em, entity);
-        }
-    }
-
-    public void validateSetPublisherAssertions(EntityManager em, Holder<List<org.uddi.api_v3.PublisherAssertion>> body) throws DispositionReportFaultMessage {
-
-        // No null input
-        if (body == null) {
-            throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
-        }
-
-        // Assertion list can be null or empty - it signifies that publisher is deleting all their assertions
-        List<org.uddi.api_v3.PublisherAssertion> entityList = body.value;
-        if (entityList != null && entityList.size() > 0) {
-
-            for (org.uddi.api_v3.PublisherAssertion entity : entityList) {
-                validatePublisherAssertion(em, entity);
-            }
-        }
-    }
-    
-    void validateNotSigned(org.uddi.api_v3.BusinessEntity item) throws ValueNotAllowedException{
-        if (item==null)
-            return;
-        if (item.getBusinessKey()==null && !item.getSignature().isEmpty())
-            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessKey"));
-        if (item.getBusinessServices()!=null && !item.getSignature().isEmpty())
-        {
-            for (int i=0; i < item.getBusinessServices().getBusinessService().size(); i++){
-                if (item.getBusinessServices().getBusinessService().get(i).getBusinessKey()==null ||
-                        item.getBusinessServices().getBusinessService().get(i).getBusinessKey().length()==0){
-                    throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service("+i+")/businessKey"));        
-                }
-                if (item.getBusinessServices().getBusinessService().get(i).getServiceKey()==null ||
-                        item.getBusinessServices().getBusinessService().get(i).getServiceKey().length()==0){
-                    throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service("+i+")/serviceKey"));        
-                }
-                if (item.getBusinessServices().getBusinessService().get(i).getBindingTemplates()!=null){
-                    for (int k=0; k < item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++){
-                        if (item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).getBindingKey()==null ||
-                                item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).getBindingKey().length()==0)
-                        {
-                            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service("+i+")/bindingTemplate)"+k+")/bindingKey"));        
-                        }
-                    }
-                }
-            }
-        }
-    }
-    
-    void validateNotSigned(org.uddi.api_v3.BindingTemplate item) throws ValueNotAllowedException{
-        if (item==null)
-            return;
-        if (item.getBindingKey()==null && !item.getSignature().isEmpty())
-            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "bindingKey"));
-        if (item.getServiceKey()==null && !item.getSignature().isEmpty())
-            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "serviceKey"));
-    }
-    void validateNotSigned(org.uddi.api_v3.TModel item) throws ValueNotAllowedException{
-        if (item==null)
-            return;
-        if (item.getTModelKey()==null && !item.getSignature().isEmpty())
-            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "tModelKey"));
-    }
-    
-    void validateNotSigned(org.uddi.api_v3.BusinessService item) throws ValueNotAllowedException{
-        if (item==null)
-            return;
-        if (item.getBusinessKey()==null && !item.getSignature().isEmpty())
-            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessKey"));
-        if (item.getServiceKey()==null && !item.getSignature().isEmpty())
-            throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "serviceKey"));
-        //if i'm signed and a key isn't defined in a bt
-        if (item.getBindingTemplates()!=null && !item.getSignature().isEmpty())
-            for (int i=0; i < item.getBindingTemplates().getBindingTemplate().size(); i++)
-            {
-                if (item.getBindingTemplates().getBindingTemplate().get(i).getBindingKey()==null ||
-                        item.getBindingTemplates().getBindingTemplate().get(i).getBindingKey().length()==0)
-                {
-                    throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessService/bindingTemplate(" + i + ")/bindingKey"));
-                }
-        }
-    }
-
-    public void validateBusinessEntity(EntityManager em, org.uddi.api_v3.BusinessEntity businessEntity, Configuration config) throws DispositionReportFaultMessage {
-
-        // A supplied businessEntity can't be null
-        if (businessEntity == null) {
-            throw new ValueNotAllowedException(new ErrorMessage("errors.businessentity.NullInput"));
-        }
-
-        boolean entityExists = false;
-        validateNotSigned(businessEntity);
-        String entityKey = businessEntity.getBusinessKey();
-        if (entityKey == null || entityKey.length() == 0) {
-            KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
-            entityKey = keyGen.generate();
-            businessEntity.setBusinessKey(entityKey);
-        } else {
-            // Per section 4.4: keys must be case-folded
-            entityKey = entityKey.toLowerCase();
-            businessEntity.setBusinessKey(entityKey);
-            validateKeyLength(entityKey);
-            Object obj = em.find(org.apache.juddi.model.BusinessEntity.class, entityKey);
-            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
-                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));
-            }
-        }
-
-        // was TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
-        //covered by ref integrity checks
-
-        validateNames(businessEntity.getName());
-        validateDiscoveryUrls(businessEntity.getDiscoveryURLs());
-        validateContacts(businessEntity.getContacts(), config);
-        validateCategoryBag(businessEntity.getCategoryBag(), config);
-        validateIdentifierBag(businessEntity.getIdentifierBag(), config);
-        validateDescriptions(businessEntity.getDescription());
-        validateBusinessServices(em, businessEntity.getBusinessServices(), businessEntity, config);
-
-    }
-
-    public void validateBusinessServices(EntityManager em, org.uddi.api_v3.BusinessServices businessServices, org.uddi.api_v3.BusinessEntity parent, Configuration config)
-            throws DispositionReportFaultMessage {
-        // Business services is optional
-        if (businessServices == null) {
-            return;
-        }
-        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) {
-            validateBusinessService(em, businessService, parent, config);
-        }
-
-    }
-
-    public void validateBusinessService(EntityManager em, org.uddi.api_v3.BusinessService businessService, org.uddi.api_v3.BusinessEntity parent, Configuration config)
-            throws DispositionReportFaultMessage {
-
-        // A supplied businessService can't be null
-        if (businessService == null) {
-            throw new ValueNotAllowedException(new ErrorMessage("errors.businessservice.NullInput"));
-        }
-
-        validateNotSigned(businessService);
-        // Retrieve the service's passed key
-        String entityKey = businessService.getServiceKey();
-        if (entityKey != null && entityKey.length() > 0) {
-            // Per section 4.4: keys must be case-folded
-            entityKey = entityKey.toLowerCase();
-            validateKeyLength(entityKey);
-            businessService.setServiceKey(entityKey);
-        }
-
-        // The parent key is either supplied or provided by the higher call to the parent entity save.  If the passed-in parent's business key differs from 
-        // the (non-null) business key retrieved from the service, then we have a possible service projection.
-        String parentKey = businessService.getBusinessKey();
-        if (parentKey != null && parentKey.length() > 0) {
-            // Per section 4.4: keys must be case-folded
-            parentKey = parentKey.toLowerCase();
-            businessService.setBusinessKey(parentKey);
-        }
-
-        boolean isProjection = false;
-        if (parent != null) {
-            if (parentKey != null && parentKey.length() > 0) {
-                if (!parentKey.equalsIgnoreCase(parent.getBusinessKey())) {
-                    // Possible projected service - if we have differing parent businesses but a service key was not provided, this is an error as it is not possible 
-                    // for the business that doesn't "own" the service to generate the key for it.
-                    if (entityKey == null || entityKey.length() == 0) {
-                        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ServiceKeyNotProvidedWithProjection", parentKey + ", " + parent.getBusinessKey()));
-                    }
-
-                    isProjection = true;
-                }
-            } else {
-                parentKey = parent.getBusinessKey();
-            }
-        }
-
-        // Projections don't require as rigorous testing as only the projected service's business key and service key are examined for validity.
-        if (isProjection) {
-
-         
-            Object obj = em.find(org.apache.juddi.model.BusinessService.class, entityKey);
-            // Can't project a service that doesn't exist!
-            if (obj == null) {
-                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ProjectedServiceNotFound", parentKey + ", " + entityKey));
-            } else {
-                // If the supplied business key doesn't match the existing service's business key, the projection is invalid.
-                org.apache.juddi.model.BusinessService bs = (org.apache.juddi.model.BusinessService) obj;
-                if (!businessService.getBusinessKey().equalsIgnoreCase(bs.getBusinessEntity().getEntityKey())) {
-                    throw new InvalidProjectionException(new ErrorMessage("errors.invalidprojection.ParentMismatch", businessService.getBusinessKey() + ", " + bs.getBusinessEntity().getEntityKey()));
-                }
-            }
-            obj = null;
-        } else {
-            boolean entityExists = false;
-            if (entityKey == null || entityKey.length() == 0) {
-                KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
-                entityKey = keyGen.generate();
-                businessService.setServiceKey(entityKey);
-            } else {
-
-                Object obj = em.find(org.apache.juddi.model.BusinessService.class, entityKey);
-                if (obj != null) {
-                    entityExists = true;
-
-                    org.apache.juddi.model.BusinessService bs = (org.apache.juddi.model.BusinessService) obj;
-
-                    // If the object exists, and the parentKey was not found to this point, then a save on an existing service with a blank
-                    // business key has occurred.  It is set here and added to the entity being saved - a necessary step for the object to be
-                    // persisted properly. (This condition makes some validation tests below unnecessary as the parent is "verified" but it's OK to
-                    // still run them).
-                    if (parentKey == null || parentKey.length() == 0) {
-                        parentKey = bs.getBusinessEntity().getEntityKey();
-                        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()));
+                boolean entityExists = false;
+                validateNotSigned(businessEntity);
+                String entityKey = businessEntity.getBusinessKey();
+                if (entityKey == null || entityKey.length() == 0) {
+                        KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
+                        entityKey = keyGen.generate();
+                        businessEntity.setBusinessKey(entityKey);
+                } else {
+                        // Per section 4.4: keys must be case-folded
+                        entityKey = entityKey.toLowerCase();
+                        businessEntity.setBusinessKey(entityKey);
+                        validateKeyLength(entityKey);
+                        Object obj = em.find(org.apache.juddi.model.BusinessEntity.class, entityKey);
+                        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 {
-                            if (log.isDebugEnabled()) {
-                                log.debug("Services moved from business " + bs.getBusinessEntity() + " to " + businessService.getBusinessKey());
-                            }
+                                // 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));
+                                }
+
                         }
-                    }
+                }
 
-                } else {
-                    // Inside this block, we have a key proposed by the publisher on a new entity
+                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));
+                        }
+                }
+
+                // was TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
+                //covered by ref integrity checks
+
+                validateNames(businessEntity.getName());
+                validateDiscoveryUrls(businessEntity.getDiscoveryURLs());
+                validateContacts(businessEntity.getContacts(), config);
+                validateCategoryBag(businessEntity.getCategoryBag(), config);
+                validateIdentifierBag(businessEntity.getIdentifierBag(), config);
+                validateDescriptions(businessEntity.getDescription());
+                validateBusinessServices(em, businessEntity.getBusinessServices(), businessEntity, config);
+
+        }
 
-                    // 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));
-                    }
+        public void validateBusinessServices(EntityManager em, org.uddi.api_v3.BusinessServices businessServices, org.uddi.api_v3.BusinessEntity parent, Configuration config)
+                throws DispositionReportFaultMessage {
+                // Business services is optional
+                if (businessServices == null) {
+                        return;
+                }
+                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) {
+                        validateBusinessService(em, businessService, parent, config);
                 }
 
-            }
+        }
+
+        public void validateBusinessService(EntityManager em, org.uddi.api_v3.BusinessService businessService, org.uddi.api_v3.BusinessEntity parent, Configuration config)
+                throws DispositionReportFaultMessage {
 
-            // 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));
+                // A supplied businessService can't be null
+                if (businessService == null) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.businessservice.NullInput"));
                 }
-            }
 
-            // 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));
-                    }
+                validateNotSigned(businessService);
+                // Retrieve the service's passed key
+                String entityKey = businessService.getServiceKey();
+                if (entityKey != null && entityKey.length() > 0) {
+                        // Per section 4.4: keys must be case-folded
+                        entityKey = entityKey.toLowerCase();
+                        validateKeyLength(entityKey);
+                        businessService.setServiceKey(entityKey);
+                }
 
-                    // Make sure publisher owns this parent entity.
-                    if (!publisher.isOwner((UddiEntity) parentTemp)) {
-                        throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwnerParent", parentKey));
-                    }
+                // The parent key is either supplied or provided by the higher call to the parent entity save.  If the passed-in parent's business key differs from 
+                // the (non-null) business key retrieved from the service, then we have a possible service projection.
+                String parentKey = businessService.getBusinessKey();
+                if (parentKey != null && parentKey.length() > 0) {
+                        // Per section 4.4: keys must be case-folded
+                        parentKey = parentKey.toLowerCase();
+                        businessService.setBusinessKey(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));
+                boolean isProjection = false;
+                if (parent != null) {
+                        if (parentKey != null && parentKey.length() > 0) {
+                                if (!parentKey.equalsIgnoreCase(parent.getBusinessKey())) {
+                                        // Possible projected service - if we have differing parent businesses but a service key was not provided, this is an error as it is not possible 
+                                        // for the business that doesn't "own" the service to generate the key for it.
+                                        if (entityKey == null || entityKey.length() == 0) {
+                                                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ServiceKeyNotProvidedWithProjection", parentKey + ", " + parent.getBusinessKey()));
+                                        }
+
+                                        isProjection = true;
+                                }
+                        } else {
+                                parentKey = parent.getBusinessKey();
+                        }
                 }
-            }
 
-            // TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
+                // Projections don't require as rigorous testing as only the projected service's business key and service key are examined for validity.
+                if (isProjection) {
 
-            validateNames(businessService.getName());
-            validateCategoryBag(businessService.getCategoryBag(), config);
-            validateDescriptions(businessService.getDescription());
-            validateBindingTemplates(em, businessService.getBindingTemplates(), businessService, config);
-        }
 
-    }
+                        Object obj = em.find(org.apache.juddi.model.BusinessService.class, entityKey);
+                        // Can't project a service that doesn't exist!
+                        if (obj == null) {
+                                throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ProjectedServiceNotFound", parentKey + ", " + entityKey));
+                        } else {
+                                // If the supplied business key doesn't match the existing service's business key, the projection is invalid.
+                                org.apache.juddi.model.BusinessService bs = (org.apache.juddi.model.BusinessService) obj;
+                                if (!businessService.getBusinessKey().equalsIgnoreCase(bs.getBusinessEntity().getEntityKey())) {
+                                        throw new InvalidProjectionException(new ErrorMessage("errors.invalidprojection.ParentMismatch", businessService.getBusinessKey() + ", " + bs.getBusinessEntity().getEntityKey()));
+                                }
+                        }
+                        obj = null;
+                } else {
+                        boolean entityExists = false;
+                        if (entityKey == null || entityKey.length() == 0) {
+                                KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
+                                entityKey = keyGen.generate();
+                                businessService.setServiceKey(entityKey);
+                        } else {
 
-    public void validateBindingTemplates(EntityManager em, org.uddi.api_v3.BindingTemplates bindingTemplates, org.uddi.api_v3.BusinessService parent, Configuration config)
-            throws DispositionReportFaultMessage {
-        // Binding templates is optional
-        if (bindingTemplates == null) {
-            return;
-        }
+                                Object obj = em.find(org.apache.juddi.model.BusinessService.class, entityKey);
+                                if (obj != null) {
+                                        entityExists = true;
+
+                                        org.apache.juddi.model.BusinessService bs = (org.apache.juddi.model.BusinessService) obj;
+
+                                        // If the object exists, and the parentKey was not found to this point, then a save on an existing service with a blank
+                                        // business key has occurred.  It is set here and added to the entity being saved - a necessary step for the object to be
+                                        // persisted properly. (This condition makes some validation tests below unnecessary as the parent is "verified" but it's OK to
+                                        // still run them).
+                                        if (parentKey == null || parentKey.length() == 0) {
+                                                parentKey = bs.getBusinessEntity().getEntityKey();
+                                                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));
+                                        }
 
-        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) {
-            validateBindingTemplate(em, bindingTemplate, parent, config);
-        }
+                        }
 
-    }
+                        // 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));
+                                }
+                        }
 
-    public void validateBindingTemplate(EntityManager em, org.uddi.api_v3.BindingTemplate bindingTemplate,
-            org.uddi.api_v3.BusinessService parent, Configuration config)
-            throws DispositionReportFaultMessage {
+                        // 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));
+                                        }
+                                }
+                        }
 
-        // A supplied bindingTemplate can't be null
-        if (bindingTemplate == null) {
-            throw new ValueNotAllowedException(new ErrorMessage("errors.bindingtemplate.NullInput"));
-        }
+                        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));
+                                }
+                        }
 
-        // Retrieve the binding's passed key
-        String entityKey = bindingTemplate.getBindingKey();
-        if (entityKey != null && entityKey.length() > 0) {
-            // Per section 4.4: keys must be case-folded
-            entityKey = entityKey.toLowerCase();
-            bindingTemplate.setBindingKey(entityKey);
-            validateKeyLength(entityKey);
-        }
+                        // TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
+
+                        validateNames(businessService.getName());
+                        validateCategoryBag(businessService.getCategoryBag(), config);
+                        validateDescriptions(businessService.getDescription());
+                        validateBindingTemplates(em, businessService.getBindingTemplates(), businessService, config);
+                }
 
-        // The parent key is either supplied or provided by the higher call to the parent entity save.  If it is provided in both instances, if they differ, an 
-        // error occurs.
-        String parentKey = bindingTemplate.getServiceKey();
-        if (parentKey != null && parentKey.length() > 0) {
-            // Per section 4.4: keys must be case-folded
-            parentKey = parentKey.toLowerCase();
-            bindingTemplate.setServiceKey(parentKey);
         }
 
-        if (parent != null) {
-            if (parentKey != null && parentKey.length() > 0) {
-                if (!parentKey.equalsIgnoreCase(parent.getServiceKey())) {
-                    throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.bindingtemplate.ParentMismatch", parentKey + ", " + parent.getBusinessKey()));
+        public void validateBindingTemplates(EntityManager em, org.uddi.api_v3.BindingTemplates bindingTemplates, org.uddi.api_v3.BusinessService parent, Configuration config)
+                throws DispositionReportFaultMessage {
+                // Binding templates is optional
+                if (bindingTemplates == null) {
+                        return;
                 }
-            } else {
-                parentKey = parent.getServiceKey();
-            }
-        }
 
-        boolean entityExists = false;
-        if (entityKey == null || entityKey.length() == 0) {
-            validateNotSigned(bindingTemplate);
-            KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator();
-            entityKey = keyGen.generate();
-            bindingTemplate.setBindingKey(entityKey);
-        } else {
+                List<org.uddi.api_v3.BindingTemplate> bindingTemplateList = bindingTemplates.getBindingTemplate();
+                if (bindingTemplateList == null || bindingTemplateList.size() == 0) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.bindingtemplates.NoInput"));
+                }
 
-            Object obj = em.find(org.apache.juddi.model.BindingTemplate.class, entityKey);
-            if (obj != null) {
-                entityExists = true;
+                for (org.uddi.api_v3.BindingTemplate bindingTemplate : bindingTemplateList) {
+                        validateBindingTemplate(em, bindingTemplate, parent, config);
+                }
 
-                org.apache.juddi.model.BindingTemplate bt = (org.apache.juddi.model.BindingTemplate) obj;
+        }
 
-                // If the object exists, and the parentKey was not found to this point, then a save on an existing binding with a blank
-                // service key has occurred.  It is set here and added to the entity being saved - a necessary step for the object to be
-                // persisted properly. (This condition makes some validation tests below unnecessary as the parent is "verified" but it's OK to
-                // still run them).
-                if (parentKey == null || parentKey.length() == 0) {
-                    parentKey = bt.getBusinessService().getEntityKey();
-                    bindingTemplate.setServiceKey(parentKey);
-                }
+        public void validateBindingTemplate(EntityManager em, org.uddi.api_v3.BindingTemplate bindingTemplate,
+                org.uddi.api_v3.BusinessService parent, Configuration config)
+                throws DispositionReportFaultMessage {
 

[... 1864 lines stripped ...]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org