Search in sources :

Example 1 with EventPublisherConfigurationFile

use of org.wso2.carbon.event.publisher.core.config.EventPublisherConfigurationFile in project identity-governance by wso2-extensions.

the class ResourceManagerImpl method destroyEventPublisherConfiguration.

/**
 * This is used to destroy an existing EventPublisher.
 * As per the implementation in analytics-common we need to add the publisher as a file before destroying it.
 *
 * @param eventPublisherConfiguration Event Publisher Configuration.
 * @throws ConfigurationManagementException Configuration Management Exception.
 */
private void destroyEventPublisherConfiguration(EventPublisherConfiguration eventPublisherConfiguration) throws EventPublisherConfigurationException {
    int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
    EventPublisherConfigurationFile eventPublisherConfigurationFile = new EventPublisherConfigurationFile();
    eventPublisherConfigurationFile.setTenantId(tenantId);
    eventPublisherConfigurationFile.setEventPublisherName(eventPublisherConfiguration.getEventPublisherName());
    eventPublisherConfigurationFile.setFileName(eventPublisherConfiguration.getEventPublisherName());
    eventPublisherConfigurationFile.setStatus(EventPublisherConfigurationFile.Status.DEPLOYED);
    TenantResourceManagerDataHolder.getInstance().getCarbonEventPublisherService().addEventPublisherConfigurationFile(eventPublisherConfigurationFile, tenantId);
    TenantResourceManagerDataHolder.getInstance().getCarbonEventPublisherService().removeEventPublisherConfigurationFile(eventPublisherConfiguration.getEventPublisherName(), tenantId);
}
Also used : EventPublisherConfigurationFile(org.wso2.carbon.event.publisher.core.config.EventPublisherConfigurationFile)

Aggregations

EventPublisherConfigurationFile (org.wso2.carbon.event.publisher.core.config.EventPublisherConfigurationFile)1