juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ks...@apache.org
Subject svn commit: r1410551 [2/3] - in /juddi/trunk: docs/db/ddl/ docs/devguide/en-US/extras/ docs/userguide/ docs/userguide/en-US/extras/ juddi-core/src/main/java/org/apache/juddi/mapping/ juddi-core/src/main/java/org/apache/juddi/model/ juddi-core/src/main/...
Date Fri, 16 Nov 2012 19:46:33 GMT
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java?rev=1410551&r1=1410550&r2=1410551&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java Fri Nov 16 19:46:28 2012
@@ -17,20 +17,54 @@
 
 package org.apache.juddi.mapping;
 
+import java.io.StringWriter;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.List;
+import javax.xml.bind.JAXB;
+import javax.xml.bind.JAXBElement;
+import javax.xml.transform.dom.DOMResult;
 
-import javax.xml.bind.JAXBException;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.juddi.jaxb.JAXBMarshaller;
-import org.apache.juddi.v3.error.ErrorMessage;
-import org.apache.juddi.v3.error.FatalErrorException;
+import org.apache.juddi.model.BindingTemplate;
+import org.apache.juddi.model.BusinessService;
+import org.apache.juddi.model.CanonicalizationMethod;
+import org.apache.juddi.model.KeyInfo;
+import org.apache.juddi.model.Publisher;
+import org.apache.juddi.model.Reference;
+import org.apache.juddi.model.Signature;
+import org.apache.juddi.model.SignatureMethod;
+import org.apache.juddi.model.SignatureTransform;
+import org.apache.juddi.model.SignatureValue;
+import org.apache.juddi.model.SignedInfo;
+import org.apache.juddi.model.Tmodel;
+import org.apache.juddi.model.KeyDataValue;
+import org.apache.juddi.model.SignatureTransformDataValue;
 import org.uddi.api_v3.Description;
 import org.uddi.sub_v3.ObjectFactory;
 import org.uddi.v3_service.DispositionReportFaultMessage;
