Examples of AttributeBean


Examples of AttributeBean

    public void testBean () throws Exception {
        MessageContext msgContext = new MessageContext(new AxisServer());
        SOAPEnvelope msg = new SOAPEnvelope();
       
        // Create bean with data
        AttributeBean bean = new AttributeBean();
        bean.setAge(35);
        bean.setID(1.15F);
        bean.setMale(true);
        bean.setName("James Bond");
       
        RPCParam arg = new RPCParam("", "struct", bean);
        RPCElement body = new RPCElement("urn:myNamespace", "method1", new Object[]{ arg });
        msg.addBodyElement(body);
        body.setEncodingStyle(null);
       
        Writer stringWriter = new StringWriter();
        SerializationContext context = new SerializationContextImpl(stringWriter, msgContext);
        context.setDoMultiRefs(false)// no multirefs
        context.setPretty(false);
       
        // Create a TypeMapping and register the Bean serializer/deserializer
        TypeMappingRegistry reg = context.getTypeMappingRegistry();
        TypeMapping tm = (TypeMapping) reg.createTypeMapping();
        // The "" namespace is literal (no encoding).
        tm.setSupportedNamespaces(new String[] {Constants.URI_CURRENT_SOAP_ENC});
        reg.register(Constants.URI_CURRENT_SOAP_ENC, tm);
       
        QName beanQName = new QName("typeNS", "TheBean");
        tm.register(AttributeBean.class,
                    beanQName,
                    new BeanSerializerFactory(AttributeBean.class, beanQName),
                    new BeanDeserializerFactory(AttributeBean.class, beanQName));

        // Serialize the bean in to XML
        msg.output(context);
        // Get the XML as a string
        String msgString = stringWriter.toString();

        log.debug("---");
        log.debug(msgString);
        log.debug("---");

        Message message = new Message(msgString);
        message.setMessageContext(msgContext);
        SOAPEnvelope env = message.getSOAPPart().getAsSOAPEnvelope();
        RPCElement rpcEl = (RPCElement)env.getFirstBody();
        Vector params = rpcEl.getParams();
        assertEquals("Wrong # of params in deserialized message!",
                     1,
                     params.size());

        Object obj = ((RPCParam)params.get(0)).getValue();
        assertTrue("Deserialized param not an AttributeBean!",
                   (obj instanceof AttributeBean));

        AttributeBean deserBean = (AttributeBean)obj;
        assertTrue("Deserialized bean not equal to expected values!",
                   (bean.equals(deserBean)));
    }

Examples of com.ipc.oce.objects.AttributeBean

      while (locRs.next()) {
        _OCCommonRef obj = (_OCCommonRef) locRs.getObject(1);
        _OCCommonObject commonObject = obj.getObject();
        boolean objectChanged = false;
        if (commonObject instanceof AttributeBean) {
          AttributeBean aBean = (AttributeBean) commonObject;
          Iterator<String> iter = mappedSet.keySet().iterator();
          while (iter.hasNext()) {
            String key = iter.next();
            Object value = mappedSet.get(key);
            //System.out.println(key + " => " + value);
            aBean.setAttributeValue(key, new OCVariant(value));
           
            if (!objectChanged) {
              objectChanged = true;
            }
          }

Examples of com.sun.faces.config.beans.AttributeBean

                                       digester.getMatch() +
                                       "} Push " + CLASS_NAME);
        }
        Class clazz =
            digester.getClassLoader().loadClass(CLASS_NAME);
        AttributeBean ab = (AttributeBean) clazz.newInstance();
        digester.push(ab);

    }

Examples of org.apache.cxf.aegis.services.AttributeBean

       
        AegisType type = mapping.getTypeCreator().createType(AttributeBean.class);
        type.setSchemaType(new QName("urn:Bean", "bean"));

        Context messageContext = new Context(context);
        AttributeBean bean = new AttributeBean();
        Element element = writeObjectToElement(type, bean, messageContext);
        assertValid("/b:root[@xyzzy:attrExplicitString]", element);
        assertXPathEquals("/b:root/@xyzzy:attrExplicitString", "attrExplicit", element);
        assertValid("/b:root[@attrPlainString]", element);
        assertXPathEquals("/b:root/@attrPlainString", "attrPlain", element);

Examples of org.apache.cxf.aegis.services.AttributeBean

       
        AegisType type = mapping.getTypeCreator().createType(AttributeBean.class);
        type.setSchemaType(new QName("urn:Bean", "bean"));

        Context messageContext = new Context(context);
        AttributeBean bean = new AttributeBean();
        Element element = writeObjectToElement(type, bean, messageContext);
        assertValid("/b:root[@xyzzy:attrExplicitString]", element);
        assertXPathEquals("/b:root/@xyzzy:attrExplicitString", "attrExplicit", element);
        assertValid("/b:root[@pkg:attrPlainString]", element);
        assertXPathEquals("/b:root/@pkg:attrPlainString", "attrPlain", element);

