Search in sources :

Example 1 with CryptoException

use of org.wso2.carbon.core.util.CryptoException in project carbon-business-process by wso2.

the class AnalyticsServerProfileBuilder method parseAnalyticsProfile.

/**
 * Parse Analytics Profile file content and adding content to AnalyticsProfile instance.
 *
 * @param content                Content of Analytics Profile
 * @param analyticsServerProfile AnalyticsServerProfile instance
 */
private void parseAnalyticsProfile(String content, AnalyticsServerProfile analyticsServerProfile) {
    try {
        OMElement resourceElement = new StAXOMBuilder(new ByteArrayInputStream(content.getBytes())).getDocumentElement();
        processAnalyticsServerProfileName(resourceElement, analyticsServerProfile);
        processCredentialElement(resourceElement, analyticsServerProfile);
        processConnectionElement(resourceElement, analyticsServerProfile);
        processStreamsElement(resourceElement, analyticsServerProfile);
    } catch (XMLStreamException e) {
        String errMsg = "Error occurred while creating the OMElement out of Analytics server " + "profile: " + profileLocation;
        handleError(errMsg, e);
    } catch (CryptoException e) {
        String errMsg = "Error occurred while decrypting password in Analytics server profile: " + profileLocation;
        handleError(errMsg, e);
    }
}
Also used : XMLStreamException(javax.xml.stream.XMLStreamException) ByteArrayInputStream(java.io.ByteArrayInputStream) OMElement(org.apache.axiom.om.OMElement) StAXOMBuilder(org.apache.axiom.om.impl.builder.StAXOMBuilder) CryptoException(org.wso2.carbon.core.util.CryptoException)

Aggregations

ByteArrayInputStream (java.io.ByteArrayInputStream)1 XMLStreamException (javax.xml.stream.XMLStreamException)1 OMElement (org.apache.axiom.om.OMElement)1 StAXOMBuilder (org.apache.axiom.om.impl.builder.StAXOMBuilder)1 CryptoException (org.wso2.carbon.core.util.CryptoException)1