Search in sources :

Example 1 with TBPSAnalytics

use of org.wso2.carbon.bps.common.analytics.config.TBPSAnalytics in project carbon-business-process by wso2.

the class BPSAnalyticsConfiguration method initConfigurationFromFile.

/**
 * Initialize the configuration object from the properties in the BPS Analytics config xml file.
 */
private void initConfigurationFromFile(File BPSAnalyticsConfigurationFile) {
    SecretResolver secretResolver = null;
    try (InputStream in = new FileInputStream(BPSAnalyticsConfigurationFile)) {
        StAXOMBuilder builder = new StAXOMBuilder(in);
        secretResolver = SecretResolverFactory.create(builder.getDocumentElement(), true);
    } catch (Exception e) {
        log.warn("Error occurred while retrieving secured BPS Analytics configuration.", e);
    }
    TBPSAnalytics tBPSAnalytics = bpsAnalyticsDocument.getBPSAnalytics();
    if (tBPSAnalytics == null) {
        return;
    }
    if (tBPSAnalytics.getAnalyticServer() != null) {
        initAnalytics(secretResolver, tBPSAnalytics.getAnalyticServer());
    }
    if (tBPSAnalytics.getBPMN() != null) {
        initBPMNAnalytics(tBPSAnalytics.getBPMN());
    }
}
Also used : SecretResolver(org.wso2.securevault.SecretResolver) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) StAXOMBuilder(org.apache.axiom.om.impl.builder.StAXOMBuilder) FileInputStream(java.io.FileInputStream) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) XmlException(org.apache.xmlbeans.XmlException) TBPSAnalytics(org.wso2.carbon.bps.common.analytics.config.TBPSAnalytics)

Aggregations

FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 StAXOMBuilder (org.apache.axiom.om.impl.builder.StAXOMBuilder)1 XmlException (org.apache.xmlbeans.XmlException)1 TBPSAnalytics (org.wso2.carbon.bps.common.analytics.config.TBPSAnalytics)1 SecretResolver (org.wso2.securevault.SecretResolver)1