+import org.w3._2000._09.xmldsig_.DSAKeyValueType;
+import org.w3._2000._09.xmldsig_.KeyValueType;
+import org.w3._2000._09.xmldsig_.PGPDataType;
+import org.w3._2000._09.xmldsig_.RSAKeyValueType;
+import org.w3._2000._09.xmldsig_.ReferenceType;
+import org.w3._2000._09.xmldsig_.RetrievalMethodType;
+import org.w3._2000._09.xmldsig_.SPKIDataType;
+import org.w3._2000._09.xmldsig_.TransformType;
+import org.w3._2000._09.xmldsig_.TransformsType;
+import org.w3._2000._09.xmldsig_.X509DataType;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSException;
+import org.w3c.dom.ls.LSSerializer;
 
 
 /**
@@ -55,6 +89,7 @@ public class MappingApiToModel {
 		modelPublisher.setMaxBusinesses(apiPublisher.getMaxBusinesses());
 		modelPublisher.setMaxServicesPerBusiness(apiPublisher.getMaxServicePerBusiness());
 		modelPublisher.setMaxTmodels(apiPublisher.getMaxTModels());
+                mapPublisherSignatures(apiPublisher.getSignature(), modelPublisher);
 	}
 	
 	public static void mapBusinessEntity(org.uddi.api_v3.BusinessEntity apiBusinessEntity, 
@@ -77,8 +112,145 @@ public class MappingApiToModel {
 							modelBusinessEntity.getBusinessServices(), 
 							modelBusinessEntity.getServiceProjections(), 
 							modelBusinessEntity);
+                
+                mapBusinessSignature(apiBusinessEntity.getSignature(), modelBusinessEntity);
 	}
-	
+        
+        private static List<Signature> mapApiSignaturesToModelSignatures(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures) 
+				   throws DispositionReportFaultMessage {
+            List<Signature> modelSignatures = new ArrayList<Signature>();
+            modelSignatures.clear();
+            for (org.w3._2000._09.xmldsig_.SignatureType signatureType : apiSignatures) {
+                Signature modelSignature = new Signature();
+                
+                org.w3._2000._09.xmldsig_.SignedInfoType apiSignedInfo = signatureType.getSignedInfo();
+                SignedInfo modelSignedInfo = new SignedInfo();
+                modelSignature.setSignedInfo(modelSignedInfo);
+                
+                String canonicalizationAlgMethod = apiSignedInfo.getCanonicalizationMethod().getAlgorithm();
+                CanonicalizationMethod modelCanonMethod = new CanonicalizationMethod();
+                modelSignedInfo.setCanonicalizationMethod(modelCanonMethod);
+                modelCanonMethod.setAlgorithm(canonicalizationAlgMethod);
+                
+                SignatureMethod modelSigMethod = new SignatureMethod();
+                modelSignedInfo.setSignatureMethod(modelSigMethod);
+                String sigMethod = apiSignedInfo.getSignatureMethod().getAlgorithm();
+                modelSigMethod.setAlgorithm(sigMethod);
+                
+                List<org.w3._2000._09.xmldsig_.ReferenceType> apiReferenceList = apiSignedInfo.getReference();
+                for (org.w3._2000._09.xmldsig_.ReferenceType apiReference : apiReferenceList) {
+                    Reference ref = mapReference(modelSignedInfo, apiReference);
+                    modelSignedInfo.getReference().add(ref);
+                }
+                
+                modelSignedInfo.setCanonicalizationMethod(modelCanonMethod);
+                
+                org.w3._2000._09.xmldsig_.SignatureValueType apiSignatureValue = signatureType.getSignatureValue();
+                SignatureValue modelSignatureValue = new SignatureValue();
+                byte[] signatureValueBytes = apiSignatureValue.getValue();
+                String signatureValueXmlID = apiSignatureValue.getId();
+                modelSignatureValue.setValue(signatureValueBytes);
+                modelSignatureValue.setXmlID(signatureValueXmlID);
+                modelSignature.setSignatureValue(modelSignatureValue);
+                
+                org.w3._2000._09.xmldsig_.KeyInfoType apiKeyInfo = signatureType.getKeyInfo();
+                String apiKeyInfoXmlID = apiKeyInfo.getId();
+                KeyInfo modelKeyInfo = new KeyInfo();
+                modelSignature.setKeyInfo(modelKeyInfo);
+                modelKeyInfo.setXmlID(apiKeyInfoXmlID);
+                
+                List<Object> apiKeyInfoContentList = apiKeyInfo.getContent();
+                List<KeyDataValue> keyInfoDataValues = modelKeyInfo.getKeyDataValue();
+                for (Object apiKeyInfoContentObj : apiKeyInfoContentList) {
+                    if (apiKeyInfoContentObj instanceof JAXBElement) {
+                        JAXBElement apiKeyInfoContentJAXB = (JAXBElement)apiKeyInfoContentObj;
+                        String apiKeyInfoContentTagName = apiKeyInfoContentJAXB.getName().getLocalPart();
+                        if (apiKeyInfoContentJAXB.getValue() instanceof X509DataType) {
+                            KeyDataValue modelX509KeyData = mapX509DataType(apiKeyInfoContentJAXB, modelKeyInfo);
+                            keyInfoDataValues.add(modelX509KeyData);
+                        } else if (apiKeyInfoContentTagName.equals("KeyName")) {
+                            KeyDataValue modelKeyNameKDV = mapKeyName(apiKeyInfoContentJAXB);
+                            modelKeyNameKDV.setKeyInfo(modelKeyInfo);
+                            keyInfoDataValues.add(modelKeyNameKDV);
+                        } else if (apiKeyInfoContentTagName.equals("KeyValue")) {
+                            KeyDataValue modelKeyValueKDV = mapKeyValue(apiKeyInfoContentJAXB, keyInfoDataValues);
+                            modelKeyValueKDV.setKeyInfo(modelKeyInfo);
+                            keyInfoDataValues.add(modelKeyValueKDV);
+                        } else if (apiKeyInfoContentTagName.equals("MgmtData")) {
+                            KeyDataValue modelKeyValueKDV = new KeyDataValue();
+                            modelKeyValueKDV.setKeyDataName(apiKeyInfoContentTagName);
+                            modelKeyValueKDV.setKeyDataType("String");
+                            modelKeyValueKDV.setKeyDataValueString((String)apiKeyInfoContentJAXB.getValue());
+                            modelKeyValueKDV.setKeyInfo(modelKeyInfo);
+                            keyInfoDataValues.add(modelKeyValueKDV);
+                        } else if (apiKeyInfoContentTagName.equals("RetrievalMethod")) {
+                            RetrievalMethodType retrievalMethodType = (RetrievalMethodType)apiKeyInfoContentJAXB.getValue();
+                            KeyDataValue retrievalMethodTypeKDV = mapRetrievalMethod(apiKeyInfoContentTagName, modelKeyInfo, retrievalMethodType);
+                            keyInfoDataValues.add(retrievalMethodTypeKDV);
+                        } else if (apiKeyInfoContentTagName.equals("PGPData")) {
+                            PGPDataType pgpDataType = (PGPDataType)apiKeyInfoContentJAXB.getValue();
+                            KeyDataValue pgpDataTypeKDV = mapPGPDataType(apiKeyInfoContentTagName, modelKeyInfo, pgpDataType);
+                            keyInfoDataValues.add(pgpDataTypeKDV);
+                        } else if (apiKeyInfoContentTagName.equals("SPKIData")) {
+                            SPKIDataType spkiDataType = (SPKIDataType)apiKeyInfoContentJAXB.getValue();
+                            KeyDataValue spkiDataTypeKDV = mapSPKIDataType(apiKeyInfoContentTagName, modelKeyInfo, spkiDataType);
+                            keyInfoDataValues.add(spkiDataTypeKDV);
+                        } else {
+                            throw new RuntimeException("Unrecognized tag: " + apiKeyInfoContentTagName + " type: " + apiKeyInfoContentJAXB.getValue().getClass().getCanonicalName());
+                        }
+                    }
+                }
+                
+                modelSignatures.add(modelSignature);
+            }
+            return modelSignatures;
+        }
+        
+        public static void mapBusinessServiceSignature (List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures, BusinessService modelBusinessService)
+				   throws DispositionReportFaultMessage {
+            List<Signature> modelSignatures = mapApiSignaturesToModelSignatures(apiSignatures);
+            for (Signature modelSignature : modelSignatures) {
+                modelSignature.setBusinessService(modelBusinessService);
+            }
+            modelBusinessService.setSignatures(modelSignatures);
+        }
+        
+        public static void mapTmodelSignatures(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures, Tmodel modelTmodel)
+				   throws DispositionReportFaultMessage {
+            List<Signature> modelSignatures = mapApiSignaturesToModelSignatures(apiSignatures);
+            for (Signature modelSignature : modelSignatures) {
+                modelSignature.setTmodel(modelTmodel);
+            }
+            modelTmodel.setSignatures(modelSignatures);
+        }
+        
+        public static void mapBindingTemplateSignatures(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures, BindingTemplate modelBindingTemplate)
+				   throws DispositionReportFaultMessage {
+            List<Signature> modelSignatures = mapApiSignaturesToModelSignatures(apiSignatures);
+            for (Signature modelSignature : modelSignatures) {
+                modelSignature.setBindingTemplate(modelBindingTemplate);
+            }
+            modelBindingTemplate.setSignatures(modelSignatures);
+        }
+        
+        public static void mapPublisherSignatures(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures, Publisher modelPublisher)
+				   throws DispositionReportFaultMessage {
+            List<Signature> modelSignatures = mapApiSignaturesToModelSignatures(apiSignatures);
+            for (Signature modelSignature : modelSignatures) {
+                modelSignature.setPublisher(modelPublisher);
+            }
+            modelPublisher.setSignatures(modelSignatures);
+        }
+        
+        public static void mapBusinessSignature(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures, 
+										 org.apache.juddi.model.BusinessEntity modelBusinessEntity)
+				   throws DispositionReportFaultMessage {
+            List<Signature> modelSignatures = mapApiSignaturesToModelSignatures(apiSignatures);
+            for (Signature modelSignature : modelSignatures) {
+                modelSignature.setBusinessEntity(modelBusinessEntity);
+            }
+            modelBusinessEntity.setSignatures(modelSignatures);
+        }	
 
 	public static void mapBusinessNames(List<org.uddi.api_v3.Name> apiNameList, 
 										List<org.apache.juddi.model.BusinessName> modelNameList,
@@ -278,10 +450,8 @@ public class MappingApiToModel {
 		}
 		
 		mapBindingTemplates(apiBusinessService.getBindingTemplates(), modelBusinessService.getBindingTemplates(), modelBusinessService);
-
+                mapBusinessServiceSignature(apiBusinessService.getSignature(), modelBusinessService);
 	}
-
-	
 	
 	public static void mapServiceNames(List<org.uddi.api_v3.Name> apiNameList, 
 									   List<org.apache.juddi.model.ServiceName> modelNameList,
@@ -342,6 +512,7 @@ public class MappingApiToModel {
 			mapCategoryBag(apiBindingTemplate.getCategoryBag(), modelBindingTemplate.getCategoryBag());
 		}
 		mapTModelInstanceDetails(apiBindingTemplate.getTModelInstanceDetails(), modelBindingTemplate.getTmodelInstanceInfos(), modelBindingTemplate);
+                mapBindingTemplateSignatures(apiBindingTemplate.getSignature(), modelBindingTemplate);
 	}
 	
 	public static void mapBindingDescriptions(List<org.uddi.api_v3.Description> apiDescList, 
@@ -501,6 +672,7 @@ public class MappingApiToModel {
 			mapCategoryBag(apiTModel.getCategoryBag(), modelTModel.getCategoryBag());
 		}
 		mapTModelOverviewDocs(apiTModel.getOverviewDoc(), modelTModel.getOverviewDocs(), modelTModel);
+                mapTmodelSignatures(apiTModel.getSignature(), modelTModel);
 	}
 
 	public static void mapTModelDescriptions(List<org.uddi.api_v3.Description> apiDescList, 
@@ -641,6 +813,275 @@ public class MappingApiToModel {
 			modelNode.setFactoryURLPkgs(apiNode.getFactoryURLPkgs());
 		}
 	}
-	
+
+        private static Reference mapReference(SignedInfo modelSignedInfo, ReferenceType apiReference) {
+            Reference ref = new Reference();
+            ref.setSignedInfo(modelSignedInfo);
+            String refUri = apiReference.getURI();
+            if (refUri == null) {
+                refUri = "";
+            }
+            ref.setUri(refUri);
+            List<org.w3._2000._09.xmldsig_.TransformType> apiTransformList = apiReference.getTransforms().getTransform();
+            for (org.w3._2000._09.xmldsig_.TransformType apiTransform : apiTransformList) {
+                SignatureTransform modelTransform = new SignatureTransform();
+                modelTransform.setReference(ref);
+                modelTransform.setTransform(apiTransform.getAlgorithm());
+
+                for (Object xform : apiTransform.getContent()) {
+                    SignatureTransformDataValue sdv = mapSignatureTransformDataValue(xform);
+                    sdv.setSignatureTransform(modelTransform);
+                    modelTransform.getSignatureTransformDataValue().add(sdv);
+                }
+
+                ref.getTransforms().add(modelTransform);
+            }
+            String digestMethodStr = apiReference.getDigestMethod().getAlgorithm();
+            byte[] digestValueBytes = apiReference.getDigestValue();
+            ref.setDigestMethod(digestMethodStr);
+            ref.setDigestValue(digestValueBytes);
+            return ref;
+        }
+
+    private static KeyDataValue mapX509DataType(JAXBElement apiKeyInfoContentJAXB, KeyInfo modelKeyInfo) throws RuntimeException {
+        X509DataType apiKeyInfoContent = (X509DataType)apiKeyInfoContentJAXB.getValue();
+        KeyDataValue modelX509KeyData = new KeyDataValue();
+        modelX509KeyData.setKeyDataType(X509DataType.class.getSimpleName());
+        modelX509KeyData.setKeyDataName(apiKeyInfoContentJAXB.getName().getLocalPart());
+        modelX509KeyData.setKeyInfo(modelKeyInfo);
+        List<Object> x509IssuerSerialOrX509SKIOrX509SubjectNameList = apiKeyInfoContent.getX509IssuerSerialOrX509SKIOrX509SubjectName();
+        for (Object x509IssuerSerialOrX509SKIOrX509SubjectNameObj : x509IssuerSerialOrX509SKIOrX509SubjectNameList) {
+            JAXBElement x509IssuerSerialOrX509SKIOrX509SubjectNameJAXB = (JAXBElement)x509IssuerSerialOrX509SKIOrX509SubjectNameObj;
+            String tagName = x509IssuerSerialOrX509SKIOrX509SubjectNameJAXB.getName().getLocalPart();
+            Object x509IssuerSerialOrX509SKIOrX509SubjectName = x509IssuerSerialOrX509SKIOrX509SubjectNameJAXB.getValue();
+            
+            KeyDataValue modelKeyInfoValue = new KeyDataValue();
+            modelKeyInfoValue.setKeyDataName(tagName);
+            if (x509IssuerSerialOrX509SKIOrX509SubjectName instanceof byte[]) {
+                modelKeyInfoValue.setKeyDataValueBytes((byte[])x509IssuerSerialOrX509SKIOrX509SubjectName);
+            } else if (x509IssuerSerialOrX509SKIOrX509SubjectName instanceof String) {
+                modelKeyInfoValue.setKeyDataValueString((String)x509IssuerSerialOrX509SKIOrX509SubjectName);
+            } else if (x509IssuerSerialOrX509SKIOrX509SubjectName != null) {
+                throw new RuntimeException("Unrecognized Value for Element: " + tagName + ": " + x509IssuerSerialOrX509SKIOrX509SubjectName.getClass().getCanonicalName());
+            }
+            modelKeyInfoValue.setKeyDataValue(modelX509KeyData);
+            modelX509KeyData.getKeyDataValueList().add(modelKeyInfoValue);
+        }
+        return modelX509KeyData;
+    }
+
+    private static KeyDataValue mapKeyName(JAXBElement apiKeyInfoContentJAXB) {
+        KeyDataValue modelKeyNameKDV = new KeyDataValue();
+        modelKeyNameKDV.setKeyDataType(String.class.getSimpleName());
+        modelKeyNameKDV.setKeyDataName(apiKeyInfoContentJAXB.getName().getLocalPart());
+        modelKeyNameKDV.setKeyDataValueString((String)apiKeyInfoContentJAXB.getValue());
+        return modelKeyNameKDV;
+    }
+
+    private static KeyDataValue mapKeyValue(JAXBElement apiKeyInfoContentJAXB, List<KeyDataValue> keyInfoDataValues) {
+        KeyValueType kvt = (KeyValueType)apiKeyInfoContentJAXB.getValue();
+        KeyDataValue modelKeyValueKDV = new KeyDataValue();
+        modelKeyValueKDV.setKeyDataType(KeyValueType.class.getSimpleName());
+        modelKeyValueKDV.setKeyDataName(apiKeyInfoContentJAXB.getName().getLocalPart());
+        keyInfoDataValues.add(modelKeyValueKDV);
+        List<Object> kvObjList = kvt.getContent();
+        for (Object kvObj : kvObjList) {
+            if (kvObj instanceof JAXBElement) {
+                JAXBElement kvJAXB = (JAXBElement)kvObj;
+                Object childVal = kvJAXB.getValue();
+
+                KeyDataValue childKDV = new KeyDataValue();
+                childKDV.setKeyDataValue(modelKeyValueKDV);
+                childKDV.setKeyDataName(kvJAXB.getName().getLocalPart());
+                childKDV.setKeyDataType(childVal.getClass().getSimpleName());
+                modelKeyValueKDV.getKeyDataValueList().add(childKDV);
+
+                if (childVal instanceof DSAKeyValueType) {
+                    DSAKeyValueType dsaKeyVal = (DSAKeyValueType)childVal;
+                    String dsaKeyValueTagName = kvJAXB.getName().getLocalPart();
+                    KeyDataValue dsaKeyValKDV = new KeyDataValue(null, DSAKeyValueType.class.getSimpleName(), dsaKeyValueTagName, null, null, childKDV);
+                    childKDV.getKeyDataValueList().add(dsaKeyValKDV);
+
+                    KeyDataValue gValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "G", dsaKeyVal.getG(), null, dsaKeyValKDV);
+                    dsaKeyValKDV.getKeyDataValueList().add(gValKDV);
+
+                    KeyDataValue jValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "J", dsaKeyVal.getJ(), null, dsaKeyValKDV);
+                    dsaKeyValKDV.getKeyDataValueList().add(jValKDV);
+
+                    KeyDataValue pValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "P", dsaKeyVal.getP(), null, dsaKeyValKDV);
+                    dsaKeyValKDV.getKeyDataValueList().add(pValKDV);
+
+                    KeyDataValue pGenCounterValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "PgenCounter", dsaKeyVal.getPgenCounter(), null, dsaKeyValKDV);
+                    dsaKeyValKDV.getKeyDataValueList().add(pGenCounterValKDV);
+
+                    KeyDataValue qValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Q", dsaKeyVal.getQ(), null, dsaKeyValKDV);
+                    dsaKeyValKDV.getKeyDataValueList().add(qValKDV);
+
+                    KeyDataValue seedValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Seed", dsaKeyVal.getSeed(), null, dsaKeyValKDV);
+                    dsaKeyValKDV.getKeyDataValueList().add(seedValKDV);
+
+                    KeyDataValue yValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Y", dsaKeyVal.getY(), null, dsaKeyValKDV);
+                    dsaKeyValKDV.getKeyDataValueList().add(yValKDV);
+                } else if (childVal instanceof RSAKeyValueType) {
+                    RSAKeyValueType rsaKeyVal = (RSAKeyValueType)childVal;
+                    String rsaKeyValueTagName = kvJAXB.getName().getLocalPart();
+                    KeyDataValue rsaKeyValKDV = new KeyDataValue(null, RSAKeyValueType.class.getSimpleName(), rsaKeyValueTagName, null, null, childKDV);
+                    childKDV.getKeyDataValueList().add(rsaKeyValKDV);
+
+                    KeyDataValue exponentValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Exponent", rsaKeyVal.getExponent(), null, rsaKeyValKDV);
+                    rsaKeyValKDV.getKeyDataValueList().add(exponentValKDV);
+                    
+                    KeyDataValue modulusValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Modulus", rsaKeyVal.getModulus(), null, rsaKeyValKDV);
+                    rsaKeyValKDV.getKeyDataValueList().add(modulusValKDV);
+                }
+            }
+        }
+        return modelKeyValueKDV;
+    }
+
+    private static KeyDataValue mapRetrievalMethod(String apiKeyInfoContentTagName, KeyInfo modelKeyInfo, RetrievalMethodType retrievalMethodType) {
+        KeyDataValue retrievalMethodTypeKDV = new KeyDataValue();
+        retrievalMethodTypeKDV.setKeyDataName(apiKeyInfoContentTagName);
+        retrievalMethodTypeKDV.setKeyDataType(RetrievalMethodType.class.getSimpleName());
+        retrievalMethodTypeKDV.setKeyInfo(modelKeyInfo);
+        KeyDataValue uriKDV = new KeyDataValue();
+        uriKDV.setKeyDataName("URI");
+        uriKDV.setKeyDataType(String.class.getSimpleName());
+        uriKDV.setKeyDataValue(retrievalMethodTypeKDV);
+        uriKDV.setKeyDataValueString(retrievalMethodType.getURI());
+        retrievalMethodTypeKDV.getKeyDataValueList().add(uriKDV);
+        KeyDataValue typeKDV = new KeyDataValue();
+        typeKDV.setKeyDataName("Type");
+        typeKDV.setKeyDataType(String.class.getSimpleName());
+        typeKDV.setKeyDataValue(retrievalMethodTypeKDV);
+        typeKDV.setKeyDataValueString(retrievalMethodType.getType());
+        retrievalMethodTypeKDV.getKeyDataValueList().add(typeKDV);
+        TransformsType transformsType = retrievalMethodType.getTransforms();
+        if (transformsType != null) {
+            List<TransformType> tTypeList = transformsType.getTransform();
+            for (TransformType tType : tTypeList) {
+                KeyDataValue transformKDV = new KeyDataValue();
+                transformKDV.setKeyDataName("Transform");
+                transformKDV.setKeyDataType(String.class.getSimpleName());
+                transformKDV.setKeyDataValue(retrievalMethodTypeKDV);
+                transformKDV.setKeyDataValueString(tType.getAlgorithm());
+                
+                for (Object xform : tType.getContent()) {
+                    SignatureTransformDataValue stdv = mapSignatureTransformDataValue(xform);
+                    KeyDataValue transformContentKDV = new KeyDataValue();
+                    transformContentKDV.setKeyDataType(stdv.getContentType());
+                    transformContentKDV.setKeyDataValueBytes(stdv.getContentBytes());
+                    transformContentKDV.setKeyDataValue(transformKDV);
+                    transformKDV.getKeyDataValueList().add(transformContentKDV);
+                }
+                
+                retrievalMethodTypeKDV.getKeyDataValueList().add(transformKDV);
+            }
+        }
+        return retrievalMethodTypeKDV;
+    }
+
+    private static KeyDataValue mapPGPDataType(String apiKeyInfoContentTagName, KeyInfo modelKeyInfo, PGPDataType pgpDataType) {
+        KeyDataValue pgpDataTypeKDV = new KeyDataValue();
+        pgpDataTypeKDV.setKeyDataName(apiKeyInfoContentTagName);
+        pgpDataTypeKDV.setKeyDataType(PGPDataType.class.getSimpleName());
+        pgpDataTypeKDV.setKeyInfo(modelKeyInfo);
+        
+        List<Object> pgpDataValues = pgpDataType.getContent();
+        for (Object pgpDataValue : pgpDataValues) {
+            if (pgpDataValue instanceof JAXBElement) {
+                JAXBElement pgpDataJAXB = (JAXBElement)pgpDataValue;
+                String tagName = pgpDataJAXB.getName().getLocalPart();
+                
+                KeyDataValue keyIDKDV = new KeyDataValue();
+                keyIDKDV.setKeyDataName(tagName);
+                keyIDKDV.setKeyDataValue(pgpDataTypeKDV);
+                if (pgpDataJAXB.getValue() instanceof String) {
+                    keyIDKDV.setKeyDataValueString((String)pgpDataJAXB.getValue());
+                } else {
+                    keyIDKDV.setKeyDataValueBytes((byte[])pgpDataJAXB.getValue());
+                }
+                pgpDataTypeKDV.getKeyDataValueList().add(keyIDKDV);
+            }
+        }
+        return pgpDataTypeKDV;
+    }
+    
+    private static KeyDataValue mapSPKIDataType(String apiKeyInfoContentTagName, KeyInfo modelKeyInfo, SPKIDataType spkiDataType) {
+        KeyDataValue spkiDataTypeKDV = new KeyDataValue();
+        spkiDataTypeKDV.setKeyDataName(apiKeyInfoContentTagName);
+        spkiDataTypeKDV.setKeyDataType(SPKIDataType.class.getSimpleName());
+        spkiDataTypeKDV.setKeyInfo(modelKeyInfo);
+        
+        List<Object> spkiDataValues = spkiDataType.getSPKISexpAndAny();
+        for (Object spkiDataValue : spkiDataValues) {
+            if (spkiDataValue instanceof JAXBElement) {
+                JAXBElement spkiDataJAXB = (JAXBElement)spkiDataValue;
+                String tagName = spkiDataJAXB.getName().getLocalPart();
+                
+                KeyDataValue keyIDKDV = new KeyDataValue();
+                keyIDKDV.setKeyDataName(tagName);
+                keyIDKDV.setKeyDataValue(spkiDataTypeKDV);
+                if (spkiDataJAXB.getValue() instanceof String) {
+                    keyIDKDV.setKeyDataValueString((String)spkiDataJAXB.getValue());
+                } else {
+                    keyIDKDV.setKeyDataValueBytes((byte[])spkiDataJAXB.getValue());
+                }
+                spkiDataTypeKDV.getKeyDataValueList().add(keyIDKDV);
+            } else {
+                throw new RuntimeException("Unrecognized type: " + spkiDataValue.getClass().getCanonicalName());
+            }
+        }
+        return spkiDataTypeKDV;
+    }
+
+    private static SignatureTransformDataValue mapSignatureTransformDataValue(Object xform) {
+        SignatureTransformDataValue sdv = new SignatureTransformDataValue();
+        if (xform instanceof String) {
+            sdv.setContentType(String.class.getSimpleName());
+            String xformStr = xform.toString();
+            byte[] xformBytes = xformStr.getBytes();
+            sdv.setContentBytes(xformBytes);
+        } else if (xform instanceof Element) {
+            sdv.setContentType(Element.class.getCanonicalName());
+            Element xformEl = (Element)xform;
+            String str = serializeTransformElement(xformEl);
+            try {
+                sdv.setContentBytes(str.getBytes("UTF-8"));
+            } catch (Exception e) {
+                throw new RuntimeException("Failed to encode string due to: " + e.getMessage(), e);
+            }
+        } else if (xform instanceof byte[]) {
+            sdv.setContentType(byte[].class.getSimpleName());
+            sdv.setContentBytes((byte[])xform);
+        } else if (xform instanceof JAXBElement) {
+            sdv.setContentType(Element.class.getCanonicalName());
+            JAXBElement xformJAXB = (JAXBElement)xform;
+            DOMResult domResult = new DOMResult();
+            JAXB.marshal(xformJAXB, domResult);
+            Element xformEl = ((Document)domResult.getNode()).getDocumentElement();
+            String str = serializeTransformElement(xformEl);
+            try {
+                sdv.setContentBytes(str.getBytes("UTF-8"));
+            } catch (Exception e) {
+                throw new RuntimeException("Failed to encode string due to: " + e.getMessage(), e);
+            }
+        } else {
+            throw new RuntimeException("Unrecognized type: " + xform.getClass().getCanonicalName());
+        }
+        return sdv;
+    }
+
+    private static String serializeTransformElement(Element xformEl) throws DOMException, LSException {
+        Document document = xformEl.getOwnerDocument();
+        DOMImplementationLS domImplLS = (DOMImplementationLS)document.getImplementation();
+        LSSerializer serializer = domImplLS.createLSSerializer();
+//        serializer.getDomConfig().setParameter("namespaces", true);
+//        serializer.getDomConfig().setParameter("namespace-declarations", true);
+        serializer.getDomConfig().setParameter("canonical-form", false);
+        serializer.getDomConfig().setParameter("xml-declaration", false);
+        String str = serializer.writeToString(xformEl);
+        return str;
+    }
 }
 	

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java?rev=1410551&r1=1410550&r2=1410551&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java Fri Nov 16 19:46:28 2012
@@ -17,11 +17,16 @@
 
 package org.apache.juddi.mapping;
 
+import java.io.ByteArrayInputStream;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import javax.xml.bind.JAXBElement;
 
 import javax.xml.bind.JAXBException;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.logging.Log;
@@ -29,8 +34,16 @@ import org.apache.commons.logging.LogFac
 import org.apache.juddi.config.AppConfig;
 import org.apache.juddi.config.Property;
 import org.apache.juddi.jaxb.JAXBMarshaller;
+import org.apache.juddi.model.CanonicalizationMethod;
+import org.apache.juddi.model.KeyInfo;
 import org.apache.juddi.model.OverviewDoc;
+import org.apache.juddi.model.Reference;
+import org.apache.juddi.model.SignatureTransform;
+import org.apache.juddi.model.SignatureValue;
+import org.apache.juddi.model.SignedInfo;
 import org.apache.juddi.model.UddiEntity;
+import org.apache.juddi.model.KeyDataValue;
+import org.apache.juddi.model.SignatureTransformDataValue;
 import org.apache.juddi.subscription.TypeConvertor;
 import org.apache.juddi.v3.error.ErrorMessage;
 import org.apache.juddi.v3.error.FatalErrorException;
@@ -38,6 +51,25 @@ import org.uddi.api_v3.CompletionStatus;
 import org.uddi.api_v3.OperationalInfo;
 import org.uddi.sub_v3.SubscriptionFilter;
 import org.uddi.v3_service.DispositionReportFaultMessage;
+import org.w3._2000._09.xmldsig_.CanonicalizationMethodType;
+import org.w3._2000._09.xmldsig_.DSAKeyValueType;
+import org.w3._2000._09.xmldsig_.DigestMethodType;
+import org.w3._2000._09.xmldsig_.KeyInfoType;
+import org.w3._2000._09.xmldsig_.KeyValueType;
+import org.w3._2000._09.xmldsig_.PGPDataType;
+import org.w3._2000._09.xmldsig_.RSAKeyValueType;
+import org.w3._2000._09.xmldsig_.ReferenceType;
+import org.w3._2000._09.xmldsig_.RetrievalMethodType;
+import org.w3._2000._09.xmldsig_.SPKIDataType;
+import org.w3._2000._09.xmldsig_.SignatureMethodType;
+import org.w3._2000._09.xmldsig_.SignatureType;
+import org.w3._2000._09.xmldsig_.SignatureValueType;
+import org.w3._2000._09.xmldsig_.SignedInfoType;
+import org.w3._2000._09.xmldsig_.TransformType;
+import org.w3._2000._09.xmldsig_.TransformsType;
+import org.w3._2000._09.xmldsig_.X509DataType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 
 /**
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
@@ -60,6 +92,7 @@ public class MappingModelToApi {
 		apiPublisher.setMaxBusinesses(modelPublisher.getMaxBusinesses());
 		apiPublisher.setMaxServicePerBusiness(modelPublisher.getMaxServicesPerBusiness());
 		apiPublisher.setMaxTModels(modelPublisher.getMaxTmodels());
+                mapSignature(modelPublisher.getSignatures(), apiPublisher.getSignature());
 	}
 	
 	public static void mapBusinessEntity(org.apache.juddi.model.BusinessEntity modelBusinessEntity, 
@@ -78,8 +111,226 @@ public class MappingModelToApi {
 		
 		mapBusinessServices(modelBusinessEntity.getBusinessServices(), modelBusinessEntity.getServiceProjections(), apiBusinessEntity.getBusinessServices(), apiBusinessEntity);
 	
+                mapSignature(modelBusinessEntity.getSignatures(), apiBusinessEntity.getSignature());
 	}
 
+        public static void mapSignature(List<org.apache.juddi.model.Signature> signatureList,
+										List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatureList) 
+				   throws DispositionReportFaultMessage {
+            apiSignatureList.clear();
+            for (org.apache.juddi.model.Signature modelSig : signatureList) {
+                SignatureType apiSignature = new SignatureType();
+                apiSignature.setId(modelSig.getXmlID());
+                
+                SignedInfo modelSignedInfo = modelSig.getSignedInfo();
+                SignedInfoType apiSignedInfoType = new SignedInfoType();
+                apiSignature.setSignedInfo(apiSignedInfoType);
+                // Canonicalization method
+                CanonicalizationMethod modelCanonMethod = modelSignedInfo.getCanonicalizationMethod();
+                CanonicalizationMethodType apiCanonMethod = new CanonicalizationMethodType();
+                apiCanonMethod.setAlgorithm(modelCanonMethod.getAlgorithm());
+                apiSignedInfoType.setCanonicalizationMethod(apiCanonMethod);
+                
+                // Signature Method
+                String sigAlg = modelSignedInfo.getSignatureMethod().getAlgorithm();
+                SignatureMethodType apiSigMethod = new SignatureMethodType();
+                apiSigMethod.setAlgorithm(sigAlg);
+                apiSignedInfoType.setSignatureMethod(apiSigMethod);
+                
+                // References
+                List<Reference> modelReferenceList = modelSignedInfo.getReference();
+                List<ReferenceType> apiReferenceList = apiSignedInfoType.getReference();
+                for (Reference modelRef : modelReferenceList) {
+                    ReferenceType apiRef = new ReferenceType();
+                    String refUri = modelRef.getUri();
+                    if (refUri == null) {
+                        refUri = "";
+                    }
+                    apiRef.setURI(refUri);
+                    
+                    List<SignatureTransform> modelSigTransformList = modelRef.getTransforms();
+                    TransformsType apiTransformsType = apiRef.getTransforms();
+                    if (apiTransformsType == null) {
+                        apiTransformsType = new TransformsType();
+                        apiRef.setTransforms(apiTransformsType);
+                    }
+                    List<TransformType> apiTransformList = apiTransformsType.getTransform();
+                    for (SignatureTransform modelSigTransform : modelSigTransformList) {
+                        String modelTransformAlgStr = modelSigTransform.getTransform();
+                        TransformType apiTransform = new TransformType();
+                        apiTransform.setAlgorithm(modelTransformAlgStr);
+                        
+                        List<SignatureTransformDataValue> sigTransformSDVList = modelSigTransform.getSignatureTransformDataValue();
+                        for (SignatureTransformDataValue sigTransformSDV : sigTransformSDVList) {
+                            String type = sigTransformSDV.getContentType();
+                            byte[] xformBytes = sigTransformSDV.getContentBytes();
+                            Object transformObject = convertDataToTransformContent(type, xformBytes);
+                            apiTransform.getContent().add(transformObject);
+                        }
+                        
+                        apiTransformList.add(apiTransform);
+                    }
+                    
+                    String digestMethodStr = modelRef.getDigestMethod();
+                    byte[] digestValBytes = modelRef.getDigestValue();
+                    
+                    DigestMethodType apiDigestMethod = new DigestMethodType();
+                    apiDigestMethod.setAlgorithm(digestMethodStr);
+                    apiRef.setDigestMethod(apiDigestMethod);
+                    apiRef.setDigestValue(digestValBytes);
+                    
+                    apiReferenceList.add(apiRef);
+                }
+                
+                // Signature Value
+                SignatureValueType apiSignatureValue = new SignatureValueType();
+                SignatureValue modelSigValue = modelSig.getSignatureValue();
+                apiSignatureValue.setId(modelSigValue.getXmlID());
+                apiSignatureValue.setValue(modelSigValue.getValue());
+                
+                apiSignature.setSignatureValue(apiSignatureValue);
+                
+                KeyInfoType apiKeyInfo = new KeyInfoType();
+                KeyInfo modelKeyInfo = modelSig.getKeyInfo();
+                apiKeyInfo.setId(modelKeyInfo.getXmlID());
+                
+                List<KeyDataValue> modelKeyDataValueList = modelKeyInfo.getKeyDataValue();
+                List<Object> apiX509KeyInfoList = apiKeyInfo.getContent();
+                mapModelKeyDataValue(modelKeyDataValueList, apiX509KeyInfoList);
+                apiSignature.setKeyInfo(apiKeyInfo);
+                apiSignatureList.add(apiSignature);
+            }
+        }
+        
+        private static void mapModelKeyDataValue(List<KeyDataValue> modelKeyDataValueList, List<Object> parentKeyDataList) {
+            for (KeyDataValue modelKeyDataValue : modelKeyDataValueList) {
+                String tagName = modelKeyDataValue.getKeyDataName();
+                String dataType = modelKeyDataValue.getKeyDataType();
+                byte[] contentBytes = modelKeyDataValue.getKeyDataValueBytes();
+                String contentStr = modelKeyDataValue.getKeyDataValueString();
+                Object contents = contentBytes != null ? contentBytes : contentStr;
+                
+                if (contents == null) {
+                    List<Object> childKeyDataList = new ArrayList<Object>();
+                    if (dataType.equals(X509DataType.class.getSimpleName())) {
+                        X509DataType x509DataType = new X509DataType();
+                        mapModelKeyDataValue(modelKeyDataValue.getKeyDataValueList(), childKeyDataList);
+                        x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().addAll(childKeyDataList);
+                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), X509DataType.class, x509DataType);
+                        parentKeyDataList.add(dataJAXB);   
+                    } else if (dataType.equals(RetrievalMethodType.class.getSimpleName())) {
+                        RetrievalMethodType retrievalMethodType = new RetrievalMethodType();
+                        TransformsType transformsType = new TransformsType();
+                        for (KeyDataValue retrievalMethodKDV : modelKeyDataValue.getKeyDataValueList()) {
+                            if (retrievalMethodKDV.getKeyDataName().equals("Transform")) {
+                                TransformType tType = new TransformType();
+                                tType.setAlgorithm(retrievalMethodKDV.getKeyDataValueString());
+                                
+                                for (KeyDataValue transformContentKDV: retrievalMethodKDV.getKeyDataValueList()) {
+                                    String type = transformContentKDV.getKeyDataType();
+                                    byte[] xformBytes = transformContentKDV.getKeyDataValueBytes();
+                                    Object transformObject = convertDataToTransformContent(type, xformBytes);
+                                    tType.getContent().add(transformObject);
+                                }
+                                
+                                transformsType.getTransform().add(tType);
+                            } else if (retrievalMethodKDV.getKeyDataName().equals("Type")) {
+                                retrievalMethodType.setType(retrievalMethodKDV.getKeyDataValueString());
+                            } else if (retrievalMethodKDV.getKeyDataName().equals("URI")) {
+                                retrievalMethodType.setURI(retrievalMethodKDV.getKeyDataValueString());
+                            } else {
+                                throw new RuntimeException("Unrecognized key data type: " + retrievalMethodKDV.getKeyDataType());
+                            }
+                        }
+                        if (transformsType.getTransform() != null && !transformsType.getTransform().isEmpty()) {
+                            retrievalMethodType.setTransforms(transformsType);
+                        }
+                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), RetrievalMethodType.class, retrievalMethodType);
+                        parentKeyDataList.add(dataJAXB);   
+                    } else if (dataType.equals(PGPDataType.class.getSimpleName())) {
+                        PGPDataType pgpDataType = new PGPDataType();
+                        
+                        for (KeyDataValue pgpDataKDV : modelKeyDataValue.getKeyDataValueList()) {
+                            String pgpDataTagName = pgpDataKDV.getKeyDataName();
+                            Object pgpDataContents = pgpDataKDV.getKeyDataValueBytes() != null ? pgpDataKDV.getKeyDataValueBytes() : pgpDataKDV.getKeyDataValueString();
+                            Class pgpDataClazz = pgpDataContents.getClass();
+                            JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", pgpDataTagName), pgpDataClazz, pgpDataContents);
+                            pgpDataType.getContent().add(jaxb);
+                        }
+                        
+                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), PGPDataType.class, pgpDataType);
+                        parentKeyDataList.add(dataJAXB);   
+                    } else if (dataType.equals(SPKIDataType.class.getSimpleName())) {
+                        SPKIDataType spkiDataType = new SPKIDataType();
+                        
+                        for (KeyDataValue spkiDataKDV : modelKeyDataValue.getKeyDataValueList()) {
+                            String spkiDataTagName = spkiDataKDV.getKeyDataName();
+                            Object spkiDataContents = spkiDataKDV.getKeyDataValueBytes() != null ? spkiDataKDV.getKeyDataValueBytes() : spkiDataKDV.getKeyDataValueString();
+                            Class spkiDataClazz = spkiDataContents.getClass();
+                            JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", spkiDataTagName), spkiDataClazz, spkiDataContents);
+                            spkiDataType.getSPKISexpAndAny().add(jaxb);
+                        }
+                        
+                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), SPKIDataType.class, spkiDataType);
+                        parentKeyDataList.add(dataJAXB);
+                    } else if (dataType.equals(KeyValueType.class.getSimpleName())) {
+                        KeyValueType keyValueType = new KeyValueType();
+                        for (KeyDataValue keyValueDataKDV : modelKeyDataValue.getKeyDataValueList()) {
+                            for (KeyDataValue keyValueDataChildKDV : keyValueDataKDV.getKeyDataValueList()) {
+                                String keyDataDataType = keyValueDataChildKDV.getKeyDataType();
+                                if (keyDataDataType.equals("DSAKeyValueType")) {
+                                    DSAKeyValueType dsaKeyValueType = new DSAKeyValueType();
+                                    for (KeyDataValue dsaKDV : keyValueDataChildKDV.getKeyDataValueList()) {
+                                        if ("G".equals(dsaKDV.getKeyDataName())) {
+                                            dsaKeyValueType.setG(dsaKDV.getKeyDataValueBytes());
+                                        } else if ("P".equals(dsaKDV.getKeyDataName())) {
+                                            dsaKeyValueType.setP(dsaKDV.getKeyDataValueBytes());
+                                        } else if ("Q".equals(dsaKDV.getKeyDataName())) {
+                                            dsaKeyValueType.setQ(dsaKDV.getKeyDataValueBytes());
+                                        } else if ("Y".equals(dsaKDV.getKeyDataName())) {
+                                            dsaKeyValueType.setY(dsaKDV.getKeyDataValueBytes());
+                                        } else if ("J".equals(dsaKDV.getKeyDataName())) {
+                                            dsaKeyValueType.setJ(dsaKDV.getKeyDataValueBytes());
+                                        } else if ("Seed".equals(dsaKDV.getKeyDataName())) {
+                                            dsaKeyValueType.setSeed(dsaKDV.getKeyDataValueBytes());
+                                        } else if ("PgenCounter".equals(dsaKDV.getKeyDataName())) {
+                                            dsaKeyValueType.setPgenCounter(dsaKDV.getKeyDataValueBytes());
+                                        } else {
+                                            throw new RuntimeException("Unrecognized dsa type: " + dsaKDV.getKeyDataName());
+                                        } 
+                                    }
+                                    JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", keyValueDataChildKDV.getKeyDataName()), DSAKeyValueType.class, dsaKeyValueType);
+                                    keyValueType.getContent().add(jaxb);
+                                } else if (keyDataDataType.equals("RSAKeyValueType")) {
+                                    RSAKeyValueType rsaKeyValueType = new RSAKeyValueType();
+                                    for (KeyDataValue rsaKDV : keyValueDataChildKDV.getKeyDataValueList()) {
+                                        if ("Exponent".equals(rsaKDV.getKeyDataName())) {
+                                            rsaKeyValueType.setExponent(rsaKDV.getKeyDataValueBytes());
+                                        } else if ("Modulus".equals(rsaKDV.getKeyDataName())) {
+                                            rsaKeyValueType.setModulus(rsaKDV.getKeyDataValueBytes());
+                                        } else {
+                                            throw new RuntimeException("Unrecognized dsa type: " + rsaKDV.getKeyDataName());
+                                        } 
+                                    }
+                                    JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", keyValueDataChildKDV.getKeyDataName()), RSAKeyValueType.class, rsaKeyValueType);
+                                    keyValueType.getContent().add(jaxb);
+                                } else {
+                                    throw new RuntimeException("Unrecognized element: " + keyDataDataType);
+                                }
+                            }
+                        }
+                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), KeyValueType.class, keyValueType);
+                        parentKeyDataList.add(dataJAXB);
+                    } else {
+                        throw new RuntimeException("Unrecognized type: " + dataType);
+                    }
+                } else {
+                    JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), contents.getClass(), contents);
+                    parentKeyDataList.add(dataJAXB);
+                }
+            }
+        }
+                
 	public static void mapBusinessNames(List<org.apache.juddi.model.BusinessName> modelNameList, 
 										List<org.uddi.api_v3.Name> apiNameList) 
 				   throws DispositionReportFaultMessage {
@@ -234,7 +485,7 @@ public class MappingModelToApi {
 		for (org.apache.juddi.model.AddressLine modelAddressLine : modelAddressLineList) {
 			org.uddi.api_v3.AddressLine apiAddressLine = new org.uddi.api_v3.AddressLine();
 			apiAddressLine.setKeyName(modelAddressLine.getKeyName());
-			apiAddressLine.setKeyName(modelAddressLine.getKeyValue());
+			apiAddressLine.setKeyValue(modelAddressLine.getKeyValue());
 			apiAddressLine.setValue(modelAddressLine.getLine());
 			apiAddressLineList.add(apiAddressLine);
 		}
@@ -308,6 +559,7 @@ public class MappingModelToApi {
         mapBindingTemplates(modelBusinessService.getBindingTemplates(), apiBusinessService.getBindingTemplates(), apiBusinessService);
 		apiBusinessService.setCategoryBag(mapCategoryBag(modelBusinessService.getCategoryBag(), apiBusinessService.getCategoryBag()));
 
+                mapSignature(modelBusinessService.getSignatures(), apiBusinessService.getSignature());
 	}
 
 	public static void mapServiceNames(List<org.apache.juddi.model.ServiceName> modelNameList, 
@@ -390,7 +642,7 @@ public class MappingModelToApi {
 		mapBindingDescriptions(modelBindingTemplate.getBindingDescrs(), apiBindingTemplate.getDescription());
 
 		apiBindingTemplate.setCategoryBag(mapCategoryBag(modelBindingTemplate.getCategoryBag(), apiBindingTemplate.getCategoryBag()));
-
+                mapSignature(modelBindingTemplate.getSignatures(), apiBindingTemplate.getSignature());
 	}
 
 	public static void mapBindingDescriptions(List<org.apache.juddi.model.BindingDescr> modelDescList, 
@@ -559,6 +811,7 @@ public class MappingModelToApi {
 		apiTModel.setCategoryBag(mapCategoryBag(modelTModel.getCategoryBag(), apiTModel.getCategoryBag()));
 		
 		mapOverviewDocs(modelTModel.getOverviewDocs(), null, apiTModel);
+                mapSignature(modelTModel.getSignatures(), apiTModel.getSignature());
 	}
 
 	public static void mapTModelDescriptions(List<org.apache.juddi.model.TmodelDescr> modelDescList, 
@@ -674,7 +927,6 @@ public class MappingModelToApi {
 		keyedRef.setKeyValue(modelPublisherAssertion.getKeyValue());
 		
 		apiPublisherAssertion.setKeyedReference(keyedRef);
-		
 	}
 	
 	public static void mapAssertionStatusItem(org.apache.juddi.model.PublisherAssertion modelPublisherAssertion, 
@@ -831,4 +1083,31 @@ public class MappingModelToApi {
 		apiNode.setSecurityUrl(modelNode.getSecurityUrl());
 		apiNode.setSubscriptionUrl(modelNode.getSubscriptionUrl());
 	}
+
+    private static Object convertDataToTransformContent(String type, byte[] xformBytes) throws RuntimeException {
+        Object transformObject;
+        if (type.equals(String.class.getSimpleName())) {
+            try {
+                transformObject = new String(xformBytes, "UTF-8");
+            } catch (Exception e) {
+                throw new RuntimeException("Error decoding string due to: " + e.getMessage(), e);
+            }
+        } else if (type.equals(byte[].class.getSimpleName())) {
+            transformObject = xformBytes;
+        } else if (type.equals(Element.class.getCanonicalName())) {
+            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+            dbf.setNamespaceAware(true);
+            dbf.setXIncludeAware(true);
+            try {
+                DocumentBuilder db = dbf.newDocumentBuilder();
+                Document doc = db.parse(new ByteArrayInputStream(xformBytes));
+                transformObject = doc.getDocumentElement();
+            } catch (Exception e) {
+                throw new RuntimeException("Failed to parse element due to: " + e.getMessage(), e);
+            }
+        } else {
+            throw new RuntimeException("Unrecognized type: " + type);
+        }
+        return transformObject;
+    }
 }

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java?rev=1410551&r1=1410550&r2=1410551&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BindingTemplate.java Fri Nov 16 19:46:28 2012
@@ -47,6 +47,7 @@ public class BindingTemplate extends Udd
 	private String hostingRedirector;
 	private BindingCategoryBag categoryBag;
 	private List<TmodelInstanceInfo> tmodelInstanceInfos = new ArrayList<TmodelInstanceInfo>(0);
+        private List<Signature> signatures = new ArrayList<Signature>(0);
 	
 	public BindingTemplate() {
 	}
@@ -131,4 +132,14 @@ public class BindingTemplate extends Udd
 	public void setBindingDescrs(List<BindingDescr> bindingDescrs) {
 		this.bindingDescrs = bindingDescrs;
 	}
+        
+        @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bindingTemplate")
+	@OrderBy
+        public List<Signature> getSignatures() {
+                return signatures;
+        }
+
+        public void setSignatures(List<Signature> signatures) {
+                this.signatures = signatures;
+        }
 }

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java?rev=1410551&r1=1410550&r2=1410551&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessEntity.java Fri Nov 16 19:46:28 2012
@@ -45,8 +45,8 @@ public class BusinessEntity extends Uddi
 	private BusinessCategoryBag categoryBag;
 	private List<BusinessService> businessServices = new ArrayList<BusinessService>(0);
 	private List<BusinessDescr> businessDescrs = new ArrayList<BusinessDescr>(0);
-	
 	private List<ServiceProjection> serviceProjections = new ArrayList<ServiceProjection>(0);
+        private List<Signature> signatures = new ArrayList<Signature>(0);
 
 	public BusinessEntity() {
 	}
@@ -169,6 +169,16 @@ public class BusinessEntity extends Uddi
 	public void setServiceProjections(List<ServiceProjection> serviceProjections) {
 		this.serviceProjections = serviceProjections;
 	}
+
+        @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessEntity")
+	@OrderBy
+        public List<Signature> getSignatures() {
+                return signatures;
+        }
+
+        public void setSignatures(List<Signature> signatures) {
+                this.signatures = signatures;
+        }
 	
 	
 }

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java?rev=1410551&r1=1410550&r2=1410551&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/BusinessService.java Fri Nov 16 19:46:28 2012
@@ -43,7 +43,8 @@ public class BusinessService extends Udd
 	private List<ServiceDescr> serviceDescrs = new ArrayList<ServiceDescr>(0);
 	private List<BindingTemplate> bindingTemplates = new ArrayList<BindingTemplate>(0);
 	private ServiceCategoryBag categoryBag;
-    private List<ServiceProjection> projectingBusinesses = new ArrayList<ServiceProjection>(0);
+        private List<ServiceProjection> projectingBusinesses = new ArrayList<ServiceProjection>(0);
+        private List<Signature> signatures = new ArrayList<Signature>(0);
 
 	public BusinessService() {
 	}
@@ -117,4 +118,14 @@ public class BusinessService extends Udd
 	public void setProjectingBusinesses(List<ServiceProjection> projectingBusinesses) {
 		this.projectingBusinesses = projectingBusinesses;
 	}
+        
+        @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "businessService")
+	@OrderBy
+        public List<Signature> getSignatures() {
+                return signatures;
+        }
+
+        public void setSignatures(List<Signature> signatures) {
+                this.signatures = signatures;
+        }
 }

Added: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/CanonicalizationMethod.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/CanonicalizationMethod.java?rev=1410551&view=auto
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/CanonicalizationMethod.java (added)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/CanonicalizationMethod.java Fri Nov 16 19:46:28 2012
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.model;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ *
+ * @author jsightler
+ */
+@Entity
+@Table(name="j3_canonicalization_method")
+public class CanonicalizationMethod {
+    private Long id;
+    private String algorithm;
+    
+    @Id
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @Column(name="algorithm")
+    public String getAlgorithm() {
+        return algorithm;
+    }
+
+    public void setAlgorithm(String algorithm) {
+        this.algorithm = algorithm;
+    }
+}

