You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by jf...@apache.org on 2009/01/14 22:41:42 UTC

svn commit: r734522 - in /webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi: api/impl/ config/ mapping/ model/ query/ validation/

Author: jfaath
Date: Wed Jan 14 13:41:41 2009
New Revision: 734522

URL: http://svn.apache.org/viewvc?rev=734522&view=rev
Log:
significant change to model - made the UddiEntity parent an entity so it could hold the data for "operationalInfo".  Operational Info is now set on publish operations.  Other classes were adjusted to handle new structure.  Install process was modified to retrieve important information before installation occurs.

Removed:
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/OperationalInfo.java
Modified:
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntity.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntityPublisher.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBindingTemplatesQuery.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchTModelsQuery.java
    webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java Wed Jan 14 13:41:41 2009
@@ -608,7 +608,8 @@
 			
 			List<?> tmodelKeysFound = null;
 			tmodelKeysFound = FindTModelByIdentifierQuery.select(em, findQualifiers, findTmodel.getIdentifierBag(), tmodelKeysFound);
-			//tmodelKeysFound = FindTModelByCategoryQuery.select(em, findQualifiers, findTmodel.getCategoryBag(), tmodelKeysFound);
+			tmodelKeysFound = FindTModelByCategoryQuery.select(em, findQualifiers, findTmodel.getCategoryBag(), tmodelKeysFound);
+			tmodelKeysFound = FindTModelByCategoryGroupQuery.select(em, findQualifiers, findTmodel.getCategoryBag(), tmodelKeysFound);
 			tmodelKeysFound = FindTModelByNameQuery.select(em, findQualifiers, findTmodel.getName(), tmodelKeysFound);
 			
 			if (tmodelKeysFound != null && tmodelKeysFound.size() > 0) {

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java Wed Jan 14 13:41:41 2009
@@ -17,10 +17,12 @@
 
 package org.apache.juddi.api.impl;
 
+import java.util.Date;
 import java.util.List;
 import java.util.ArrayList;
 
 import javax.jws.WebService;
+//import javax.naming.ConfigurationException;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
 import javax.xml.ws.Holder;
@@ -47,6 +49,7 @@
 import org.uddi.v3_service.DispositionReportFaultMessage;
 import org.uddi.v3_service.UDDIPublicationPortType;
 
+import org.apache.commons.configuration.ConfigurationException;
 import org.apache.juddi.mapping.MappingApiToModel;
 import org.apache.juddi.mapping.MappingModelToApi;
 import org.apache.juddi.validation.ValidatePublish;
@@ -58,10 +61,13 @@
 import org.apache.juddi.query.DeletePublisherAssertionByBusinessQuery;
 import org.apache.juddi.query.PersistenceManager;
 import org.apache.juddi.model.UddiEntityPublisher;
-import org.apache.juddi.model.Publisher;
 import org.apache.juddi.api.datatype.PublisherDetail;
 import org.apache.juddi.api.datatype.SavePublisher;
 import org.apache.juddi.api.datatype.DeletePublisher;
+import org.apache.juddi.config.AppConfig;
+import org.apache.juddi.config.Property;
+import org.apache.juddi.error.ErrorMessage;
+import org.apache.juddi.error.FatalErrorException;
 import org.apache.juddi.query.util.FindQualifiers;
 
 /**
@@ -150,6 +156,9 @@
 		List<String> entityKeyList = body.getBindingKey();
 		for (String entityKey : entityKeyList) {
 			Object obj = em.find(org.apache.juddi.model.BindingTemplate.class, entityKey);
+
+			((org.apache.juddi.model.BindingTemplate)obj).getBusinessService().setModifiedIncludingChildren(new Date());
+			
 			em.remove(obj);
 		}
 
@@ -214,6 +223,9 @@
 		List<String> entityKeyList = body.getServiceKey();
 		for (String entityKey : entityKeyList) {
 			Object obj = em.find(org.apache.juddi.model.BusinessService.class, entityKey);
+			
+			((org.apache.juddi.model.BusinessService)obj).getBusinessEntity().setModifiedIncludingChildren(new Date());
+			
 			em.remove(obj);
 		}
 
@@ -379,12 +391,9 @@
 			modelBusinessService.setEntityKey(apiBindingTemplate.getServiceKey());
 			
 			MappingApiToModel.mapBindingTemplate(apiBindingTemplate, modelBindingTemplate, modelBusinessService);
-			
-			Object existingUddiEntity = em.find(modelBindingTemplate.getClass(), modelBindingTemplate.getEntityKey());
-			if (existingUddiEntity != null)
-				em.remove(existingUddiEntity);
-			
-			modelBindingTemplate.assignAuthorizedName(publisher.getAuthorizedName());
+
+			setOperationalInfo(em, modelBindingTemplate, publisher, false);
+
 			em.persist(modelBindingTemplate);
 			
 			result.getBindingTemplate().add(apiBindingTemplate);
@@ -417,11 +426,8 @@
 			
 			MappingApiToModel.mapBusinessEntity(apiBusinessEntity, modelBusinessEntity);
 			
-			Object existingUddiEntity = em.find(modelBusinessEntity.getClass(), modelBusinessEntity.getEntityKey());
-			if (existingUddiEntity != null)
-				em.remove(existingUddiEntity);
-			
-			modelBusinessEntity.assignAuthorizedName(publisher.getAuthorizedName());
+			setOperationalInfo(em, modelBusinessEntity, publisher);
+
 			em.persist(modelBusinessEntity);
 
 			result.getBusinessEntity().add(apiBusinessEntity);
@@ -455,12 +461,9 @@
 			modelBusinessEntity.setEntityKey(apiBusinessService.getBusinessKey());
 			
 			MappingApiToModel.mapBusinessService(apiBusinessService, modelBusinessService, modelBusinessEntity);
-			
-			Object existingUddiEntity = em.find(modelBusinessService.getClass(), modelBusinessService.getEntityKey());
-			if (existingUddiEntity != null)
-				em.remove(existingUddiEntity);
-			
-			modelBusinessService.assignAuthorizedName(publisher.getAuthorizedName());
+
+			setOperationalInfo(em, modelBusinessService, publisher, false);
+
 			em.persist(modelBusinessService);
 			
 			result.getBusinessService().add(apiBusinessService);
@@ -492,12 +495,9 @@
 			org.apache.juddi.model.Tmodel modelTModel = new org.apache.juddi.model.Tmodel();
 			
 			MappingApiToModel.mapTModel(apiTModel, modelTModel);
-			
-			Object existingUddiEntity = em.find(modelTModel.getClass(), modelTModel.getEntityKey());
-			if (existingUddiEntity != null)
-				em.remove(existingUddiEntity);
-			
-			modelTModel.assignAuthorizedName(publisher.getAuthorizedName());
+
+			setOperationalInfo(em, modelTModel, publisher);
+
 			em.persist(modelTModel);
 			
 			result.getTModel().add(apiTModel);
@@ -557,6 +557,133 @@
 		em.close();
 	}
 
+	private void setOperationalInfo(EntityManager em, org.apache.juddi.model.BusinessEntity uddiEntity, UddiEntityPublisher publisher) throws DispositionReportFaultMessage {
+
+		uddiEntity.setPublisher(publisher);
+
+		Date now = new Date();
+		uddiEntity.setModified(now);
+		uddiEntity.setModifiedIncludingChildren(now);
+
+		String nodeId = "";
+		try 
+		{ nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID); } 
+		catch (ConfigurationException ce) 
+		{ throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval", Property.JUDDI_NODE_ID)); }
+		uddiEntity.setNodeId(nodeId);
+		
+		org.apache.juddi.model.BusinessEntity existingUddiEntity = em.find(uddiEntity.getClass(), uddiEntity.getEntityKey());
+		if (existingUddiEntity != null)
+			uddiEntity.setCreated(existingUddiEntity.getCreated());
+		else
+			uddiEntity.setCreated(now);
+		
+		List<org.apache.juddi.model.BusinessService> serviceList = uddiEntity.getBusinessServices();
+		for (org.apache.juddi.model.BusinessService service : serviceList)
+			setOperationalInfo(em, service, publisher, true);
+		
+		
+		if (existingUddiEntity != null)
+			em.remove(existingUddiEntity);
+		
+	}
+
+	private void setOperationalInfo(EntityManager em, org.apache.juddi.model.BusinessService uddiEntity, UddiEntityPublisher publisher, boolean isChild) throws DispositionReportFaultMessage {
+
+		uddiEntity.setPublisher(publisher);
+
+		Date now = new Date();
+		uddiEntity.setModified(now);
+		uddiEntity.setModifiedIncludingChildren(now);
+		
+		if(!isChild) {
+			org.apache.juddi.model.BusinessEntity parent = em.find(org.apache.juddi.model.BusinessEntity.class, uddiEntity.getBusinessEntity().getEntityKey());
+			parent.setModifiedIncludingChildren(now);
+			em.persist(parent);
+		}
+
+		String nodeId = "";
+		try 
+		{ nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID); } 
+		catch (ConfigurationException ce) 
+		{ throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval", Property.JUDDI_NODE_ID)); }
+		uddiEntity.setNodeId(nodeId);
+		
+		org.apache.juddi.model.BusinessService existingUddiEntity = em.find(uddiEntity.getClass(), uddiEntity.getEntityKey());
+		if (existingUddiEntity != null) {
+			uddiEntity.setCreated(existingUddiEntity.getCreated());
+		}
+		else
+			uddiEntity.setCreated(now);
+		
+		List<org.apache.juddi.model.BindingTemplate> bindingList = uddiEntity.getBindingTemplates();
+		for (org.apache.juddi.model.BindingTemplate binding : bindingList)
+			setOperationalInfo(em, binding, publisher, true);
+		
+		
+		if (existingUddiEntity != null)
+			em.remove(existingUddiEntity);
+		
+	}
+
+	private void setOperationalInfo(EntityManager em, org.apache.juddi.model.BindingTemplate uddiEntity, UddiEntityPublisher publisher, boolean isChild) throws DispositionReportFaultMessage {
+
+		uddiEntity.setPublisher(publisher);
+
+		Date now = new Date();
+		uddiEntity.setModified(now);
+		uddiEntity.setModifiedIncludingChildren(now);
+
+		if(!isChild) {
+			org.apache.juddi.model.BusinessService parent = em.find(org.apache.juddi.model.BusinessService.class, uddiEntity.getBusinessService().getEntityKey());
+			parent.setModifiedIncludingChildren(now);
+			em.persist(parent);
+		}
+
+		String nodeId = "";
+		try 
+		{ nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID); } 
+		catch (ConfigurationException ce) 
+		{ throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval", Property.JUDDI_NODE_ID)); }
+		uddiEntity.setNodeId(nodeId);
+		
+		org.apache.juddi.model.BindingTemplate existingUddiEntity = em.find(uddiEntity.getClass(), uddiEntity.getEntityKey());
+		if (existingUddiEntity != null)
+			uddiEntity.setCreated(existingUddiEntity.getCreated());
+		else
+			uddiEntity.setCreated(now);
+		
+		if (existingUddiEntity != null)
+			em.remove(existingUddiEntity);
+		
+	}
+	
+	private void setOperationalInfo(EntityManager em, org.apache.juddi.model.Tmodel uddiEntity, UddiEntityPublisher publisher) throws DispositionReportFaultMessage {
+
+		uddiEntity.setPublisher(publisher);
+		
+		Date now = new Date();
+		uddiEntity.setModified(now);
+		uddiEntity.setModifiedIncludingChildren(now);
+
+		String nodeId = "";
+		try 
+		{ nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID); } 
+		catch (ConfigurationException ce) 
+		{ throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval", Property.JUDDI_NODE_ID)); }
+		uddiEntity.setNodeId(nodeId);
+		
+		org.apache.juddi.model.Tmodel existingUddiEntity = em.find(uddiEntity.getClass(), uddiEntity.getEntityKey());
+		if (existingUddiEntity != null)
+			uddiEntity.setCreated(existingUddiEntity.getCreated());
+		else
+			uddiEntity.setCreated(now);
+		
+		if (existingUddiEntity != null)
+			em.remove(existingUddiEntity);
+		
+	}
+
 	
 	/*-------------------------------------------------------------------
 	 Publisher functions are specific to jUDDI.
@@ -574,7 +701,7 @@
 
 		UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
 		
-		new ValidatePublish(publisher).validateSavePublisher(em, (Publisher)publisher, body);
+		new ValidatePublish(publisher).validateSavePublisher(em, body);
 		
 		PublisherDetail result = new PublisherDetail();
 
@@ -612,7 +739,7 @@
 
 		UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
 		
-		new ValidatePublish(publisher).validateDeletePublisher(em, (Publisher)publisher, body);
+		new ValidatePublish(publisher).validateDeletePublisher(em, body);
 
 		List<String> entityKeyList = body.getPublisherId();
 		for (String entityKey : entityKeyList) {

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/config/Install.java Wed Jan 14 13:41:41 2009
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.util.Date;
 import java.util.List;
 import java.util.StringTokenizer;
 import java.util.UUID;
@@ -72,7 +73,7 @@
 		install(JUDDI_INSTALL_DATA_DIR, null, false);
 	}
 	
-	public static void install(String srcDir, String rootPartition, boolean reloadConfig) throws JAXBException, DispositionReportFaultMessage, IOException {
+	public static void install(String srcDir, String userPartition, boolean reloadConfig) throws JAXBException, DispositionReportFaultMessage, IOException {
 		if (srcDir != null) {
 			if (srcDir.endsWith("\\") || srcDir.endsWith("/")) {
 				// Do nothing
@@ -94,15 +95,22 @@
 			if (alreadyInstalled(em))
 				throw new FatalErrorException(new ErrorMessage("errors.install.AlreadyInstalled"));
 			
+			TModel rootTModelKeyGen = (TModel)buildEntityFromDoc(JUDDI_INSTALL_DATA_DIR + FILE_ROOT_TMODELKEYGEN, "org.uddi.api_v3");
+			org.uddi.api_v3.BusinessEntity rootBusinessEntity = (org.uddi.api_v3.BusinessEntity)buildEntityFromDoc(srcDir + FILE_ROOT_BUSINESSENTITY, "org.uddi.api_v3");
+			
+			String rootPartition = getRootPartition(rootTModelKeyGen, userPartition);
+			String nodeId = getNodeId(rootBusinessEntity.getBusinessKey(), rootPartition);
+			
 			rootPublisher = installPublisher(em, JUDDI_INSTALL_DATA_DIR + FILE_ROOT_PUBLISHER);
 			uddiPublisher = installPublisher(em, JUDDI_INSTALL_DATA_DIR + FILE_UDDI_PUBLISHER);
 
-			installUDDITModels(em, JUDDI_INSTALL_DATA_DIR + FILE_UDDI_TMODELS, uddiPublisher);
-			
-			installRootPublisherKeyGen(em, JUDDI_INSTALL_DATA_DIR + FILE_ROOT_TMODELKEYGEN, rootPartition, rootPublisher);
+			installRootPublisherKeyGen(em, rootTModelKeyGen, rootPartition, rootPublisher, nodeId);
+
+			rootBusinessEntity.setBusinessKey(nodeId);
+			installRootBusinessEntity(em, rootBusinessEntity, rootPublisher);
 
-			// This entity is installed through the API so validation can be performed.
-			installRootBusinessEntity(em, srcDir + FILE_ROOT_BUSINESSENTITY, rootPublisher);
+			installUDDITModels(em, JUDDI_INSTALL_DATA_DIR + FILE_UDDI_TMODELS, uddiPublisher, nodeId);
+			
 			
 			tx.commit();
 		}
@@ -171,6 +179,50 @@
 		return false;
 	}
 	
+	public static String getRootPartition(TModel rootTModelKeyGen, String userPartition) throws JAXBException, IOException, DispositionReportFaultMessage {
+		String result = rootTModelKeyGen.getTModelKey().substring(0, rootTModelKeyGen.getTModelKey().lastIndexOf(KeyGenerator.PARTITION_SEPARATOR));
+		
+		if (userPartition != null && userPartition.length() > 0) {
+			// A root partition was provided by the user.  Must validate it.  The first component should be a domain key and the any following
+			// tokens should be a valid KSS.
+			userPartition = userPartition.trim();
+			if (userPartition.endsWith(KeyGenerator.PARTITION_SEPARATOR) || userPartition.startsWith(KeyGenerator.PARTITION_SEPARATOR))
+				throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", userPartition));
+			
+			StringTokenizer tokenizer = new StringTokenizer(userPartition.toLowerCase(), KeyGenerator.PARTITION_SEPARATOR);
+			for(int count = 0; tokenizer.hasMoreTokens(); count++) {
+				String nextToken = tokenizer.nextToken();
+
+				if (count == 0) {
+					if(!ValidateUDDIKey.isValidDomainKey(nextToken))
+						throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", userPartition));
+				}
+				else {
+					if (!ValidateUDDIKey.isValidKSS(nextToken))
+						throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", userPartition));
+				}
+			}
+			// If the user-supplied root partition checks out, we can use that.
+			result = KeyGenerator.UDDI_SCHEME + KeyGenerator.PARTITION_SEPARATOR + userPartition;
+		}
+		return result;
+	}
+	
+	public static String getNodeId(String userNodeId, String rootPartition) throws DispositionReportFaultMessage {
+
+		String result = userNodeId;
+		if (result == null || result.length() == 0) {
+			result = rootPartition + KeyGenerator.PARTITION_SEPARATOR + UUID.randomUUID();
+		}
+		else {
+			ValidateUDDIKey.validateUDDIv3Key(result, rootPartition);
+			String keyPartition = result.substring(0, result.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR));
+			if (!rootPartition.equalsIgnoreCase(keyPartition))
+				throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", userNodeId));
+		}
+		return result;
+	}
+	
 	public static org.uddi.api_v3.BusinessEntity getNodeBusinessEntity(String businessKey) throws DispositionReportFaultMessage {
 		UDDIInquiryImpl inquiry = new UDDIInquiryImpl();
 		
@@ -188,17 +240,44 @@
 	}
 	
 	
-	private static void installRootBusinessEntity(EntityManager em, String resource, UddiEntityPublisher rootPublisher) 
+	private static String installRootBusinessEntity(EntityManager em, org.uddi.api_v3.BusinessEntity rootBusinessEntity, UddiEntityPublisher rootPublisher) 
 	throws JAXBException, DispositionReportFaultMessage, IOException {
-
-		org.uddi.api_v3.BusinessEntity apiBusinessEntity = (org.uddi.api_v3.BusinessEntity)buildEntityFromDoc(resource, "org.uddi.api_v3");
-		validateRootBusinessEntity(apiBusinessEntity, rootPublisher);
+		
+		validateRootBusinessEntity(rootBusinessEntity, rootPublisher);
 		
 		org.apache.juddi.model.BusinessEntity modelBusinessEntity = new org.apache.juddi.model.BusinessEntity();
-		MappingApiToModel.mapBusinessEntity(apiBusinessEntity, modelBusinessEntity);
+		MappingApiToModel.mapBusinessEntity(rootBusinessEntity, modelBusinessEntity);
+		
+		modelBusinessEntity.setPublisher(rootPublisher);
+		
+		Date now = new Date();
+		modelBusinessEntity.setCreated(now);
+		modelBusinessEntity.setModified(now);
+		modelBusinessEntity.setModifiedIncludingChildren(now);
+		modelBusinessEntity.setNodeId(modelBusinessEntity.getEntityKey());
+		
+		for (org.apache.juddi.model.BusinessService service : modelBusinessEntity.getBusinessServices()) {
+			service.setPublisher(rootPublisher);
+			
+			service.setCreated(now);
+			service.setModified(now);
+			service.setModifiedIncludingChildren(now);
+			service.setNodeId(modelBusinessEntity.getEntityKey());
+			
+			for (org.apache.juddi.model.BindingTemplate binding : service.getBindingTemplates()) {
+				binding.setPublisher(rootPublisher);
+				
+				binding.setCreated(now);
+				binding.setModified(now);
+				binding.setModifiedIncludingChildren(now);
+				binding.setNodeId(modelBusinessEntity.getEntityKey());
+			}
+		}
+		
 		
-		modelBusinessEntity.assignAuthorizedName(rootPublisher.getAuthorizedName());
 		em.persist(modelBusinessEntity);
+		
+		return modelBusinessEntity.getEntityKey();
 
 	}
 	
@@ -214,13 +293,14 @@
 		String rootPartition = rootPublisher.getKeyGeneratorKeys().iterator().next().getKeygenTModelKey();
 		rootPartition = rootPartition.substring(0, rootPartition.lastIndexOf(KeyGenerator.PARTITION_SEPARATOR));
 		
+		// The business key should already be set to the previously calculated and validated nodeId.  This validation is unnecessary but kept for 
+		// symmetry with the other entity validations.
 		String entityKey = businessEntity.getBusinessKey();
 		if (entityKey == null || entityKey.length() == 0) {
 			entityKey = rootPartition + KeyGenerator.PARTITION_SEPARATOR + UUID.randomUUID();
 			businessEntity.setBusinessKey(entityKey);
 		}
 		else {
-			
 			ValidateUDDIKey.validateUDDIv3Key(entityKey, rootPartition);
 			if (!rootPublisher.isValidPublisherKey(entityKey))
 				throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.BadPartition", entityKey));
@@ -335,10 +415,10 @@
 	
 	
 	
-	private static void installUDDITModels(EntityManager em, String resource, UddiEntityPublisher publisher) 
+	private static void installUDDITModels(EntityManager em, String resource, UddiEntityPublisher publisher, String nodeId) 
 		throws JAXBException, DispositionReportFaultMessage, IOException {
 		SaveTModel apiSaveTModel = (SaveTModel)buildEntityFromDoc(resource, "org.uddi.api_v3");
-		installTModels(em, apiSaveTModel.getTModel(), publisher);
+		installTModels(em, apiSaveTModel.getTModel(), publisher, nodeId);
 		
 	}
 	
@@ -351,19 +431,26 @@
 		return modelPub;
 	}
 	
-	private static void installTModels(EntityManager em, List<org.uddi.api_v3.TModel> apiTModelList, UddiEntityPublisher publisher) throws DispositionReportFaultMessage {
+	private static void installTModels(EntityManager em, List<org.uddi.api_v3.TModel> apiTModelList, UddiEntityPublisher publisher, String nodeId) throws DispositionReportFaultMessage {
 		if (apiTModelList != null) {
 			for (org.uddi.api_v3.TModel apiTModel : apiTModelList) {
 				String tModelKey = apiTModel.getTModelKey();
 
 				if (tModelKey.toUpperCase().endsWith(KeyGenerator.KEYGENERATOR_SUFFIX.toUpperCase())) {
-					installPublisherKeyGen(em, apiTModel, publisher);
+					installPublisherKeyGen(em, apiTModel, publisher, nodeId);
 				}
 				else {
 					org.apache.juddi.model.Tmodel modelTModel = new org.apache.juddi.model.Tmodel();
 					MappingApiToModel.mapTModel(apiTModel, modelTModel);
+
 					modelTModel.setPublisher(publisher);
 					
+					Date now = new Date();
+					modelTModel.setCreated(now);
+					modelTModel.setModified(now);
+					modelTModel.setModifiedIncludingChildren(now);
+					modelTModel.setNodeId(nodeId);
+					
 					em.persist(modelTModel);
 				}
 				
@@ -372,44 +459,26 @@
 		
 	}
 
-	private static void installRootPublisherKeyGen(EntityManager em, String resource, String rootPartition, UddiEntityPublisher publisher) 
-		throws JAXBException, DispositionReportFaultMessage, IOException {
-		TModel apiTModel = (TModel)buildEntityFromDoc(resource, "org.uddi.api_v3");
+	private static void installRootPublisherKeyGen(EntityManager em, TModel rootTModelKeyGen, String rootPartition, UddiEntityPublisher publisher, String nodeId) 
+		throws DispositionReportFaultMessage {
 		
-		if (rootPartition != null && rootPartition.length() > 0) {
-			// A root partition was provided by the user.  Must validate it.  The first component should be a domain key and the any following
-			// tokens should be a valid KSS.
-			rootPartition = rootPartition.trim();
-			if (rootPartition.endsWith(KeyGenerator.PARTITION_SEPARATOR) || rootPartition.startsWith(KeyGenerator.PARTITION_SEPARATOR))
-				throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", rootPartition));
-			
-			StringTokenizer tokenizer = new StringTokenizer(rootPartition.toLowerCase(), KeyGenerator.PARTITION_SEPARATOR);
-			for(int count = 0; tokenizer.hasMoreTokens(); count++) {
-				String nextToken = tokenizer.nextToken();
-
-				if (count == 0) {
-					if(!ValidateUDDIKey.isValidDomainKey(nextToken))
-						throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", rootPartition));
-				}
-				else {
-					if (!ValidateUDDIKey.isValidKSS(nextToken))
-						throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", rootPartition));
-				}
-			}
-			
-			// If the user-supplied root partition checks out, we can use that as the key.
-			apiTModel.setTModelKey(KeyGenerator.UDDI_SCHEME + KeyGenerator.PARTITION_SEPARATOR + 
-					rootPartition + KeyGenerator.PARTITION_SEPARATOR + KeyGenerator.KEYGENERATOR_SUFFIX);
-		}
+		rootTModelKeyGen.setTModelKey(rootPartition + KeyGenerator.PARTITION_SEPARATOR + KeyGenerator.KEYGENERATOR_SUFFIX);
 		
-		installPublisherKeyGen(em, apiTModel, publisher);
+		installPublisherKeyGen(em, rootTModelKeyGen, publisher, nodeId);
 	}
 
-	private static void installPublisherKeyGen(EntityManager em, TModel apiTModel, UddiEntityPublisher publisher) throws DispositionReportFaultMessage {
+	private static void installPublisherKeyGen(EntityManager em, TModel apiTModel, UddiEntityPublisher publisher, String nodeId) throws DispositionReportFaultMessage {
 
 		org.apache.juddi.model.Tmodel modelTModel = new org.apache.juddi.model.Tmodel();
 		MappingApiToModel.mapTModel(apiTModel, modelTModel);
+		
 		modelTModel.setPublisher(publisher);
+
+		Date now = new Date();
+		modelTModel.setCreated(now);
+		modelTModel.setModified(now);
+		modelTModel.setModifiedIncludingChildren(now);
+		modelTModel.setNodeId(nodeId);
 		
 		em.persist(modelTModel);
 		

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java Wed Jan 14 13:41:41 2009
@@ -51,7 +51,6 @@
 				   throws DispositionReportFaultMessage {
 
 		modelBusinessEntity.setEntityKey(apiBusinessEntity.getBusinessKey());
-		modelBusinessEntity.setLastUpdate(new Date());
 		
 		mapBusinessNames(apiBusinessEntity.getName(), modelBusinessEntity.getBusinessNames(), modelBusinessEntity);
 		mapBusinessDescriptions(apiBusinessEntity.getDescription(), modelBusinessEntity.getBusinessDescrs(), modelBusinessEntity);
@@ -246,7 +245,6 @@
 
 		modelBusinessService.setBusinessEntity(modelBusinessEntity);
 		modelBusinessService.setEntityKey(apiBusinessService.getServiceKey());
-		modelBusinessService.setLastUpdate(new Date());
 		
 		mapServiceNames(apiBusinessService.getName(), modelBusinessService.getServiceNames(), modelBusinessService);
 		mapServiceDescriptions(apiBusinessService.getDescription(), modelBusinessService.getServiceDescrs(), modelBusinessService);
@@ -306,7 +304,6 @@
 
 		modelBindingTemplate.setBusinessService(modelBusinessService);
 		modelBindingTemplate.setEntityKey(apiBindingTemplate.getBindingKey());
-		modelBindingTemplate.setLastUpdate(new Date());
 		modelBindingTemplate.setAccessPointType(apiBindingTemplate.getAccessPoint().getUseType());
 		modelBindingTemplate.setAccessPointUrl(apiBindingTemplate.getAccessPoint().getValue());
 		if (apiBindingTemplate.getHostingRedirector() != null) {
@@ -459,14 +456,11 @@
 		}
 	}
 	
-	
-	
 	public static void mapTModel(org.uddi.api_v3.TModel apiTModel, 
 								 org.apache.juddi.model.Tmodel modelTModel) 
 				   throws DispositionReportFaultMessage {
 
 		modelTModel.setEntityKey(apiTModel.getTModelKey());
-		modelTModel.setLastUpdate(new Date());
 		modelTModel.setName(apiTModel.getName().getValue());
 		modelTModel.setDeleted(apiTModel.isDeleted());
 

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java Wed Jan 14 13:41:41 2009
@@ -51,13 +51,13 @@
 	public BindingTemplate() {
 	}
 
-	public BindingTemplate(String entityKey, BusinessService businessService, Date lastUpdate) {
+	public BindingTemplate(String entityKey, BusinessService businessService, Date modified) {
 		this.entityKey = entityKey;
 		this.businessService = businessService;
-		this.lastUpdate = lastUpdate;
+		this.modified = modified;
 	}
 	public BindingTemplate(String entityKey, BusinessService businessService, String accessPointType,
-			String accessPointUrl, String hostingRedirector, Date lastUpdate,
+			String accessPointUrl, String hostingRedirector, Date modified,
 			BindingCategoryBag categoryBag,
 			List<TmodelInstanceInfo> tmodelInstanceInfos,
 			List<BindingDescr> bindingDescrs) {
@@ -66,7 +66,7 @@
 		this.accessPointType = accessPointType;
 		this.accessPointUrl = accessPointUrl;
 		this.hostingRedirector = hostingRedirector;
-		this.lastUpdate = lastUpdate;
+		this.modified = modified;
 		this.categoryBag = categoryBag;
 		this.tmodelInstanceInfos = tmodelInstanceInfos;
 		this.bindingDescrs = bindingDescrs;
@@ -131,11 +131,4 @@
 	public void setBindingDescrs(List<BindingDescr> bindingDescrs) {
 		this.bindingDescrs = bindingDescrs;
 	}
-
-	public String retrieveAuthorizedName() {
-		return this.getBusinessService().getBusinessEntity().getPublisher().getAuthorizedName();
-	}
-	public void assignAuthorizedName(String id) {
-		// Do nothing, the publisher id is set in the parent.
-	}
 }

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java Wed Jan 14 13:41:41 2009
@@ -22,11 +22,10 @@
 import javax.persistence.CascadeType;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.OrderBy;
+import javax.persistence.PrimaryKeyJoinColumn;
 import javax.persistence.Table;
 
 /**
@@ -38,7 +37,6 @@
 public class BusinessEntity extends UddiEntity implements java.io.Serializable {
 
 	private static final long serialVersionUID = 1L;
-	private UddiEntityPublisher publisher;
 	private List<Contact> contacts = new ArrayList<Contact>(0);
 	private List<BusinessIdentifier> businessIdentifiers = new ArrayList<BusinessIdentifier>(0);
 	private List<PublisherAssertion> publisherAssertionsForFromKey = new ArrayList<PublisherAssertion>(0);
@@ -52,13 +50,13 @@
 	public BusinessEntity() {
 	}
 
-	public BusinessEntity(String entityKey, Date lastUpdate) {
+	public BusinessEntity(String entityKey, Date modified) {
 		this.entityKey = entityKey;
-		this.lastUpdate = lastUpdate;
+		this.modified = modified;
 	}
 	public BusinessEntity(String entityKey, String authorizedName, 
 			UddiEntityPublisher publisher, String operator,
-			Date lastUpdate, List<Contact> contacts,
+			Date modified, List<Contact> contacts,
 			List<BusinessIdentifier> businessIdentifiers,
 			List<PublisherAssertion> publisherAssertionsForFromKey,
 			List<DiscoveryUrl> discoveryUrls, List<BusinessName> businessNames,
@@ -68,7 +66,7 @@
 			List<BusinessDescr> businessDescrs) {
 		this.entityKey = entityKey;
 		this.publisher = publisher;
-		this.lastUpdate = lastUpdate;
+		this.modified = modified;
 		this.contacts = contacts;
 		this.businessIdentifiers = businessIdentifiers;
 		this.publisherAssertionsForFromKey = publisherAssertionsForFromKey;
@@ -80,15 +78,6 @@
 		this.businessDescrs = businessDescrs;
 	}
 
-	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "authorized_name", nullable = false)
-	public UddiEntityPublisher getPublisher() {
-		return this.publisher;
-	}
-	public void setPublisher(UddiEntityPublisher publisher) {
-		this.publisher = publisher;
-	}
-
 	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
 	@OrderBy
 	public List<Contact> getContacts() {
@@ -172,15 +161,5 @@
 		this.businessDescrs = businessDescrs;
 	}
 
-	public String retrieveAuthorizedName() {
-		return getPublisher().getAuthorizedName();
-	}
-	public void assignAuthorizedName(String authName) {
-		if (authName != null) {
-			Publisher pub = new Publisher();
-			pub.setAuthorizedName(authName);
-			this.setPublisher(pub);
-		}
-	}
 	
 }

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java Wed Jan 14 13:41:41 2009
@@ -47,18 +47,18 @@
 	public BusinessService() {
 	}
 
-	public BusinessService(String entityKey, BusinessEntity businessEntity, Date lastUpdate) {
+	public BusinessService(String entityKey, BusinessEntity businessEntity, Date modified) {
 		this.entityKey = entityKey;
 		this.businessEntity = businessEntity;
-		this.lastUpdate = lastUpdate;
+		this.modified = modified;
 	}
-	public BusinessService(String entityKey, BusinessEntity businessEntity, Date lastUpdate,
+	public BusinessService(String entityKey, BusinessEntity businessEntity, Date modified,
 			List<ServiceName> serviceNames, List<ServiceDescr> serviceDescrs,
 			List<BindingTemplate> bindingTemplates,
 			ServiceCategoryBag categoryBag) {
 		this.entityKey = entityKey;
 		this.businessEntity = businessEntity;
-		this.lastUpdate = lastUpdate;
+		this.modified = modified;
 		this.serviceNames = serviceNames;
 		this.serviceDescrs = serviceDescrs;
 		this.bindingTemplates = bindingTemplates;
@@ -108,12 +108,4 @@
 	public void setCategoryBag(ServiceCategoryBag categoryBag) {
 		this.categoryBag = categoryBag;
 	}
-
-	public String retrieveAuthorizedName() {
-		return this.getBusinessEntity().getPublisher().getAuthorizedName();
-	}
-	public void assignAuthorizedName(String id) {
-		// Do nothing, the publisher id is set in the parent.
-	}
-
 }

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/Tmodel.java Wed Jan 14 13:41:41 2009
@@ -23,8 +23,6 @@
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
-import javax.persistence.JoinColumn;
-import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.OrderBy;
@@ -40,7 +38,6 @@
 public class Tmodel extends UddiEntity implements java.io.Serializable {
 
 	private static final long serialVersionUID = 1L;
-	private UddiEntityPublisher publisher;
 	private String name;
 	private String langCode;
 	private boolean deleted;
@@ -52,13 +49,13 @@
 	public Tmodel() {
 	}
 
-	public Tmodel(String entityKey, String name, Date lastUpdate) {
+	public Tmodel(String entityKey, String name, Date modified) {
 		this.entityKey = entityKey;
 		this.name = name;
-		this.lastUpdate = lastUpdate;
+		this.modified = modified;
 	}
 	public Tmodel(String entityKey, String authorizedName, UddiEntityPublisher publisher, String operator,
-			String name, String langCode, boolean deleted, Date lastUpdate,
+			String name, String langCode, boolean deleted, Date modified,
 			List<OverviewDoc> overviewDocs,
 			List<TmodelDescr> tmodelDescrs,
 			List<TmodelIdentifier> tmodelIdentifiers,
@@ -68,22 +65,13 @@
 		this.name = name;
 		this.langCode = langCode;
 		this.deleted = deleted;
-		this.lastUpdate = lastUpdate;
+		this.modified = modified;
 		this.overviewDocs = overviewDocs;
 		this.tmodelDescrs = tmodelDescrs;
 		this.tmodelIdentifiers = tmodelIdentifiers;
 		this.categoryBag = categoryBag;
 	}
 
-	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "authorized_name", nullable = false)
-	public UddiEntityPublisher getPublisher() {
-		return this.publisher;
-	}
-	public void setPublisher(UddiEntityPublisher publisher) {
-		this.publisher = publisher;
-	}
-
 	@Column(name = "name", nullable = false)
 	public String getName() {
 		return this.name;
@@ -144,15 +132,4 @@
 		this.categoryBag = categoryBag;
 	}
 
-	public String retrieveAuthorizedName() {
-		return getPublisher().getAuthorizedName();
-	}
-	public void assignAuthorizedName(String authName) {
-		if (authName != null) {
-			Publisher pub = new Publisher();
-			pub.setAuthorizedName(authName);
-			this.setPublisher(pub);
-		}
-	}
-
 }

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntity.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntity.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntity.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntity.java Wed Jan 14 13:41:41 2009
@@ -18,19 +18,31 @@
 import java.util.Date;
 
 import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
 import javax.persistence.Id;
-import javax.persistence.MappedSuperclass;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 
 /**
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
  */
-@MappedSuperclass
+@Entity
+@Table(name = "uddi_entity")
+@Inheritance(strategy = InheritanceType.JOINED)
 public abstract class UddiEntity {
 
 	protected String entityKey;
-	protected Date lastUpdate;
+	protected Date created;
+	protected Date modified;
+	protected Date modifiedIncludingChildren;
+	protected String nodeId;
+	protected UddiEntityPublisher publisher;
 	
 	@Id
 	@Column(name = "entity_key", nullable = false, length = 255)
@@ -42,15 +54,47 @@
 	}
 
 	@Temporal(TemporalType.TIMESTAMP)
-	@Column(name = "last_update", nullable = false, length = 29)
-	public Date getLastUpdate() {
-		return this.lastUpdate;
+	@Column(name = "created", length = 29)
+	public Date getCreated() {
+		return created;
 	}
-	public void setLastUpdate(Date lastUpdate) {
-		this.lastUpdate = lastUpdate;
+	public void setCreated(Date created) {
+		this.created = created;
+	}
+	
+	@Temporal(TemporalType.TIMESTAMP)
+	@Column(name = "modified", nullable = false, length = 29)
+	public Date getModified() {
+		return this.modified;
+	}
+	public void setModified(Date modified) {
+		this.modified = modified;
 	}
 
-	public abstract String retrieveAuthorizedName();
-	public abstract void assignAuthorizedName(String authName);
+	@Temporal(TemporalType.TIMESTAMP)
+	@Column(name = "modified_including_children", length = 29)
+	public Date getModifiedIncludingChildren() {
+		return modifiedIncludingChildren;
+	}
+	public void setModifiedIncludingChildren(Date modifiedIncludingChildren) {
+		this.modifiedIncludingChildren = modifiedIncludingChildren;
+	}
+	
+	@Column(name = "node_id", length = 255)
+	public String getNodeId() {
+		return nodeId;
+	}
+	public void setNodeId(String nodeId) {
+		this.nodeId = nodeId;
+	}
+	
+	@ManyToOne(fetch = FetchType.LAZY)
+	@JoinColumn(name = "authorized_name", nullable = false)
+	public UddiEntityPublisher getPublisher() {
+		return this.publisher;
+	}
+	public void setPublisher(UddiEntityPublisher publisher) {
+		this.publisher = publisher;
+	}
 
 }

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntityPublisher.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntityPublisher.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntityPublisher.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/model/UddiEntityPublisher.java Wed Jan 14 13:41:41 2009
@@ -91,7 +91,7 @@
 	public boolean isOwner(UddiEntity entity){
 		boolean ret = false;
 		if (entity != null) {
-			if (entity.retrieveAuthorizedName().equals(this.authorizedName))
+			if (entity.getPublisher().getAuthorizedName().equals(this.authorizedName))
 				ret = true;
 		}
 		return ret;

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBindingTemplatesQuery.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBindingTemplatesQuery.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBindingTemplatesQuery.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBindingTemplatesQuery.java Wed Jan 14 13:41:41 2009
@@ -79,9 +79,9 @@
 		qry.ORDERBY().pad();
 		
 		if (fq.isSortByDateAsc())
-			qry.append(ENTITY_ALIAS + ".lastUpdate").pad().append(DynamicQuery.SORT_ASC);
+			qry.append(ENTITY_ALIAS + ".modified").pad().append(DynamicQuery.SORT_ASC);
 		else
-			qry.append(ENTITY_ALIAS + ".lastUpdate").pad().append(DynamicQuery.SORT_DESC);
+			qry.append(ENTITY_ALIAS + ".modified").pad().append(DynamicQuery.SORT_DESC);
 		
 		qry.pad();
 		

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessEntitiesQuery.java Wed Jan 14 13:41:41 2009
@@ -83,7 +83,7 @@
 		if (fq.isCaseInsensitiveSort())
 			nameTerm = "upper(" + nameTerm + ")";
 		
-		String dateTerm = ENTITY_ALIAS + ".lastUpdate";
+		String dateTerm = ENTITY_ALIAS + ".modified";
 
 		String orderClause = nameTerm + " " + DynamicQuery.SORT_ASC + ", " + dateTerm + " " + DynamicQuery.SORT_DESC;
 		if (fq.isSortByNameAsc()) {

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchBusinessServicesQuery.java Wed Jan 14 13:41:41 2009
@@ -83,7 +83,7 @@
 		if (fq.isCaseInsensitiveSort())
 			nameTerm = "upper(" + nameTerm + ")";
 		
-		String dateTerm = ENTITY_ALIAS + ".lastUpdate";
+		String dateTerm = ENTITY_ALIAS + ".modified";
 
 		String orderClause = nameTerm + " " + DynamicQuery.SORT_ASC + ", " + dateTerm + " " + DynamicQuery.SORT_DESC;
 		if (fq.isSortByNameAsc()) {

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchTModelsQuery.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchTModelsQuery.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchTModelsQuery.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/query/FetchTModelsQuery.java Wed Jan 14 13:41:41 2009
@@ -81,7 +81,7 @@
 		if (fq.isCaseInsensitiveSort())
 			nameTerm = "upper(" + nameTerm + ")";
 		
-		String dateTerm = ENTITY_ALIAS + ".lastUpdate";
+		String dateTerm = ENTITY_ALIAS + ".modified";
 
 		String orderClause = nameTerm + " " + DynamicQuery.SORT_ASC + ", " + dateTerm + " " + DynamicQuery.SORT_DESC;
 		if (fq.isSortByNameAsc()) {

Modified: webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java
URL: http://svn.apache.org/viewvc/webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java?rev=734522&r1=734521&r2=734522&view=diff
==============================================================================
--- webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java (original)
+++ webservices/juddi/branches/v3_trunk/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java Wed Jan 14 13:41:41 2009
@@ -343,9 +343,9 @@
 		}
 
 		if (!entityExists) {
-			// TODO: Check to make sure key isn't used by another entity.  If exists in operation info then it is.
-			//if (em.find(OperationalInfo.class, entityKey) != null)
-			//throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
+			// Check to make sure key isn't used by another entity.
+			if (em.find(UddiEntity.class, entityKey) != null)
+				throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
 		}
 		
 		// TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
@@ -485,9 +485,9 @@
 			}
 
 			if (!entityExists) {
-				// TODO: Check to make sure key isn't used by another entity.  If exists in operation info then it is.
-				//if (em.find(OperationalInfo.class, entityKey) != null)
-				//throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
+				// Check to make sure key isn't used by another entity.
+				if (em.find(UddiEntity.class, entityKey) != null)
+					throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
 			}
 			
 			// TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
@@ -604,9 +604,9 @@
 		}
 
 		if (!entityExists) {
-			// TODO: Check to make sure key isn't used by another entity.  If exists in operation info then it is.
-			//if (em.find(OperationalInfo.class, entityKey) != null)
-			//throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
+			// Check to make sure key isn't used by another entity.
+			if (em.find(UddiEntity.class, entityKey) != null)
+				throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
 		}
 		
 		// TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
@@ -634,7 +634,7 @@
 			tModel.setTModelKey(entityKey);
 		}
 		else {
-			Object obj = em.find(org.apache.juddi.model.BusinessEntity.class, entityKey);
+			Object obj = em.find(org.apache.juddi.model.Tmodel.class, entityKey);
 			if (obj != null) {
 				entityExists = true;
 
@@ -673,9 +673,9 @@
 		}
 
 		if (!entityExists) {
-			// TODO: Check to make sure key isn't used by another entity.  If exists in operation info then it is.
-			//if (em.find(OperationalInfo.class, entityKey) != null)
-			//throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
+			// Check to make sure key isn't used by another entity.
+			if (em.find(UddiEntity.class, entityKey) != null)
+				throw new KeyUnavailableException(new ErrorMessage("errors.keyunavailable.KeyExists", entityKey));
 		}
 		
 		// TODO: validate "checked" categories or category groups (see section 5.2.3 of spec)? optional to support
@@ -918,7 +918,7 @@
 	 Publisher functions are specific to jUDDI.
 	 --------------------------------------------------------------------*/
 	
-	public void validateDeletePublisher(EntityManager em, Publisher publisher, DeletePublisher body) throws DispositionReportFaultMessage {
+	public void validateDeletePublisher(EntityManager em, DeletePublisher body) throws DispositionReportFaultMessage {
 
 		// No null input
 		if (body == null)
@@ -929,7 +929,7 @@
 		if (entityKeyList == null || entityKeyList.size() == 0)
 			throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
 		
-		if (!publisher.isAdmin())
+		if (!((Publisher)publisher).isAdmin())
 			throw new UserMismatchException(new ErrorMessage("errors.deletepublisher.AdminReqd"));
 
 		HashSet<String> dupCheck = new HashSet<String>();
@@ -945,7 +945,7 @@
 		}
 	}
 
-	public void validateSavePublisher(EntityManager em, Publisher publisher, SavePublisher body) throws DispositionReportFaultMessage {
+	public void validateSavePublisher(EntityManager em, SavePublisher body) throws DispositionReportFaultMessage {
 
 		// No null input
 		if (body == null)
@@ -956,7 +956,7 @@
 		if (entityList == null || entityList.size() == 0)
 			throw new ValueNotAllowedException(new ErrorMessage("errors.savepublisher.NoInput"));
 		
-		if (!publisher.isAdmin())
+		if (!((Publisher)publisher).isAdmin())
 			throw new UserMismatchException(new ErrorMessage("errors.savepublisher.AdminReqd"));
 		
 		for (org.apache.juddi.api.datatype.Publisher entity : entityList) {



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