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


Java OMElement.getAttributeValue方法代码示例

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


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

示例1: 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

示例2: addMessageStore

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * @param backEndUrl
 * @param sessionCookie
 * @param messageStore
 * @throws java.rmi.RemoteException
 */
public void addMessageStore(String backEndUrl, String sessionCookie, OMElement messageStore)
		throws Exception {
	MessageStoreAdminClient messageStoreAdminClient = new MessageStoreAdminClient(backEndUrl, sessionCookie);
	messageStoreAdminClient.addMessageStore(messageStore);
	String mStoreName = messageStore.getAttributeValue(new QName(NAME));
	Assert.assertTrue(isMessageStoreDeployed(backEndUrl, sessionCookie, mStoreName), "Message Store Deployment failed");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:14,代码来源:ESBTestCaseUtils.java

示例3: createMetaDataFromXACML3MatchElement

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

    List<AttributeDTO> attributeDTOs = new ArrayList<AttributeDTO>();
    String attributeId = null;
    String category = null;

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

        Iterator iterator3 = omElement.
                getChildrenWithLocalName(PDPConstants.ATTRIBUTE_VALUE);
        while (iterator3.hasNext()) {
            OMElement attributeElement = (OMElement) iterator3.next();
            if (attributeElement != null) {
                String dataType = attributeElement.
                        getAttributeValue(new QName(PDPConstants.DATA_TYPE));
                AttributeDTO attributeDTO = new AttributeDTO();
                attributeDTO.setAttributeValue(attributeElement.getText());
                attributeDTO.setAttributeId(attributeId);
                attributeDTO.setAttributeDataType(dataType);
                attributeDTO.setCategory(category);
                attributeDTOs.add(attributeDTO);
            }
        }
    }
    return attributeDTOs;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:44,代码来源:PolicyAttributeBuilder.java

示例4: addProxyService

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * @param backEndUrl
 * @param sessionCookie
 * @param proxyConfig
 * @throws javax.xml.stream.XMLStreamException
 * @throws java.io.IOException
 * @throws org.wso2.carbon.proxyadmin.stub.ProxyServiceAdminProxyAdminException
 * @throws InterruptedException
 */
public void addProxyService(String backEndUrl, String sessionCookie, OMElement proxyConfig)
		throws Exception {
	ProxyServiceAdminClient proxyAdmin = new ProxyServiceAdminClient(backEndUrl, sessionCookie);
	proxyAdmin.addProxyService(proxyConfig);
	String proxyName = proxyConfig.getAttributeValue(new QName(NAME));
	Assert.assertTrue(isProxyDeployed(backEndUrl, sessionCookie, proxyName),
	                  "Proxy Deployment failed or time out");

}
 
开发者ID:wso2,项目名称:product-ei,代码行数:19,代码来源:ESBTestCaseUtils.java

示例5: parseOrder

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * @param payload XML message content came inside the JMS message
 * @throws XMLStreamException on error
 */
