本文整理了Java中org.apache.axiom.om.impl.llom.util.AXIOMUtil
类的一些代码示例,展示了AXIOMUtil
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AXIOMUtil
类的具体详情如下:
包路径:org.apache.axiom.om.impl.llom.util.AXIOMUtil
类名称:AXIOMUtil
暂无
代码示例来源:origin: org.wso2.carbon.mediation/org.wso2.carbon.rest.api.ui
public static OMElement createOMElementFrom(String omString) {
try {
return AXIOMUtil.stringToOM(omString);
} catch (XMLStreamException e) {
// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
return null;
}
public String getStatus(String xmlstring) throws Exception {
OMElement response = null;
OMElement result = null;
OMElement decision = null;
response = AXIOMUtil.stringToOM(xmlstring);
result = response.getFirstChildWithName(new QName("Result"));
if (result != null) {
decision = result.getFirstChildWithName(new QName("Decision"));
if (decision != null) {
return decision.getText();
}
}
return "Invalid Status";
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement.proxy
public String getStatus(String xmlstring) throws Exception {
OMElement response = null;
OMElement result = null;
OMElement decision = null;
response = AXIOMUtil.stringToOM(xmlstring);
result = response.getFirstChildWithName(new QName("Result"));
if (result != null) {
decision = result.getFirstChildWithName(new QName("Decision"));
if (decision != null) {
return decision.getText();
}
}
return "Invalid Status";
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement.proxy
public OMElement[] getStatusOMElement(String xmlstring) throws Exception {
OMElement response = null;
OMElement result = null;
OMElement[] decision = new OMElement[3];
response = AXIOMUtil.stringToOM(xmlstring);
result = response.getFirstChildWithName(new QName("Result"));
if (result != null) {
decision[0] = result.getFirstChildWithName(new QName("Decision"));
decision[1] = result.getFirstChildWithName(new QName("Obligations"));
decision[2] = result.getFirstChildWithName(new QName("AssociatedAdvice"));
}
return decision;
}
代码示例来源:origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.gateway
/**
* Deploy the sequence to the gateway
*
* @param sequence - The sequence element , which to be deployed in synapse
* @throws AxisFault
*/
public boolean addSequence(String sequence) throws AxisFault {
SequenceAdminServiceClient client = getSequenceAdminServiceClient();
if (sequence != null && !sequence.isEmpty()) {
OMElement element = null;
try {
element = AXIOMUtil.stringToOM(sequence);
client.addSequence(element);
return true;
} catch (XMLStreamException e) {
log.error("Exception occurred while converting String to an OM.", e);
}
}
return false;
}
public OMElement[] getStatusOMElement(String xmlstring) throws Exception {
OMElement response = null;
OMElement result = null;
OMElement[] decision = new OMElement[3];
response = AXIOMUtil.stringToOM(xmlstring);
result = response.getFirstChildWithName(new QName("Result"));
if (result != null) {
decision[0] = result.getFirstChildWithName(new QName("Decision"));
decision[1] = result.getFirstChildWithName(new QName("Obligations"));
decision[2] = result.getFirstChildWithName(new QName("AssociatedAdvice"));
}
return decision;
}
代码示例来源:origin: org.wso2.carbon.apimgt/org.wso2.carbon.apimgt.gateway
/**
* Deploy the sequence to the gateway
*
* @param sequence
* @param tenantDomain
* @throws AxisFault
*/
public boolean addSequenceForTenant(String sequence, String tenantDomain) throws AxisFault {
SequenceAdminServiceClient client = getSequenceAdminServiceClient();
if (sequence != null && !sequence.isEmpty()) {
OMElement element = null;
try {
element = AXIOMUtil.stringToOM(sequence);
client.addSequenceForTenant(element, tenantDomain);
return true;
} catch (XMLStreamException e) {
log.error("Exception occurred while converting String to an OM.", e);
}
}
return false;
}
代码示例来源:origin: usnistgov/iheos-toolkit2
xcpd_response = AXIOMUtil.stringToOM(my_response);
} catch (XMLStreamException e) {
e.printStackTrace();
代码示例来源:origin: org.wso2.appfactory/appfactory-plugin
org.apache.axiom.om.impl.llom.util.AXIOMUtil.stringToOM(policyString));
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.base
public static Policy getSignOnlyPolicy() throws IdentityException {
Policy policy;
try {
OMElement policyOM = AXIOMUtil.stringToOM(policyString);
PolicyEngine policyEngine = new PolicyEngine();
policy = policyEngine.getPolicy(policyOM);
} catch (Exception e) {
String msg = "error building policy from " + policyString;
log.error(msg);
throw IdentityException.error(msg, e);
}
return policy;
}
代码示例来源:origin: wso2/carbon-identity-framework
public static Policy getSignOnlyPolicy() throws IdentityException {
Policy policy;
try {
OMElement policyOM = AXIOMUtil.stringToOM(policyString);
PolicyEngine policyEngine = new PolicyEngine();
policy = policyEngine.getPolicy(policyOM);
} catch (Exception e) {
String msg = "error building policy from " + policyString;
log.error(msg);
throw IdentityException.error(msg, e);
}
return policy;
}
代码示例来源:origin: wso2/carbon-identity-framework
/**
* Helper method to extract the boolean response
*
* @param xmlstring XACML resource as String
* @return Decision
* @throws Exception if fails
*/
public static String getStatus(String xmlstring) throws Exception {
OMElement response = null;
OMElement result = null;
OMElement decision = null;
response = AXIOMUtil.stringToOM(xmlstring);
OMNamespace nameSpace = response.getNamespace();
if (nameSpace != null) {
result = response.getFirstChildWithName(new QName(nameSpace.getNamespaceURI(), "Result"));
} else {
result = response.getFirstElement();
}
if (result != null) {
if (nameSpace != null) {
decision = result.getFirstChildWithName(new QName(nameSpace.getNamespaceURI(), "Decision"));
} else {
decision = result.getFirstChildWithName(new QName("Decision"));
}
if (decision != null) {
return decision.getText();
}
}
return "Invalid Status";
}
代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.entitlement.ui
/**
* Helper method to extract the boolean response
*
* @param xmlstring XACML resource as String
* @return Decision
* @throws Exception if fails
*/
public static String getStatus(String xmlstring) throws Exception {
OMElement response = null;
OMElement result = null;
OMElement decision = null;
response = AXIOMUtil.stringToOM(xmlstring);
OMNamespace nameSpace = response.getNamespace();
if (nameSpace != null) {
result = response.getFirstChildWithName(new QName(nameSpace.getNamespaceURI(), "Result"));
} else {
result = response.getFirstElement();
}
if (result != null) {
if (nameSpace != null) {
decision = result.getFirstChildWithName(new QName(nameSpace.getNamespaceURI(), "Decision"));
} else {
decision = result.getFirstChildWithName(new QName("Decision"));
}
if (decision != null) {
return decision.getText();
}
}
return "Invalid Status";
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement.ui
/**
* Helper method to extract the boolean response
*
* @param xmlstring XACML resource as String
* @return Decision
* @throws Exception if fails
*/
public static String getStatus(String xmlstring) throws Exception {
OMElement response = null;
OMElement result = null;
OMElement decision = null;
response = AXIOMUtil.stringToOM(xmlstring);
OMNamespace nameSpace = response.getNamespace();
if (nameSpace != null) {
result = response.getFirstChildWithName(new QName(nameSpace.getNamespaceURI(), "Result"));
} else {
result = response.getFirstElement();
}
if (result != null) {
if (nameSpace != null) {
decision = result.getFirstChildWithName(new QName(nameSpace.getNamespaceURI(), "Decision"));
} else {
decision = result.getFirstChildWithName(new QName("Decision"));
}
if (decision != null) {
return decision.getText();
}
}
return "Invalid Status";
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions
Resource configurationResource = registry.get(configurationResourcePath);
xmlContent = RegistryUtils.decodeBytes((byte[])configurationResource.getContent());
configurationElement = AXIOMUtil.stringToOM(xmlContent);
代码示例来源:origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.gateway
/**
* Deploy the sequence to the gateway for super tenant users.
*
* @param sequence - The sequence element , which to be deployed in synapse.
* @throws AppManagementException on errors.
*/
public void addSequence(String sequence) throws AppManagementException {
if (!StringUtils.isEmpty(sequence)) {
OMElement element = null;
try {
element = AXIOMUtil.stringToOM(sequence);
ServiceReferenceHolder.getInstance().getSequenceAdminService().addSequence(element);
} catch (SequenceEditorException e) {
String errorMsg = "Error while adding the sequence : " + sequence + " for super tenant.";
throw new AppManagementException(errorMsg, e);
} catch (XMLStreamException e) {
String errorMsg = "Error while streaming the sequence : " + sequence + " for super tenant.";
throw new AppManagementException(errorMsg, e);
}
}
}
代码示例来源:origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.gateway
/**
* Deploy the sequence to the gateway for tenant users.
*
* @param sequence - The sequence element , which to be deployed in synapse.
* @param tenantDomain the tenant domain of the user.
* @throws AppManagementException on errors.
*/
public void addSequenceForTenant(String sequence, String tenantDomain) throws AppManagementException {
if (!StringUtils.isEmpty(sequence)) {
OMElement element = null;
try {
element = AXIOMUtil.stringToOM(sequence);
ServiceReferenceHolder.getInstance().getSequenceAdminService().addSequenceForTenant(element,
tenantDomain);
} catch (SequenceEditorException e) {
String errorMsg = "Error while adding the sequence : " + sequence + " for tenant : " + tenantDomain;
throw new AppManagementException(errorMsg, e);
} catch (XMLStreamException e) {
String errorMsg = "Error while streaming the sequence : " + sequence + " for super tenant.";
throw new AppManagementException(errorMsg, e);
}
}
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions
configurationElement = AXIOMUtil.stringToOM(xmlContent);
代码示例来源:origin: org.wso2.greg/org.wso2.carbon.registry.samples.custom.topics.ui
OMElement endpointElement = AXIOMUtil.stringToOM(content);
代码示例来源:origin: wso2/wso2-synapse
OMElement re=AXIOMUtil.stringToOM((String) result);
if(re!=null){
textValue.append(re.getText());
内容来源于网络,如有侵权,请联系作者删除!