Package org.apache.juddi.model

Examples of org.apache.juddi.model.KeyDataValue


                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());
                        }
                    }
View Full Code Here


            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;
    }
View Full Code Here

        }
        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;
    }
View Full Code Here

        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;
View Full Code Here

        }
        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);
            }
View Full Code Here

        }
        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;
View Full Code Here

        }
        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());
            }
View Full Code Here

                        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());
                                        }
                                }
View Full Code Here

                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 instanceof X509IssuerSerialType) {
                          modelKeyInfoValue.setKeyDataType(X509IssuerSerialType.class.getSimpleName());
                          X509IssuerSerialType x509IssuerSerialType = (X509IssuerSerialType) x509IssuerSerialOrX509SKIOrX509SubjectName;
                          modelKeyInfoValue.setKeyDataValueString(x509IssuerSerialType.getX509IssuerName());
                          modelKeyInfoValue.setKeyDataValueBytes(x509IssuerSerialType.getX509SerialNumber().toByteArray());
                        } else if (x509IssuerSerialOrX509SKIOrX509SubjectName != null) {
                                throw new RuntimeException("Unrecognized Value for Element: " + tagName + ": " + x509IssuerSerialOrX509SKIOrX509SubjectName.getClass().getCanonicalName());
                        }
                        modelKeyInfoValue.setKeyDataValue(modelX509KeyData);
                        modelX509KeyData.getKeyDataValueList().add(modelKeyInfoValue);
                }
                return modelX509KeyData;
        }
View Full Code Here

                }
                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;
        }
View Full Code Here

TOP

Related Classes of org.apache.juddi.model.KeyDataValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.