Added: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyDataValue.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyDataValue.java?rev=1410551&view=auto
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyDataValue.java (added)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyDataValue.java Fri Nov 16 19:46:28 2012
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+/**
+ *
+ */
+@Entity
+@Table(name="j3_key_data_value")
+public class KeyDataValue implements java.io.Serializable {
+    private static final long serialVersionUID = -6353389848796421615L;
+    
+    private Long id;
+    private KeyInfo keyInfo;
+    private String keyDataType;
+    private String keyDataName;
+    private byte[] keyDataValueBytes;
+    private String keyDataValueString;
+    private KeyDataValue keyDataValue;
+    private List<KeyDataValue> keyDataValueList = new ArrayList<KeyDataValue>();
+
+    public KeyDataValue() {
+    }
+    
+    public KeyDataValue(KeyInfo keyInfo, String keyDataType, String keyDataName, byte[] keyDataValueBytes, String keyDataValueString, KeyDataValue keyDataValue) {
+        this.keyInfo = keyInfo;
+        this.keyDataType = keyDataType;
+        this.keyDataName = keyDataName;
+        this.keyDataValueBytes = keyDataValueBytes;
+        this.keyDataValueString = keyDataValueString;
+        this.keyDataValue = keyDataValue;
+    }
+    
+    
+    
+    @Id
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "key_info_key", nullable = true)
+    public KeyInfo getKeyInfo() {
+        return keyInfo;
+    }
+
+    public void setKeyInfo(KeyInfo keyInfo) {
+        this.keyInfo = keyInfo;
+    }
+    
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "key_data_value_key", nullable = true)
+    public KeyDataValue getKeyDataValue() {
+        return keyDataValue;
+    }
+
+    public void setKeyDataValue(KeyDataValue keyDataValue) {
+        this.keyDataValue = keyDataValue;
+    }
+    
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "keyDataValue")
+    @OrderBy
+    public List<KeyDataValue> getKeyDataValueList() {
+        return keyDataValueList;
+    }
+
+    public void setKeyDataValueList(List<KeyDataValue> keyDataValueList) {
+        this.keyDataValueList = keyDataValueList;
+    }
+
+    @Column(name="key_data_name")
+    public String getKeyDataName() {
+        return keyDataName;
+    }
+
+    public void setKeyDataName(String keyDataName) {
+        this.keyDataName = keyDataName;
+    }
+    
+    @Column(name="key_data_type")
+    public String getKeyDataType() {
+        return keyDataType;
+    }
+
+    public void setKeyDataType(String keyDataType) {
+        this.keyDataType = keyDataType;
+    }
+
+    @Lob
+    @Column(name="key_data_value")
+    public byte[] getKeyDataValueBytes() {
+        return keyDataValueBytes;
+    }
+
+    public void setKeyDataValueBytes(byte[] keyDataValueBytes) {
+        this.keyDataValueBytes = keyDataValueBytes;
+    }
+
+    @Lob
+    @Column(name="key_data_value_string")
+    public String getKeyDataValueString() {
+        return keyDataValueString;
+    }
+
+    public void setKeyDataValueString(String keyDataValueString) {
+        this.keyDataValueString = keyDataValueString;
+    }
+
+    @Override
+    public String toString() {
+        return "KeyDataValue{" + "id=" + id + ", keyDataType=" + keyDataType + ", keyDataName=" + keyDataName + ", keyDataValueBytes=" + keyDataValueBytes + ", keyDataValueString=" + keyDataValueString + ", keyDataValueList=" + keyDataValueList + '}';
+    }
+}

