use of org.wso2.carbon.bpel.core.ode.integration.config.analytics.AnalyticsStreamConfiguration in project carbon-business-process by wso2.
the class AnalyticsPublisherExtensionOperation method getEventStream.
private AnalyticsStreamConfiguration getEventStream(int tenantId, String analyticsServerProfileName, String streamName, String streamVersion) {
AnalyticsServerProfile analyticsServerProfile = getAnalyticsServerProfile(tenantId, analyticsServerProfileName);
if (null == analyticsServerProfile) {
String errMsg = "AnalyticsServerProfile not found for stream name and version " + streamName + " " + streamVersion;
log.error(errMsg);
return null;
}
return analyticsServerProfile.getAnalyticsStreamConfiguration(streamName, streamVersion);
}
use of org.wso2.carbon.bpel.core.ode.integration.config.analytics.AnalyticsStreamConfiguration in project carbon-business-process by wso2.
the class AnalyticsPublisherExtensionOperation method runSync.
@Override
protected void runSync(ExtensionContext extensionContext, Element element) throws FaultException {
String analyticsServerProfileName = element.getAttribute("analyticsServerProfile");
String streamName = element.getAttribute(AnalyticsPublisherConstants.STREAM_NAME_ATTR);
String streamVersion = element.getAttribute(AnalyticsPublisherConstants.STREAM_VERSION);
Integer tenantId = getTenantId(extensionContext);
AnalyticsStreamConfiguration stream = getEventStream(tenantId, analyticsServerProfileName, streamName, streamVersion);
if (stream == null) {
log.debug("Stream configuration is invalid");
return;
}
DataPublisher dataPublisher = getDataPublisher(extensionContext, tenantId, analyticsServerProfileName);
if (dataPublisher == null) {
String msg = "Error while creating data publisher";
handleException(msg);
}
String streamId = DataBridgeCommonsUtils.generateStreamId(stream.getName(), stream.getVersion());
dataPublisher.tryPublish(streamId, createMetadata(stream, extensionContext, element), createCorrelationData(stream, extensionContext, element), createPayloadData(stream, extensionContext, element));
}
Aggregations