Package org.apache.openejb.jee.oejb2

Examples of org.apache.openejb.jee.oejb2.EjbRelationshipRoleType$RelationshipRoleSource


                        virtualHosts[i] = ddVirtualHosts.get(i).trim();
                    }
                    ejbWebServiceGBean.setAttribute("virtualHosts", virtualHosts);
                }

                WebServiceSecurityType wsSecurity = wsBinding.getWebServiceSecurity();
                if (wsSecurity != null) {
                    Properties properties = wsSecurity.getProperties();

                    ejbWebServiceGBean.setReferencePattern("ConfigurationFactory",
                            new AbstractNameQuery(null, Collections.singletonMap("name", wsSecurity.getSecurityRealmName().trim()),
                            ConfigurationFactory.class.getName()));
                    String authMethod = wsSecurity.getAuthMethod().value();
                    ejbWebServiceGBean.setAttribute("authMethod", authMethod);
                    if (wsSecurity.getRealmName() != null) {
                        ejbWebServiceGBean.setAttribute("realmName", wsSecurity.getRealmName().trim());
                    }
                    String policyContextID = sessionName.toString();
                    ejbWebServiceGBean.setAttribute("policyContextID", policyContextID);
                    ejbWebServiceGBean.setAttribute("properties", properties);
                }
View Full Code Here


                        virtualHosts[i] = ddVirtualHosts.get(i).trim();
                    }
                    ejbWebServiceGBean.setAttribute("virtualHosts", virtualHosts);
                }

                WebServiceSecurityType wsSecurity = wsBinding.getWebServiceSecurity();
                if (wsSecurity != null) {
                    ejbWebServiceGBean.setReferencePattern("ConfigurationFactory",
                            new AbstractNameQuery(null, Collections.singletonMap("name", wsSecurity.getSecurityRealmName().trim()),
                            ConfigurationFactory.class.getName()));
                    ejbWebServiceGBean.setAttribute("authMethod", wsSecurity.getAuthMethod().value());
                    if (wsSecurity.getRealmName() != null) {
                        ejbWebServiceGBean.setAttribute("realmName", wsSecurity.getRealmName().trim());
                    }
                    Properties properties = wsSecurity.getProperties();
                    ejbWebServiceGBean.setAttribute("properties", properties);
                    String policyContextID = sessionName.toString();
                    ejbWebServiceGBean.setAttribute("policyContextID", policyContextID);
                }
            }
View Full Code Here

        private WebServiceBinding(WebServiceBindingType bt) {
            address = bt.getWebServiceAddress();
            virtualHosts = bt.getWebServiceVirtualHost();
            if (bt.getWebServiceSecurity() != null) {
                security = new WebServiceSecurityType();
                security.setAuthMethod(bt.getWebServiceSecurity().getAuthMethod());
                security.setRealmName(bt.getWebServiceSecurity().getRealmName());
                security.setSecurityRealmName(bt.getWebServiceSecurity().getSecurityRealmName());
                security.setTransportGuarantee(bt.getWebServiceSecurity().getTransportGuarantee());
            }
View Full Code Here

        private WebServiceBinding(WebServiceBindingType bt) {
            address = bt.getWebServiceAddress();
            virtualHosts = bt.getWebServiceVirtualHost();
            if (bt.getWebServiceSecurity() != null) {
                security = new WebServiceSecurityType();
                security.setAuthMethod(bt.getWebServiceSecurity().getAuthMethod());
                security.setRealmName(bt.getWebServiceSecurity().getRealmName());
                security.setSecurityRealmName(bt.getWebServiceSecurity().getSecurityRealmName());
                security.setTransportGuarantee(bt.getWebServiceSecurity().getTransportGuarantee());
            }
View Full Code Here

            RelationshipsType relationships = openejb.getRelationships();
            if (relationships != null && relationships.getEjbRelation().size() == 0) {
                openejb.setRelationships(null);
            }
        }else if (source instanceof EjbRelationshipRoleType) {
          EjbRelationshipRoleType role = (EjbRelationshipRoleType)source;
            if (role.getRoleMapping() != null && role.getRoleMapping().getCmrFieldMapping().size() == 0) {
                role.setRoleMapping(null);
            }
        }
    }