Added: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyInfo.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyInfo.java?rev=1410551&view=auto
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyInfo.java (added)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/KeyInfo.java Fri Nov 16 19:46:28 2012
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+/**
+ *
+ */
+@Entity
+@Table(name="j3_key_info")
+public class KeyInfo implements java.io.Serializable {
+    private static final long serialVersionUID = -7353389848796421615L;
+
+    private Long id;
+    private List<KeyDataValue> keyDataValue = new ArrayList<KeyDataValue>();
+    private String xmlID;
+    
+    @Id
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "keyInfo")
+    @OrderBy
+    public List<KeyDataValue> getKeyDataValue() {
+        return keyDataValue;
+    }
+
+    public void setKeyDataValue(List<KeyDataValue> keyDataValue) {
+        this.keyDataValue = keyDataValue;
+    }
+    
+    @Column(name="xml_id")
+    public String getXmlID() {
+        return xmlID;
+    }
+
+    public void setXmlID(String xmlID) {
+        this.xmlID = xmlID;
+    }
+}

Added: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/ObjectType.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/ObjectType.java?rev=1410551&view=auto
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/ObjectType.java (added)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/ObjectType.java Fri Nov 16 19:46:28 2012
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.model;
+
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+/**
+ *
+ */
+@Entity
+@Table(name="j3_object_type")
+public class ObjectType implements java.io.Serializable {
+    private static final long serialVersionUID = -3233157941119408716L;
+    
+    private Long id;
+    private Signature signature;
+    private List<ObjectTypeContent> content;
+    private String xmlID;
+    private String mimeType;
+    private String encoding;
+    
+    @Id
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "signature_key", nullable = false)
+    public Signature getSignature() {
+        return signature;
+    }
+
+    public void setSignature(Signature signature) {
+        this.signature = signature;
+    }
+    
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "objectType")
+    @OrderBy
+    public List<ObjectTypeContent> getContent() {
+        return content;
+    }
+
+    public void setContent(List<ObjectTypeContent> content) {
+        this.content = content;
+    }
+
+    @Column(name="xml_id")
+    public String getXmlID() {
+        return xmlID;
+    }
+
+    public void setXmlID(String xmlID) {
+        this.xmlID = xmlID;
+    }
+
+    @Column(name="mime_type")
+    public String getMimeType() {
+        return mimeType;
+    }
+
+    public void setMimeType(String mimeType) {
+        this.mimeType = mimeType;
+    }
+
+    @Column(name="encoding")
+    public String getEncoding() {
+        return encoding;
+    }
+
+    public void setEncoding(String encoding) {
+        this.encoding = encoding;
+    }
+}

