Turned subscription service into a subsystem

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28919 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Florian Mü
2011-07-11 15:10:55 +00:00
parent 9adcac3910
commit 10a9817d08
7 changed files with 43 additions and 8 deletions

View File

@@ -451,7 +451,7 @@ public class LocalFeedTaskProcessor extends FeedTaskProcessor implements Applica
{
Set<String> result = new HashSet<String>();
if (subscriptionService.subscriptionsEnabled())
if (subscriptionService.isActive())
{
PagingFollowingResults fr = subscriptionService.getFollowers(userId, new PagingRequest(1000000, null));

View File

@@ -89,6 +89,8 @@ public class SubscriptionServiceImpl implements SubscriptionService
protected NamespaceService namespaceService;
protected FileFolderService fileFolderService;
protected boolean active;
/**
* Sets the subscriptions DAO.
*/
@@ -161,6 +163,11 @@ public class SubscriptionServiceImpl implements SubscriptionService
this.fileFolderService = fileFolderService;
}
public final void setActive(boolean active)
{
this.active = active;
}
@Override
public PagingSubscriptionResults getSubscriptions(String userId, SubscriptionItemTypeEnum type,
PagingRequest pagingRequest)
@@ -352,9 +359,9 @@ public class SubscriptionServiceImpl implements SubscriptionService
}
@Override
public boolean subscriptionsEnabled()
public boolean isActive()
{
return true;
return active;
}
/**
@@ -362,7 +369,7 @@ public class SubscriptionServiceImpl implements SubscriptionService
*/
protected void checkEnabled()
{
if (!subscriptionsEnabled())
if (!isActive())
{
throw new SubscriptionsDisabledException("subscription_service.err.disabled");
}

View File

@@ -19,6 +19,7 @@
package org.alfresco.service.cmr.subscriptions;
import org.alfresco.query.PagingRequest;
import org.alfresco.repo.management.subsystems.ActivateableBean;
import org.alfresco.service.Auditable;
import org.alfresco.service.NotAuditable;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -29,7 +30,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
* @author Florian Mueller
* @since 4.0
*/
public interface SubscriptionService
public interface SubscriptionService extends ActivateableBean
{
// --- subscription ---
@@ -204,5 +205,5 @@ public interface SubscriptionService
* Returns if subscription are enabled for this system.
*/
@NotAuditable
boolean subscriptionsEnabled();
boolean isActive();
}