Package org.apache.stratos.messaging.event.tenant

Examples of org.apache.stratos.messaging.event.tenant.TenantRemovedEvent


            if(!TenantManager.getInstance().isInitialized()) {
                return false;
            }

            // Parse complete message and build event
            TenantRemovedEvent event = (TenantRemovedEvent) Util.jsonToObject(message, TenantRemovedEvent.class);

            try {
                TenantManager.acquireWriteLock();
                Tenant tenant = TenantManager.getInstance().getTenant(event.getTenantId());
                if(tenant == null) {
                    if(log.isWarnEnabled()) {
                        log.warn(String.format("Tenant already removed: [tenant-id] %d", event.getTenantId()));
                    }
                }
                else {
                    TenantManager.getInstance().removeTenant(event.getTenantId());
                    if(log.isInfoEnabled()) {
                        log.info(String.format("Tenant removed: [tenant-id] %d [tenant-domain] %s", tenant.getTenantId(), tenant.getTenantDomain()));
                    }
                }
View Full Code Here


        public void onTenantDelete(int tenantId) {
            try {
                if(log.isInfoEnabled()) {
                    log.info(String.format("Publishing tenant removed event: [tenant-id] %d", tenantId));
                }
                TenantRemovedEvent event = new TenantRemovedEvent(tenantId);
                EventPublisher eventPublisher = EventPublisherPool.getPublisher(Constants.TENANT_TOPIC);
                eventPublisher.publish(event);
            }
            catch (Exception e) {
                log.error("Could not publish tenant removed event");
View Full Code Here

TOP

Related Classes of org.apache.stratos.messaging.event.tenant.TenantRemovedEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.