Added: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/ObjectTypeContent.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/ObjectTypeContent.java?rev=1410551&view=auto
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/ObjectTypeContent.java (added)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/ObjectTypeContent.java Fri Nov 16 19:46:28 2012
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.model;
+
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+/**
+ *
+ */
+@Entity
+@Table(name="j3_object_type_content")
+public class ObjectTypeContent implements java.io.Serializable {
+    private static final long serialVersionUID = -3233157941119408715L;
+    
+    private Long id;
+    private ObjectType objectType;
+    private byte[] content;
+    
+    @Id
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "object_type_key", nullable = false)
+    public ObjectType getObjectType() {
+        return objectType;
+    }
+
+    public void setObjectType(ObjectType objectType) {
+        this.objectType = objectType;
+    }
+    
+    @Lob
+    public byte[] getContent() {
+        return content;
+    }
+    
+    public void setContent(byte[] content) {
+        this.content = content;
+    }
+}

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Publisher.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Publisher.java?rev=1410551&r1=1410550&r2=1410551&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Publisher.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Publisher.java Fri Nov 16 19:46:28 2012
@@ -15,8 +15,14 @@ package org.apache.juddi.model;
  * limitations under the License.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
 import javax.persistence.Table;
 import javax.persistence.Transient;
 
@@ -38,6 +44,7 @@ public class Publisher extends UddiEntit
 	private Integer maxServicesPerBusiness;
 	private Integer maxBindingsPerService;
 	private Integer maxTmodels;