private void parseOrder(String payload) throws XMLStreamException {
    InputStream is = new ByteArrayInputStream(payload.getBytes());
    javax.xml.stream.XMLStreamReader parser = XMLInputFactory
            .newInstance().createXMLStreamReader(is);
    StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser,
            null);
    SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
    // retrieve SOAP body
    SOAPBody soapBody = envelope.getBody();
    OMElement messageNode = soapBody.getFirstChildWithName(new QName(
            FIX_MSG));
    Iterator<?> messageElements = (Iterator<?>) messageNode
            .getChildElements();
    while (messageElements.hasNext()) {
        OMElement node = (OMElement) messageElements.next();
        if (node.getQName().getLocalPart().equals(FIX_MSG_BODY)) {
            Iterator<?> bodyElements = (Iterator<?>) node.getChildElements();
            while (bodyElements.hasNext()) {
                OMElement bodyNode = (OMElement) bodyElements.next();
                String tag = bodyNode
                        .getAttributeValue(new QName(FIX_MSG_ID));
                String value = bodyNode.getText();
                if (tag.equals(FIX_MSG_SYMBOL)) {
                    inSymbol = value;
                } else if (tag.equals(FIX_MSG_CLORDID)) {
                    inClOrderID = value;
                } else if (tag.equals(FIX_MSG_ORDQTY)) {
                    inQty = value;
                }
            }
        }
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:38,代码来源:AMQPConsumer.java

示例6: addPriorityExecutor

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
public void addPriorityExecutor(String backEndUrl, String sessionCookie,
                                OMElement priorityExecutor)
		throws RemoteException {
	PriorityMediationAdminClient priorityMediationAdminClient = new PriorityMediationAdminClient(backEndUrl, sessionCookie);
	String executorName = priorityExecutor.getAttributeValue(new QName(NAME));
	priorityMediationAdminClient.addPriorityMediator(executorName, priorityExecutor);
	Assert.assertTrue(isPriorityExecutorDeployed(backEndUrl, sessionCookie, executorName), "Priority Executor deployment failed");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:9,代码来源:ESBTestCaseUtils.java

示例7: addMessageProcessor

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * @param backEndUrl
 * @param sessionCookie
 * @param messageProcessor
 * @throws java.rmi.RemoteException
 */
public void addMessageProcessor(String backEndUrl, String sessionCookie,
                                OMElement messageProcessor)
		throws Exception {
	MessageProcessorClient messageProcessorClient = new MessageProcessorClient(backEndUrl, sessionCookie);
	messageProcessorClient.addMessageProcessor(messageProcessor);
	String mProcessorName = messageProcessor.getAttributeValue(new QName(NAME));
	Assert.assertTrue(isMessageProcessorDeployed(backEndUrl, sessionCookie, mProcessorName), "Message Processor deployment failed");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:15,代码来源:ESBTestCaseUtils.java

示例8: addSequence

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * @param backEndUrl
 * @param sessionCookie
 * @param sequenceConfig
 * @throws Exception
 */
public void addSequence(String backEndUrl, String sessionCookie, OMElement sequenceConfig)
		throws Exception {
	SequenceAdminServiceClient sequenceAdminClient = new SequenceAdminServiceClient(backEndUrl,
	                                                                                sessionCookie);
	sequenceAdminClient.addSequence(sequenceConfig);
	String sqn = sequenceConfig.getAttributeValue(new QName(NAME));
	Assert.assertTrue(isSequenceDeployed(backEndUrl, sessionCookie, sqn),
	                  sqn + "Sequence deployment not found or time out");

}
 
开发者ID:wso2,项目名称:product-ei,代码行数:17,代码来源:ESBTestCaseUtils.java

示例9: updateSecondaryUserStore

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
/**
 * Encrypts the secondary user store configuration
 *
 * @param secondaryStoreDocument OMElement of respective file path
 * @param cipher                 Cipher object read for super-tenant's key store
 * @throws UserStoreConfigurationDeployerException If update operation failed
 */
private void updateSecondaryUserStore(OMElement secondaryStoreDocument, Cipher cipher) throws
        UserStoreConfigurationDeployerException {
    String className = secondaryStoreDocument.getAttributeValue(new QName(UserStoreConfigurationConstants.PROPERTY_CLASS));
    ArrayList<String> encryptList = getEncryptPropertyList(className);
    Iterator<?> ite = secondaryStoreDocument.getChildrenWithName(new QName(UserStoreConfigurationConstants.PROPERTY));
    while (ite.hasNext()) {
        OMElement propElem = (OMElement) ite.next();

        if (propElem != null && (propElem.getText() != null)) {
            String propertyName = propElem.getAttributeValue(new QName(UserStoreConfigurationConstants.PROPERTY_NAME));

            OMAttribute encryptedAttr = propElem.getAttribute(new QName(UserStoreConfigurationConstants
                    .PROPERTY_ENCRYPTED));
            if (encryptedAttr == null) {
                boolean encrypt = encryptList.contains(propertyName) || isEligibleTobeEncrypted(propElem);
                if (encrypt) {
                    OMAttribute encryptAttr = propElem.getAttribute(new QName(UserStoreConfigurationConstants.PROPERTY_ENCRYPT));
                    if (encryptAttr != null) {
                        propElem.removeAttribute(encryptAttr);
                    }

                    try {
                        String cipherText = Base64.encode(cipher.doFinal((propElem.getText().getBytes())));
                        propElem.setText(cipherText);
                        propElem.addAttribute(UserStoreConfigurationConstants.PROPERTY_ENCRYPTED, "true", null);
                    } catch (GeneralSecurityException e) {
                        String errMsg = "Encryption in secondary user store failed";
                        throw new UserStoreConfigurationDeployerException(errMsg, e);
                    }
                }
            }
        }
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:42,代码来源:UserStoreConfigurationDeployer.java

示例10: addSequenceTemplate

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
protected void addSequenceTemplate(OMElement sequenceTemplate) throws Exception {
	String name = sequenceTemplate.getAttributeValue(new QName("name"));
	if (esbUtils.isSequenceTemplateExist(contextUrls.getBackEndUrl(), sessionCookie, name)) {
		esbUtils.deleteSequenceTemplate(contextUrls.getBackEndUrl(), sessionCookie, name);
	}
	esbUtils.addSequenceTemplate(contextUrls.getBackEndUrl(), sessionCookie, setEndpoints(sequenceTemplate));

	if (sequenceTemplateList == null) {
		sequenceTemplateList = new ArrayList<String>();
	}
	sequenceTemplateList.add(name);
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:13,代码来源:ESBIntegrationTest.java

示例11: addApi

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
protected void addApi(OMElement api) throws Exception {
	String apiName = api.getAttributeValue(new QName("name"));
	if (esbUtils.isApiExist(contextUrls.getBackEndUrl(), sessionCookie, apiName)) {
		esbUtils.deleteApi(contextUrls.getBackEndUrl(), sessionCookie, apiName);
	}
	esbUtils.addAPI(contextUrls.getBackEndUrl(), sessionCookie, api);

	if (apiList == null) {
		apiList = new ArrayList<String>();
	}
	apiList.add(apiName);
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:13,代码来源:ESBIntegrationTest.java

示例12: addInboundEndpoint

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
protected void addInboundEndpoint(OMElement inboundEndpoint) throws Exception {
	String inboundName = inboundEndpoint.getAttributeValue(new QName("name"));
	if (inboundEndpointList == null) {
		inboundEndpointList = new ArrayList<String>();
	}
	inboundEndpointList.add(inboundName);
	esbUtils.addInboundEndpoint(contextUrls.getBackEndUrl(), sessionCookie, inboundEndpoint);
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:9,代码来源:ESBIntegrationTest.java

示例13: addSequence

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
protected void addSequence(OMElement sequenceConfig) throws Exception {
	String sequenceName = sequenceConfig.getAttributeValue(new QName("name"));
	if (esbUtils.isSequenceExist(contextUrls.getBackEndUrl(), sessionCookie, sequenceName)) {
		esbUtils.deleteSequence(contextUrls.getBackEndUrl(), sessionCookie, sequenceName);
	}
	esbUtils.addSequence(contextUrls.getBackEndUrl(), sessionCookie, setEndpoints(sequenceConfig));
	if (sequencesList == null) {
		sequencesList = new ArrayList<String>();
	}
	sequencesList.add(sequenceName);
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:12,代码来源:ESBIntegrationTest.java

示例14: addEndpoint

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
protected void addEndpoint(OMElement endpointConfig)
		throws Exception {
	String endpointName = endpointConfig.getAttributeValue(new QName("name"));
	if (esbUtils.isSequenceExist(contextUrls.getBackEndUrl(), sessionCookie, endpointName)) {
		esbUtils.deleteEndpoint(contextUrls.getBackEndUrl(), sessionCookie, endpointName);
	}
	esbUtils.addEndpoint(contextUrls.getBackEndUrl(), sessionCookie, setEndpoints(endpointConfig));
	if (endpointsList == null) {
		endpointsList = new ArrayList<String>();
	}
	endpointsList.add(endpointName);

}
 
开发者ID:wso2,项目名称:product-ei,代码行数:14,代码来源:ESBIntegrationTest.java

示例15: addLocalEntry

import org.apache.axiom.om.OMElement; //导入方法依赖的package包/类
protected void addLocalEntry(OMElement localEntryConfig) throws Exception {
	String localEntryName = localEntryConfig.getAttributeValue(new QName("key"));
	if (esbUtils.isLocalEntryExist(contextUrls.getBackEndUrl(), sessionCookie, localEntryName)) {
		esbUtils.deleteLocalEntry(contextUrls.getBackEndUrl(), sessionCookie, localEntryName);
	}
	esbUtils.addLocalEntry(contextUrls.getBackEndUrl(), sessionCookie, localEntryConfig);

	if (localEntryList == null) {
		localEntryList = new ArrayList<String>();
	}
	localEntryList.add(localEntryName);
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:13,代码来源:ESBIntegrationTest.java


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