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

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


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

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

            try {
                TenantManager.acquireWriteLock();
                Tenant tenant = TenantManager.getInstance().getTenant(event.getTenantId());
                if(tenant == null) {
                    if(log.isWarnEnabled()) {
                        log.warn(String.format("Tenant not found: [tenant-id] %d", event.getTenantId()));
                    }
                    return false;
                }
                tenant.setTenantDomain(event.getTenantDomain());

                if(log.isInfoEnabled()) {
                    log.info(String.format("Tenant updated: [tenant-id] %d [tenant-domain] %s", tenant.getTenantId(), tenant.getTenantDomain()));
                }
View Full Code Here


        public void onTenantUpdate(TenantInfoBean tenantInfo) throws StratosException {
            try {
                if(log.isInfoEnabled()) {
                    log.info(String.format("Publishing tenant updated event: [tenant-id] %d [tenant-domain] %s", tenantInfo.getTenantId(), tenantInfo.getTenantDomain()));
                }
                TenantUpdatedEvent event = new TenantUpdatedEvent(tenantInfo.getTenantId(), tenantInfo.getTenantDomain());
                EventPublisher eventPublisher = EventPublisherPool.getPublisher(Constants.TENANT_TOPIC);
                eventPublisher.publish(event);
            }
            catch (Exception e) {
                log.error("Could not publish tenant updated event");
View Full Code Here

TOP

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

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.