+        private List<Signature> signatures = new ArrayList<Signature>(0);
 
 	public Publisher() {
 		super(null);
@@ -150,4 +157,13 @@ public class Publisher extends UddiEntit
 		this.maxTmodels = maxTmodels;
 	}
 
+        @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "publisher")
+	@OrderBy
+        public List<Signature> getSignatures() {
+                return signatures;
+        }
+
+        public void setSignatures(List<Signature> signatures) {
+                this.signatures = signatures;
+        }
 }

Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/PublisherAssertion.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/PublisherAssertion.java?rev=1410551&r1=1410550&r2=1410551&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/PublisherAssertion.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/PublisherAssertion.java Fri Nov 16 19:46:28 2012
@@ -15,14 +15,19 @@ package org.apache.juddi.model;
  * limitations under the License.
  */
 
+import java.util.ArrayList;
+import java.util.List;
 import javax.persistence.AttributeOverride;
 import javax.persistence.AttributeOverrides;
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.EmbeddedId;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.JoinColumn;
 import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
 import javax.persistence.Table;
 
 /**
@@ -139,5 +144,4 @@ public class PublisherAssertion implemen
 	public void setToCheck(String toCheck) {
 		this.toCheck = toCheck;
 	}
-
 }

Added: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Reference.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Reference.java?rev=1410551&view=auto
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Reference.java (added)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Reference.java Fri Nov 16 19:46:28 2012
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+/**
+ *
+ */
+@Entity
+@Table(name="j3_reference")
+public class Reference {
+    private static final long serialVersionUID = -3233157941119408701L;
+    
+    private Long id;
+    private SignedInfo signedInfo;
+    private List<SignatureTransform> transforms = new ArrayList<SignatureTransform>(0);
+    private String digestMethod;
+    private byte[] digestValue;
+    private String xmlID;
+    private String uri;
+    private String type;
+    
+    @Id
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @ManyToOne(fetch = FetchType.LAZY)
+    @JoinColumn(name = "signed_info_key", nullable = false)
+    public SignedInfo getSignedInfo() {
+        return signedInfo;
+    }
+
+    public void setSignedInfo(SignedInfo signedInfo) {
+        this.signedInfo = signedInfo;
+    }
+    
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "reference")
+    @OrderBy
+    public List<SignatureTransform> getTransforms() {
+        return transforms;
+    }
+
+    public void setTransforms(List<SignatureTransform> transforms) {
+        this.transforms = transforms;
+    }
+
+    @Column(name="digest_method")
+    public String getDigestMethod() {
+        return digestMethod;
+    }
+
+    public void setDigestMethod(String digestMethod) {
+        this.digestMethod = digestMethod;
+    }
+
+    @Lob
+    @Column(name="digest_value")
+    public byte[] getDigestValue() {
+        return digestValue;
+    }
+
+    public void setDigestValue(byte[] digestValue) {
+        this.digestValue = digestValue;
+    }
+
+    @Column(name="uri")
+    public String getUri() {
+        return uri;
+    }
+
+    public void setUri(String uri) {
+        this.uri = uri;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+    
+    @Column(name="xml_id")
+    public String getXmlID() {
+        return xmlID;
+    }
+
+    public void setXmlID(String xmlID) {
+        this.xmlID = xmlID;
+    }
+}