View Full Code Here

        }
        else if (element.getText().equals(elementTypes[RELATIONSHIP_ROLE])) {
            if (isEmpty(textList.get(1).getText())) {
                return false;
            }
            EjbRelationshipRoleType role = (EjbRelationshipRoleType)eObject;
            if (role == null) {
                role = (EjbRelationshipRoleType)getEFactory().create(EjbRelationshipRoleType.class);
                relation = (EjbRelationType)((EjbRelationSection)section).getSelectedObject();
                relation.getEjbRelationshipRole().add(role);
            }
            role.setEjbRelationshipRoleName(textList.get(0).getText());
            EjbRelationshipRoleType.RelationshipRoleSource source = role.getRelationshipRoleSource();
            if (source == null) {
                source = (EjbRelationshipRoleType.RelationshipRoleSource)getEFactory().create(EjbRelationshipRoleType.RelationshipRoleSource.class);
                role.setRelationshipRoleSource(source);
            }
            source.setEjbName(textList.get(1).getText());
            EjbRelationshipRoleType.CmrField cmrField = role.getCmrField();
            if (cmrField == null) {
                cmrField = (EjbRelationshipRoleType.CmrField)getEFactory().create(EjbRelationshipRoleType.CmrField.class);
                role.setCmrField(cmrField);
            }
            cmrField.setCmrFieldName(textList.get(2).getText());
        }
        else if (element.getText().equals(elementTypes[CMR_FIELD_MAPPING])) {
            if (isEmpty(textList.get(0).getText()) || isEmpty(textList.get(1).getText())) {
                return false;
            }
            EjbRelationshipRoleType.RoleMapping.CmrFieldMapping fieldMapping =
                    (EjbRelationshipRoleType.RoleMapping.CmrFieldMapping)eObject;
            if (fieldMapping == null) {
                fieldMapping = (EjbRelationshipRoleType.RoleMapping.CmrFieldMapping)getEFactory().create(EjbRelationshipRoleType.RoleMapping.CmrFieldMapping.class);
                EjbRelationshipRoleType role = (EjbRelationshipRoleType)((EjbRelationSection)section).getSelectedObject();
                EjbRelationshipRoleType.RoleMapping roleMapping = role.getRoleMapping();
                if (roleMapping == null) {
                    roleMapping = (EjbRelationshipRoleType.RoleMapping)getEFactory().create(EjbRelationshipRoleType.RoleMapping.class);
                    role.setRoleMapping(roleMapping);
                }
                role.getRoleMapping().getCmrFieldMapping().add(fieldMapping);
            }
            fieldMapping.setKeyColumn(textList.get(0).getText());
            fieldMapping.setForeignKeyColumn(textList.get(1).getText());
        }
        return true;
View Full Code Here

                    textList.get(0).setText(((EjbRelationType)eObject).getEjbRelationName());
                    textList.get(1).setText(((EjbRelationType)eObject).getManyToManyTableName());
                    element.select(EJB_RELATION);
                }
                else if (EjbRelationshipRoleType.class.isInstance(eObject)) {
                  EjbRelationshipRoleType role = (EjbRelationshipRoleType)eObject;
                    textList.get(0).setText(role.getEjbRelationshipRoleName());
                    textList.get(1).setText(role.getRelationshipRoleSource().getEjbName());
                    textList.get(2).setText(role.getCmrField().getCmrFieldName());
                    element.select(RELATIONSHIP_ROLE);
                }
                else if (EjbRelationshipRoleType.RoleMapping.CmrFieldMapping.class.isInstance(eObject)) {
                  EjbRelationshipRoleType.RoleMapping.CmrFieldMapping fieldMapping =
                            (EjbRelationshipRoleType.RoleMapping.CmrFieldMapping)eObject;
View Full Code Here

        else if (EjbRelationshipRoleType.class.isInstance(anItem)) {
          EjbRelationType relation = (EjbRelationType)tree.getSelection()[0].getParentItem().getData();
            relation.getEjbRelationshipRole().remove(anItem);
        }
        else if (EjbRelationshipRoleType.RoleMapping.CmrFieldMapping.class.isInstance(anItem)) {
          EjbRelationshipRoleType role = (EjbRelationshipRoleType)tree.getSelection()[0].getParentItem().getData();
            role.getRoleMapping().getCmrFieldMapping().remove(anItem);
        }
    }
View Full Code Here

                if (EjbRelationType.class.isInstance(parentElement)) {
                  EjbRelationType relation = (EjbRelationType)parentElement;
                    return relation.getEjbRelationshipRole().toArray();
                }
                if (EjbRelationshipRoleType.class.isInstance(parentElement)) {
                  EjbRelationshipRoleType role = (EjbRelationshipRoleType)parentElement;
                    if (role.getRoleMapping() != null) {
                        return role.getRoleMapping().getCmrFieldMapping().toArray();
                    }
                }
                return new String[] {};
            }
        };
View Full Code Here

                  EjbRelationType relation = (EjbRelationType)element;
                    return "EJB Relation: name = \"" + relation.getEjbRelationName() +
                            "\", MTM table name = \"" + relation.getManyToManyTableName() + "\"";
                }
                if (EjbRelationshipRoleType.class.isInstance(element)) {
                  EjbRelationshipRoleType role = (EjbRelationshipRoleType)element;
                    return "EJB Relationship Role: name = \"" + role.getEjbRelationshipRoleName() +
                            "\", source = \"" + role.getRelationshipRoleSource().getEjbName() +
                            "\", CMR field name = \"" + role.getCmrField().getCmrFieldName() + "\"";
                }
                if (EjbRelationshipRoleType.RoleMapping.CmrFieldMapping.class.isInstance(element)) {
                  EjbRelationshipRoleType.RoleMapping.CmrFieldMapping fieldMapping =
                            (EjbRelationshipRoleType.RoleMapping.CmrFieldMapping)element;
                    return "CMR Field Mapping: key column = \"" + fieldMapping.getKeyColumn() +
View Full Code Here

TOP

Related Classes of org.apache.openejb.jee.oejb2.EjbRelationshipRoleType$RelationshipRoleSource

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.