Examples of org.apache.shale.clay.config.beans.AttributeBean

        link.setRenderId(generateId());
        link.setJsfid("commandLink");
        link.setComponentType("javax.faces.HtmlCommandLink");

        // add a value attribute
        AttributeBean attr = new AttributeBean();
        attr.setName("value");
        attr.setValue(item.getLabel());
        link.addAttribute(attr);

        // turn on the the immediate attribute so the validation
        // logic is not invoked when switching tabs
        attr = new AttributeBean();
        attr.setName("immediate");
        attr.setValue("true");
        link.addAttribute(attr);

        // add a action method binding event when the link is clicked
        attr = new AttributeBean();
        attr.setName("action");
        attr.setValue("#{@managed-bean-name.changeTab}");
        link.addAttribute(attr);

        // create a parameter
        ElementBean param = new ElementBean();
        param.setJsfid("param");
        param.setComponentType("javax.faces.Parameter");
        // RenderId is the key to the Map. Increment for each new parameter
        param.setRenderId(generateId());

       
        // add a query param for the selected tab index
        attr = new AttributeBean();
        attr.setName("name");
        attr.setValue("tabIndex");
        param.addAttribute(attr);

        // add a query parameter for the tab index
        attr = new AttributeBean();
        attr.setName("value");
        attr.setValue(((Integer) item.getValue()).toString());
        param.addAttribute(attr);

        // add a parameter to the commandLink
        link.addChild(param);

Examples of org.apache.ws.security.saml.ext.bean.AttributeBean

        String tokenType = providerParameters.getTokenRequirements().getTokenType();

        AttributeStatementBean attrBean = new AttributeStatementBean();
        while (claimIterator.hasNext()) {
            Claim claim = claimIterator.next();
            AttributeBean attributeBean = new AttributeBean();
           
            URI claimType = claim.getClaimType();
            if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType)
                || WSConstants.SAML2_NS.equals(tokenType)) {
                attributeBean.setQualifiedName(claimType.toString());
                attributeBean.setNameFormat(nameFormat);
            } else {
                String uri = claimType.toString();
                int lastSlash = uri.lastIndexOf("/");
                if (lastSlash == (uri.length() - 1)) {
                    uri = uri.substring(0, lastSlash);
                    lastSlash = uri.lastIndexOf("/");
                }

                String namespace = uri.substring(0, lastSlash);
                String name = uri.substring(lastSlash + 1, uri.length());
               
                attributeBean.setSimpleName(name);
                attributeBean.setQualifiedName(namespace);
            }
            attributeBean.setAttributeValues(claim.getValues());
            attributeList.add(attributeBean);
        }
        attrBean.setSamlAttributes(attributeList);

        return attrBean;

Examples of org.apache.ws.security.saml.ext.bean.AttributeBean

        AttributeStatementBean attrBean = new AttributeStatementBean();
        List<AttributeBean> attributeList = new ArrayList<AttributeBean>();

        TokenRequirements tokenRequirements = providerParameters.getTokenRequirements();
        String tokenType = tokenRequirements.getTokenType();
        AttributeBean attributeBean = createDefaultAttribute(tokenType);
        attributeList.add(attributeBean);
       
        ReceivedToken actAs = tokenRequirements.getActAs();
        try {
            if (actAs != null) {
                AttributeBean parameterBean =
                    handleAdditionalParameters(actAs.getToken(), tokenType);
                if (!parameterBean.getAttributeValues().isEmpty()) {
                    attributeList.add(parameterBean);
                }
            }
        } catch (WSSecurityException ex) {
            throw new STSException(ex.getMessage(), ex);

Examples of org.apache.ws.security.saml.ext.bean.AttributeBean

   
    /**
     * Create a default attribute
     */
    private AttributeBean createDefaultAttribute(String tokenType) {
        AttributeBean attributeBean = new AttributeBean();

        if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType)
            || WSConstants.SAML2_NS.equals(tokenType)) {
            attributeBean.setQualifiedName("token-requestor");
            attributeBean.setNameFormat("http://cxf.apache.org/sts");
        } else {
            attributeBean.setSimpleName("token-requestor");
            attributeBean.setQualifiedName("http://cxf.apache.org/sts");
        }
       
        attributeBean.setAttributeValues(Collections.singletonList("authenticated"));
       
        return attributeBean;
    }

Examples of org.apache.ws.security.saml.ext.bean.AttributeBean

                    ? CastUtils.<String>cast((List<?>)m.getContextualProperty("saml.roles")) : null;
                if (roles == null) {
                    roles = Collections.singletonList("user");
                }
                List<AttributeBean> claims = new ArrayList<AttributeBean>();
                AttributeBean roleClaim = new AttributeBean();
                roleClaim.setSimpleName("subject-role");
                roleClaim.setQualifiedName(Claim.DEFAULT_ROLE_NAME);
                roleClaim.setNameFormat(Claim.DEFAULT_NAME_FORMAT);
                roleClaim.setAttributeValues(roles);
                claims.add(roleClaim);
               
                List<String> authMethods =
                    m != null ? CastUtils.<String>cast((List<?>)m.getContextualProperty("saml.auth")) : null;
                if (authMethods == null) {
                    authMethods = Collections.singletonList("password");
                }
               
                AttributeBean authClaim = new AttributeBean();
                authClaim.setSimpleName("http://claims/authentication");
                authClaim.setQualifiedName("http://claims/authentication");
                authClaim.setNameFormat("http://claims/authentication-format");
                authClaim.setAttributeValues(authMethods);
                claims.add(authClaim);
               
                attrBean.setSamlAttributes(claims);
                callback.setAttributeStatementData(Collections.singletonList(attrBean));
            }
TOP
Copyright © 2018 www.massapi.com. 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.