Package org.apache.openejb.jee.oejb2

Examples of org.apache.openejb.jee.oejb2.EjbRelationType


            assert sessionName != null: "StatelesSessionBean/Singletion object name is null";

            WebServiceBinding wsBinding = wsBindingMap.get(ejbName);
            if (wsBinding != null) {
                WebServiceSecurityType wsSecurity = wsBinding.getWebServiceSecurity();
                if (wsSecurity != null) {
                    earContext.setHasSecurity(true);
                    String policyContextID = sessionName.toString();
                    Properties properties = wsSecurity.getProperties();
                    PermissionCollection uncheckedPermissions = new Permissions();
                    String transportGuarantee = wsSecurity.getTransportGuarantee().toString().trim();
                    boolean getProtected = properties.get("getProtected") == null? true: Boolean.valueOf((String) properties.get("getProtected"));
                    if (getProtected) {
                        WebUserDataPermission webUserDataPermission = new WebUserDataPermission("/*", null, transportGuarantee);
                        uncheckedPermissions.add(webUserDataPermission);
                    } else {
                        uncheckedPermissions.add(new WebUserDataPermission("/*", new String[] {"GET"}, "NONE"));
                        uncheckedPermissions.add(new WebUserDataPermission("/*", "!GET:" + transportGuarantee));
                    }
                    Map<String, PermissionCollection> rolePermissions = new HashMap<String, PermissionCollection>();
                    //TODO allow jaspi authentication
                    boolean secured = wsSecurity.getAuthMethod() != null && AuthMethodType.NONE != (wsSecurity.getAuthMethod());// || wsSecurity.isSetAuthentication();
                    if (secured) {
                        boolean getSecured = properties.get("getSecured") == null? true: Boolean.valueOf((String) properties.get("getSecured"));
                        if (!getSecured) {
                            uncheckedPermissions.add(new WebResourcePermission("/*", "GET"));
                        }
View Full Code Here


            assert sessionName != null: "StatelesSessionBean/Singleton object name is null";

            WebServiceBinding wsBinding = wsBindingMap.get(ejbName);
            if (wsBinding != null) {

                WebServiceSecurityType wsSecurity = wsBinding.getWebServiceSecurity();
                if (wsSecurity != null) {
                    earContext.setHasSecurity(true);
                    String policyContextID = sessionName.toString();
                    Properties properties = wsSecurity.getProperties();
                    PermissionCollection uncheckedPermissions = new Permissions();
                    String transportGuarantee = wsSecurity.getTransportGuarantee().toString().trim();
                    boolean getProtected = properties.get("getProtected") == null? true: Boolean.valueOf((String) properties.get("getProtected"));
                    if (getProtected) {
                        WebUserDataPermission webUserDataPermission = new WebUserDataPermission("/*", null, transportGuarantee);
                        uncheckedPermissions.add(webUserDataPermission);
                    } else {
                        uncheckedPermissions.add(new WebUserDataPermission("/*", new String[] {"GET"}, "NONE"));
                        uncheckedPermissions.add(new WebUserDataPermission("/*", "!GET:" + transportGuarantee));
                    }
                    Map<String, PermissionCollection> rolePermissions = new HashMap<String, PermissionCollection>();
                    //TODO allow jaspi authentication
                    boolean secured = wsSecurity.getAuthMethod() != null && AuthMethodType.NONE != (wsSecurity.getAuthMethod());// || wsSecurity.isSetAuthentication();
                    if (secured) {
                        boolean getSecured = properties.get("getSecured") == null? true: Boolean.valueOf((String) properties.get("getSecured"));
                        if (!getSecured) {
                            uncheckedPermissions.add(new WebResourcePermission("/*", "GET"));
                        }
View Full Code Here

                        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

        addPage(new EjbRelationWizardPage("Page0"));
    }

    @Override
    public boolean performFinish() {
        EjbRelationType relation;
        if (element.getText().equals(elementTypes[EJB_RELATION])) {
            relation = (EjbRelationType)eObject;
            if (relation == null) {
                relation = (EjbRelationType)getEFactory().create(EjbRelationType.class);
                JAXBElement plan = section.getPlan();
               
                if (JAXBModelUtils.getEjbRelationships(plan) == null) {
                  RelationshipsType relationships = (RelationshipsType)getEFactory().create(RelationshipsType.class);

                    JAXBModelUtils.setEjbRelationships(plan, relationships);
                    ((EjbRelationSection)section).resetInput(relationships);
                }
                JAXBModelUtils.getEjbRelationships(plan).add(relation);
            }
            relation.setEjbRelationName(textList.get(0).getText());
            relation.setManyToManyTableName(textList.get(1).getText());
        }
        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);
View Full Code Here

    public void removeItem(Object anItem) {
        if (EjbRelationType.class.isInstance(anItem)) {
            getObjectContainer().remove(anItem);
        }
        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

            public Object[] getChildren(Object parentElement) {
                if (List.class.isInstance(parentElement)) {
                    return ((List)parentElement).toArray();
                }
                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();
View Full Code Here

    public ILabelProvider getLabelProvider() {
        return new LabelProvider() {
            @Override
            public String getText(Object element) {
                if (EjbRelationType.class.isInstance(element)) {
                  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() +
View Full Code Here

TOP

Related Classes of org.apache.openejb.jee.oejb2.EjbRelationType

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.