Added: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Signature.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Signature.java?rev=1410551&view=auto
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Signature.java (added)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/Signature.java Fri Nov 16 19:46:28 2012
@@ -0,0 +1,160 @@
+/*
+ * Copyright 2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.model;
+
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.OrderBy;
+import javax.persistence.Table;
+
+/**
+ *
+ */
+@Entity
+@Table(name = "j3_signature")
+public class Signature implements java.io.Serializable {
+    private static final long serialVersionUID = -3233157941119408718L;
+    
+    private Long id;
+    private SignedInfo signedInfo;
+    private SignatureValue signatureValue;
+    private KeyInfo keyInfo;
+    private List<ObjectType> object;
+    private BusinessEntity businessEntity;
+    private BusinessService businessService;
+    private Publisher publisher;
+    private BindingTemplate bindingTemplate;
+    private Tmodel tmodel;
+    private String xmlID;
+
+    @Id
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @ManyToOne
+    @JoinColumn(name = "binding_template_key", nullable = true)
+    public BindingTemplate getBindingTemplate() {
+        return bindingTemplate;
+    }
+
+    public void setBindingTemplate(BindingTemplate bindingTemplate) {
+        this.bindingTemplate = bindingTemplate;
+    }
+
+    @ManyToOne
+    @JoinColumn(name = "tmodel_key", nullable = true)
+    public Tmodel getTmodel() {
+        return tmodel;
+    }
+
+    public void setTmodel(Tmodel tmodel) {
+        this.tmodel = tmodel;
+    }
+    
+    @ManyToOne
+    @JoinColumn(name = "publisher_key", nullable = true)
+    public Publisher getPublisher() {
+        return publisher;
+    }
+
+    public void setPublisher(Publisher publisher) {
+        this.publisher = publisher;
+    }
+    
+    @ManyToOne
+    @JoinColumn(name = "business_service_key", nullable = true)
+    public BusinessService getBusinessService() {
+        return businessService;
+    }
+
+    public void setBusinessService(BusinessService businessService) {
+        this.businessService = businessService;
+    }
+    
+    @ManyToOne
+    @JoinColumn(name = "business_key", nullable = true)
+    public BusinessEntity getBusinessEntity() {
+        return businessEntity;
+    }
+
+    public void setBusinessEntity(BusinessEntity businessEntity) {
+        this.businessEntity = businessEntity;
+    }
+
+    @ManyToOne(fetch = FetchType.LAZY, cascade=CascadeType.ALL)
+    @JoinColumn(name = "signed_info", nullable = false)
+    public SignedInfo getSignedInfo() {
+        return signedInfo;
+    }
+
+    public void setSignedInfo(SignedInfo signedInfo) {
+        this.signedInfo = signedInfo;
+    }
+
+    @ManyToOne(fetch = FetchType.LAZY, cascade=CascadeType.ALL)
+    @JoinColumn(name = "signature_value", nullable = false)
+    public SignatureValue getSignatureValue() {
+        return signatureValue;
+    }
+
+    public void setSignatureValue(SignatureValue signatureValue) {
+        this.signatureValue = signatureValue;
+    }
+
+    @ManyToOne(fetch = FetchType.LAZY, cascade=CascadeType.ALL)
+    @JoinColumn(name = "key_info", nullable = false)
+    public KeyInfo getKeyInfo() {
+        return keyInfo;
+    }
+
+    public void setKeyInfo(KeyInfo keyInfo) {
+        this.keyInfo = keyInfo;
+    }
+
+    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "signature")
+    @OrderBy
+    public List<ObjectType> getObject() {
+        return object;
+    }
+
+    public void setObject(List<ObjectType> object) {
+        this.object = object;
+    }
+
+    @Column(name="xml_id")
+    public String getXmlID() {
+        return xmlID;
+    }
+
+    public void setXmlID(String xmlID) {
+        this.xmlID = xmlID;
+    }
+}

Added: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/SignatureMethod.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/SignatureMethod.java?rev=1410551&view=auto
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/SignatureMethod.java (added)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/model/SignatureMethod.java Fri Nov 16 19:46:28 2012
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2012 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.model;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+/**
+ *
+ */
+@Entity
+@Table(name="j3_signature_method")
+public class SignatureMethod {
+    private Long id;
+    private String algorithm;
+    
+    @Id
+    @GeneratedValue(strategy=GenerationType.AUTO)
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    @Column(name="algorithm")
+    public String getAlgorithm() {
+        return algorithm;
+    }
+
+    public void setAlgorithm(String algorithm) {
+        this.algorithm = algorithm;
+    }
+}



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


Mime
View raw message