当前位置: 首页>>代码示例>>Java>>正文


Java OMElement.getChildrenWithLocalName方法代码示例

本文整理汇总了Java中org.apache.axiom.om.OMElement.getChildrenWithLocalName方法的典型用法代码示例。如果您正苦于以下问题:Java OMElement.getChildrenWithLocalName方法的具体用法?Java OMElement.getChildrenWithLocalName怎么用?Java OMElement.getChildrenWithLocalName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axiom.om.OMElement的用法示例。


在下文中一共展示了OMElement.getChildrenWithLocalName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: readIdpConfigs

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void readIdpConfigs(OMElement documentElement) {
    OMElement idpConfigsElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil.
            getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_IDP_CONFIGS));

    if (idpConfigsElem != null) {
        // for each and every external idp defined, create an ExternalIdPConfig instance
        for (Iterator idpConfigElements = idpConfigsElem.getChildrenWithLocalName(FrameworkConstants.Config.ELEM_IDP_CONFIG);
             idpConfigElements.hasNext(); ) {

            ExternalIdPConfig idpConfig = processIdPConfigElement((OMElement) idpConfigElements.next());

            if (idpConfig != null) {
                idpList.add(idpConfig);
            }
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:18,代码来源:FileBasedConfigurationBuilder.java

示例2: readAuthenticatorConfigs

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void readAuthenticatorConfigs(OMElement documentElement) {
    OMElement authenticatorConfigsElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil.
            getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_AUTHENTICATOR_CONFIGS));

    if (authenticatorConfigsElem != null) {
        // for each and every authenticator defined, create an AuthenticatorConfig instance
        for (Iterator authenticatorConfigElements = authenticatorConfigsElem.getChildrenWithLocalName(FrameworkConstants.Config.ELEM_AUTHENTICATOR_CONFIG);
             authenticatorConfigElements.hasNext(); ) {
            AuthenticatorConfig authenticatorConfig = processAuthenticatorConfigElement((OMElement) authenticatorConfigElements.next());

            if (authenticatorConfig != null) {
                this.authenticatorConfigMap.put(authenticatorConfig.getName(), authenticatorConfig);
            }
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:17,代码来源:FileBasedConfigurationBuilder.java

示例3: readTenantDataListenerURLs

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void readTenantDataListenerURLs(OMElement documentElement) {
    OMElement tenantDataURLsElem =
            documentElement.getFirstChildWithName(IdentityApplicationManagementUtil.
                    getQNameWithIdentityApplicationNS(
                            FrameworkConstants.Config.QNAME_TENANT_DATA_LISTENER_URLS));

    if (tenantDataURLsElem != null) {
        for (Iterator tenantDataURLElems = tenantDataURLsElem.getChildrenWithLocalName(
                FrameworkConstants.Config.ELEM_TENANT_DATA_LISTENER_URL);
             tenantDataURLElems.hasNext(); ) {

            OMElement tenantDataListenerURLElem = (OMElement) tenantDataURLElems.next();
            if (tenantDataListenerURLElem != null &&
                StringUtils.isNotEmpty(tenantDataListenerURLElem.getText())) {
                tenantDataEndpointURLs.add(IdentityUtil.fillURLPlaceholders(tenantDataListenerURLElem.getText()));
            }
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:20,代码来源:FileBasedConfigurationBuilder.java

示例4: createRuleElementDTOs

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public static List<RuleElementDTO> createRuleElementDTOs(String policy)
        throws EntitlementPolicyCreationException {

    List<RuleElementDTO> ruleElementDTOs = new ArrayList<RuleElementDTO>();
    OMElement omElement;
    try {
        omElement = AXIOMUtil.stringToOM(policy);
    } catch (XMLStreamException e) {
        throw new EntitlementPolicyCreationException("Policy can not be converted to OMElement");
    }

    if (omElement != null) {
        Iterator iterator2 = omElement.getChildrenWithLocalName(EntitlementPolicyConstants.
                RULE_ELEMENT);
        while (iterator2.hasNext()) {
            OMElement ruleElement = (OMElement) iterator2.next();
            ruleElementDTOs.add(createRuleDTO(ruleElement));
        }
    }
    return ruleElementDTOs;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:22,代码来源:PolicyEditorUtil.java

示例5: updateESBConfiguration

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * Method to update current synapse config provided a new one.
 *
 * @param synapseConfig the new synapse configuration
 * @throws Exception if an error occurs during update
 */
protected void updateESBConfiguration(OMElement synapseConfig) throws Exception {

    if (synapseConfiguration == null) {
        synapseConfiguration = synapseConfig;
    } else {
        Iterator<OMElement> itr = synapseConfig.cloneOMElement().getChildElements();
        while (itr.hasNext()) {
            synapseConfiguration.addChild(itr.next());
        }
    }
    updateESBConfiguration(setEndpoints(synapseConfig), contextUrls.getBackEndUrl(), sessionCookie);

    if (context.getProductGroup().isClusterEnabled()) {
        long deploymentDelay = Long.parseLong(context.getConfigurationValue("//deploymentDelay"));
        Thread.sleep(deploymentDelay);
        Iterator<OMElement> proxies = synapseConfig.getChildrenWithLocalName("proxy");
        while (proxies.hasNext()) {
            String proxy = proxies.next().getAttributeValue(new QName("name"));

            Assert.assertTrue(isProxyWSDlExist(getProxyServiceURLHttp(proxy), deploymentDelay),
                    "Deployment Synchronizing failed in workers");
        }
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:31,代码来源:ESBSampleIntegrationTest.java

示例6: insertAndTestTimeStampValuesInDbTest

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
@Test(groups = {"wso2.dss"}, description = "insert timestamp in America/New_York timezone and UTC timezone, retrieve all and compare whether all are same", alwaysRun = true)
public void insertAndTestTimeStampValuesInDbTest() throws Exception {
    OMElement payload = fac.createOMElement("getTimeStamps", omNs);

    OMElement result = new AxisServiceClient().sendReceive(payload, backendUrl + serviceName, "getTimeStamps");

    Iterator iterator = result.getChildrenWithLocalName("timeStamp");

    String timeStampString = null;

    while (iterator.hasNext()) {
        OMElement timeStamp = (OMElement) iterator.next();
        if (timeStampString == null) {
            timeStampString = timeStamp.getChildrenWithLocalName("testTimeStamp").next().toString();
        } else {
            String tempTimeStamp = timeStamp.getChildrenWithLocalName("testTimeStamp").next().toString();
            Assert.assertTrue(timeStampString.equals(tempTimeStamp));
        }
    }
    Assert.assertNotNull(result, "Response message null ");
    log.debug(result);
    log.info("data service insert same timestamp to the database when the server is in different timezones");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:24,代码来源:DS1069DifferentTimeStampStoreIssueTestCase.java

示例7: createRuleDTO

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public static RuleElementDTO createRuleDTO(OMElement omElement) {
    RuleElementDTO ruleElementDTO = new RuleElementDTO();

    if (omElement != null) {
        ruleElementDTO.setRuleId(omElement.
                getAttributeValue(new QName(EntitlementPolicyConstants.RULE_ID)).trim());
        ruleElementDTO.setRuleEffect(omElement.
                getAttributeValue(new QName(EntitlementPolicyConstants.RULE_EFFECT)).trim());

        Iterator iterator1 = omElement.
                getChildrenWithLocalName(EntitlementPolicyConstants.DESCRIPTION_ELEMENT);

        while (iterator1.hasNext()) {
            OMElement descriptionElement = (OMElement) iterator1.next();
            if (descriptionElement != null && descriptionElement.getText() != null) {
                ruleElementDTO.setRuleDescription(descriptionElement.getText().trim());
            }
        }
    }

    return ruleElementDTO;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:23,代码来源:PolicyEditorUtil.java

示例8: readProperties

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * @param configElem
 * @return
 */
public static Properties readProperties(OMElement configElem) {

    Properties properties = new Properties();
    OMElement propsElem = configElem
            .getFirstChildWithName(getQNameWithIdentityApplicationNS(IdentityApplicationConstants.ConfigElements.PROPERTIES));
    if (propsElem != null) {
        Iterator propItr = propsElem
                .getChildrenWithLocalName(IdentityApplicationConstants.ConfigElements.PROPERTY);
        for (; propItr.hasNext(); ) {
            OMElement propElem = (OMElement) propItr.next();
            String propName = propElem.getAttributeValue(
                    new QName(IdentityApplicationConstants.ConfigElements.ATTR_NAME)).trim();
            String propValue = propElem.getText().trim();
            properties.put(propName, propValue);
            if (log.isDebugEnabled()) {
                log.debug("Property name : " + propName + ", Property Value : " + propValue);
            }
        }
    }
    return properties;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:26,代码来源:IdentityApplicationManagementUtil.java

示例9: searchXACML3Designator

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * This searches through  designator and selector values in the attribute elements to extract
 * the policy meta data
 *
 * @param omElement    apply element as an OMElement
 * @param attributeDTO AttributeDTO object which holds the policy meta data in String format
 * @return AttributeValueDTO object which holds the policy meta data in String format
 */
public AttributeDTO searchXACML3Designator(OMElement omElement,
                                           AttributeDTO attributeDTO) {

    Iterator iterator1 = omElement.
            getChildrenWithLocalName(PDPConstants.ATTRIBUTE_DESIGNATOR);
    while (iterator1.hasNext()) {
        OMElement attributeDesignator = (OMElement) iterator1.next();
        if (attributeDesignator != null) {
            String attributeId = attributeDesignator.
                    getAttributeValue(new QName(PDPConstants.ATTRIBUTE_ID));
            String category = attributeDesignator.
                    getAttributeValue(new QName(PDPConstants.CATEGORY));
            String dataType = attributeDesignator.
                    getAttributeValue(new QName(PDPConstants.DATA_TYPE));
            attributeDTO.setCategory(category);
            attributeDTO.setAttributeId(attributeId);
            attributeDTO.setAttributeDataType(dataType);
        }
    }

    return attributeDTO;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:31,代码来源:PolicyAttributeBuilder.java

示例10: createMetaDataFromConditionElement

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * This extract policy meta data from condition element in the policy
 *
 * @param omElement     condition element as an OMElement
 * @param attributeDTOs list of AttributeDTO object which holds the policy meta data
 *                      in String format
 * @return list of AttributeDTO object which holds the policy meta data in String format
 */
public List<AttributeDTO> createMetaDataFromConditionElement(OMElement omElement,
                                                             List<AttributeDTO> attributeDTOs) {

    Iterator iterator = omElement.getChildrenWithLocalName(PDPConstants.APPLY_ELEMENT);
    if (iterator.hasNext()) {
        if (version == XACMLConstants.XACML_VERSION_3_0) {
            createMetaDataFromXACML3ApplyElement(omElement, attributeDTOs);
        } else {
            createMetaDataFromApplyElement(omElement, attributeDTOs);
        }
    } else {
        AttributeDTO attributeDTO = new AttributeDTO();
        attributeDTO.setCategory(PDPConstants.UNKNOWN);
        attributeDTO.setAttributeValue(PDPConstants.SEARCH_WARNING_MESSAGE4);
    }

    // TODO currently only search meta data on Apply Element, support for other elements 
    return attributeDTOs;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:28,代码来源:PolicyAttributeBuilder.java

示例11: testPropertyWithinIteratorMediator

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
@Test(groups = {"wso2.esb"}, description = "Defining a property within Iterator")
public void testPropertyWithinIteratorMediator() throws IOException, XMLStreamException {
    int responseCount = 0;
    for (int i = 0; i < 10; i++) {
        String Response = aggregatedRequestClient.getResponse();
        Assert.assertNotNull(Response);
        OMElement Response2 = AXIOMUtil.stringToOM(Response);
        OMElement soapBody = Response2.getFirstElement();
        Iterator iterator = soapBody.getChildrenWithLocalName("getQuoteResponse");

        while (iterator.hasNext()) {

            OMElement omeReturn = (OMElement) iterator.next();
            responseCount++;
            Iterator<OMElement> itr = omeReturn.getFirstElement().getChildrenWithLocalName("symbol");
            boolean isSymbolFound = false;
            while (itr.hasNext()) {
                OMElement symbol = itr.next();
                //to get the number attached by iterator mediator
                String[] values = symbol.getText().split(" ");
                Assert.assertEquals(values.length, 2, "Response does not contained the property value attached by Iterator mediator");
                double property = Double.parseDouble(values[1]);
                //value must be less tha to 16
                Assert.assertTrue(16 > property, "Value attached by Iterator mediator to response must be less than to 16");

                isSymbolFound = true;
            }
            Assert.assertTrue(isSymbolFound, "Symbol Element not found in the response message");
        }
        Assert.assertEquals(responseCount, responseCount, "Response does not contains all getQuoteResponses as in the request");
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:33,代码来源:PropertyWithinSequenceTestCase.java

示例12: readAuthenticatorNameMappings

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void readAuthenticatorNameMappings(OMElement documentElement) {
    OMElement authenticatorNameMappingsElem = documentElement.getFirstChildWithName(IdentityApplicationManagementUtil.
            getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_AUTHENTICATOR_NAME_MAPPINGS));

    if (authenticatorNameMappingsElem != null) {
        for (Iterator authenticatorNameMappingElems = authenticatorNameMappingsElem.getChildrenWithLocalName(FrameworkConstants.Config.ELEM_AUTHENTICATOR_NAME_MAPPING);
             authenticatorNameMappingElems.hasNext(); ) {
            processAuthenticatorNameMappingElement((OMElement) authenticatorNameMappingElems.next());
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:12,代码来源:FileBasedConfigurationBuilder.java

示例13: readAuthenticationEndpointQueryParams

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
private void readAuthenticationEndpointQueryParams(OMElement documentElement) {
    OMElement authEndpointQueryParamsElem = documentElement
            .getFirstChildWithName(IdentityApplicationManagementUtil
                                           .getQNameWithIdentityApplicationNS(FrameworkConstants.Config.QNAME_AUTH_ENDPOINT_QUERY_PARAMS));

    if (authEndpointQueryParamsElem != null) {

        authEndpointQueryParamsConfigAvailable = true;
        OMAttribute actionAttr = authEndpointQueryParamsElem.getAttribute(new QName(
                FrameworkConstants.Config.ATTR_AUTH_ENDPOINT_QUERY_PARAM_ACTION));
        authEndpointQueryParamsAction = FrameworkConstants.AUTH_ENDPOINT_QUERY_PARAMS_ACTION_EXCLUDE;

        if (actionAttr != null) {
            String actionValue = actionAttr.getAttributeValue();

            if (actionValue != null && !actionValue.isEmpty()) {
                authEndpointQueryParamsAction = actionValue;
            }
        }


        for (Iterator authEndpointQueryParamElems = authEndpointQueryParamsElem
                .getChildrenWithLocalName(FrameworkConstants.Config.ELEM_AUTH_ENDPOINT_QUERY_PARAM); authEndpointQueryParamElems
                     .hasNext(); ) {
            String queryParamName = processAuthEndpointQueryParamElem((OMElement) authEndpointQueryParamElems
                    .next());

            if (queryParamName != null) {
                this.authEndpointQueryParams.add(queryParamName);
            }
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:34,代码来源:FileBasedConfigurationBuilder.java

示例14: updateESBConfiguration

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
protected void updateESBConfiguration(OMElement synapseConfig) throws Exception {

		if (synapseConfiguration == null) {
			synapseConfiguration = synapseConfig;
		} else {
			Iterator<OMElement> itr = synapseConfig.cloneOMElement().getChildElements();
			while (itr.hasNext()) {
				synapseConfiguration.addChild(itr.next());
			}
		}
		esbUtils.updateESBConfiguration(setEndpoints(synapseConfig), contextUrls.getBackEndUrl(), sessionCookie);

		if (context.getProductGroup().isClusterEnabled()) {
			long deploymentDelay = Long.parseLong(context.getConfigurationValue("//deploymentDelay"));
			Thread.sleep(deploymentDelay);
			Iterator<OMElement> proxies = synapseConfig.getChildrenWithLocalName("proxy");
			while (proxies.hasNext()) {
				String proxy = proxies.next().getAttributeValue(new QName("name"));

				Assert.assertTrue(isProxyWSDlExist(getProxyServiceURLHttp(proxy), deploymentDelay)
						, "Deployment Synchronizing failed in workers");
				Assert.assertTrue(isProxyWSDlExist(getProxyServiceURLHttp(proxy), deploymentDelay)
						, "Deployment Synchronizing failed in workers");
				Assert.assertTrue(isProxyWSDlExist(getProxyServiceURLHttp(proxy), deploymentDelay)
						, "Deployment Synchronizing failed in workers");
			}
		}
	}
 
开发者ID:wso2,项目名称:product-ei,代码行数:29,代码来源:ESBIntegrationTest.java

示例15: createMetaDataFromXACML3TargetElement

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * This extract policy meta data from target element in the policy
 *
 * @param omElement     target element as an OMElement
 * @param attributeDTOs list of AttributeDTO object which holds the policy meta data
 *                      in String format
 * @return list of AttributeDTO object which holds the policy meta data in String format
 */
public List<AttributeDTO> createMetaDataFromXACML3TargetElement(OMElement omElement,
                                                                List<AttributeDTO> attributeDTOs) {

    if (omElement != null) {

        Iterator iterator1 = omElement.
                getChildrenWithLocalName(PDPConstants.ANY_OF);
        while (iterator1.hasNext()) {

            OMElement anyOff = (OMElement) iterator1.next();

            Iterator iterator2 = anyOff.
                    getChildrenWithLocalName(PDPConstants.ALL_OF);

            while (iterator2.hasNext()) {
                OMElement allOf = (OMElement) iterator2.next();

                Iterator iterator3 = allOf.
                        getChildrenWithLocalName(PDPConstants.MATCH_ELEMENT);

                while (iterator3.hasNext()) {
                    OMElement resourceMatch = (OMElement) iterator3.next();
                    List<AttributeDTO> attributeDTOList =
                            createMetaDataFromXACML3MatchElement(resourceMatch);
                    for (AttributeDTO attributeDTO : attributeDTOList) {
                        attributeDTOs.add(attributeDTO);
                    }
                }
            }
        }
    }

    return attributeDTOs;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:43,代码来源:PolicyAttributeBuilder.java


注:本文中的org.apache.axiom.om.OMElement.getChildrenWithLocalName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。