use of org.wso2.carbon.bpel.core.ode.integration.config.analytics.AnalyticsServerProfile in project carbon-business-process by wso2.
the class AnalyticsPublisherExtensionOperation method getDataPublisher.
private DataPublisher getDataPublisher(ExtensionContext context, int tenantId, String analyticsServerProfileName) throws FaultException {
DataPublisher dataPublisher = null;
TenantProcessStore tenantsProcessStore = AnalyticsPublisherServiceComponent.getBPELServer().getMultiTenantProcessStore().getTenantsProcessStore(tenantId);
String processName = context.getProcessModel().getName().toString();
dataPublisher = (DataPublisher) tenantsProcessStore.getDataPublisher(processName);
// Create new DataPublisher if not created already.
if (dataPublisher == null) {
AnalyticsServerProfile analyticsServerProfile = getAnalyticsServerProfile(tenantId, analyticsServerProfileName);
try {
dataPublisher = new DataPublisher(analyticsServerProfile.getType(), analyticsServerProfile.getReceiverURLSet(), analyticsServerProfile.getAuthURLSet(), analyticsServerProfile.getUserName(), analyticsServerProfile.getPassword());
} catch (TransportException e) {
String errorMsg = "Transport layer problem.";
handleException(errorMsg, e);
} catch (DataEndpointAuthenticationException e) {
String errorMsg = "Data endpoint authentication problem.";
handleException(errorMsg, e);
} catch (DataEndpointAgentConfigurationException e) {
String errorMsg = "Data endpoint agent configuration problem.";
handleException(errorMsg, e);
} catch (DataEndpointException e) {
String errorMsg = "Data endpoint problem.";
handleException(errorMsg, e);
} catch (DataEndpointConfigurationException e) {
String errorMsg = "Data endpoint configuration problem.";
handleException(errorMsg, e);
}
if (log.isDebugEnabled()) {
log.debug("Data Publisher Created : " + analyticsServerProfile.toString());
}
if (dataPublisher != null) {
tenantsProcessStore.addDataPublisher(processName, dataPublisher);
}
}
return dataPublisher;
}
use of org.wso2.carbon.bpel.core.ode.integration.config.analytics.AnalyticsServerProfile 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);
}
}
Aggregations