diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index db99ddb99d1..25275cb3342 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -52,6 +52,10 @@ + + org.apache.felix + maven-scr-plugin + org.apache.felix maven-bundle-plugin diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java index 3e42caf5a0d..780bff683b2 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java @@ -26,11 +26,13 @@ import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherServiceImpl; +/** + * @scr.component name="org.wso2.carbon.apimgt.webapp.publisher" immediate="true" + */ public class APIPublisherServiceComponent { private static Log log = LogFactory.getLog(APIPublisherServiceComponent.class); - @SuppressWarnings("unused") protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -48,7 +50,6 @@ public class APIPublisherServiceComponent { } } - @SuppressWarnings("unused") protected void deactivate(ComponentContext componentContext) { //do nothing } diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java index cff114bf40c..2fd0a5b07ec 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/task/MonitoringTask.java @@ -77,14 +77,13 @@ public class MonitoringTask implements Task { try { - DeviceManagementProviderService deviceManagementProviderService = PolicyManagementDataHolder.getInstance().getDeviceManagementService(); for (DeviceType deviceType : deviceTypes) { - if(log.isDebugEnabled()){ - log.debug("Running task for device type : " + deviceType.getName() ); + if (log.isDebugEnabled()) { + log.debug("Running task for device type : " + deviceType.getName()); } PolicyMonitoringService monitoringService = @@ -100,15 +99,21 @@ public class MonitoringTask implements Task { deviceType.getName()); } for (Device device : devices) { - if (device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.INACTIVE) || - device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.BLOCKED)) { + EnrolmentInfo.Status status = device.getEnrolmentInfo().getStatus(); + if (status.equals(EnrolmentInfo.Status.INACTIVE) || + status.equals(EnrolmentInfo.Status.BLOCKED) || + status.equals(EnrolmentInfo.Status.REMOVED) || + status.equals(EnrolmentInfo.Status.UNCLAIMED) || + status.equals(EnrolmentInfo.Status.DISENROLLMENT_REQUESTED) || + status.equals(EnrolmentInfo.Status.SUSPENDED)) { continue; } else { notifiableDevices.add(device); } } if (log.isDebugEnabled()) { - log.debug("Following devices selected to send the notification for " + deviceType.getName()); + log.debug("Following devices selected to send the notification for " + + deviceType.getName()); for (Device device : notifiableDevices) { log.debug(device.getDeviceIdentifier()); }