Coding standards and consistency sweep across new services code in repository project.

Covers spacing, trailing {, @since tags, tabs and copyright headers.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30211 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gavin Cornwell
2011-09-02 21:10:49 +00:00
parent 8fddcdfd1b
commit 79093bd8ae
228 changed files with 3085 additions and 3161 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -36,6 +36,7 @@ import org.springframework.extensions.surf.util.I18NUtil;
* Notification service implementation.
*
* @author Roy Wetherall
* @since 4.0
*/
public class NotificationServiceImpl implements NotificationService
{
@@ -49,58 +50,58 @@ public class NotificationServiceImpl implements NotificationService
/** Map of registered notification providers */
private Map<String, NotificationProvider> providers = new HashMap<String, NotificationProvider>(3);
/**
* @see org.alfresco.service.cmr.notification.NotificationService#register(org.alfresco.service.cmr.notification.NotificationProvider)
*/
@Override
public void register(NotificationProvider notificationProvider)
{
// Check mandatory params
ParameterCheck.mandatory("notificationProvider", notificationProvider);
// Add the notification provider to the map
providers.put(notificationProvider.getName(), notificationProvider);
}
/**
* @see org.alfresco.service.cmr.notification.NotificationService#exists(java.lang.String)
*/
@Override
public boolean exists(String notificationProvider)
{
// Check the mandatory params
ParameterCheck.mandatory("notificationProvider", notificationProvider);
return providers.containsKey(notificationProvider);
}
/**
* @see org.alfresco.service.cmr.notification.NotificationService#register(org.alfresco.service.cmr.notification.NotificationProvider)
*/
@Override
public void register(NotificationProvider notificationProvider)
{
// Check mandatory params
ParameterCheck.mandatory("notificationProvider", notificationProvider);
// Add the notification provider to the map
providers.put(notificationProvider.getName(), notificationProvider);
}
/**
* @see org.alfresco.service.cmr.notification.NotificationService#getNotificationProviders()
*/
@Override
public List<String> getNotificationProviders()
{
return new ArrayList<String>(providers.keySet());
}
/**
* @see org.alfresco.service.cmr.notification.NotificationService#sendNotification(java.lang.String, org.alfresco.service.cmr.notification.NotificationContext)
*/
@Override
public void sendNotification(String notificationProvider, NotificationContext notificationContext)
{
// Check the mandatory params
ParameterCheck.mandatory("notificationProvider", notificationProvider);
ParameterCheck.mandatory("notificationContext", notificationContext);
// Check that the notificaiton provider exists
if (exists(notificationProvider) == false)
{
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NP_DOES_NOT_EXIST, notificationProvider));
}
// Get the notification provider and send notification
NotificationProvider provider = providers.get(notificationProvider);
provider.sendNotification(notificationContext);
}
/**
* @see org.alfresco.service.cmr.notification.NotificationService#exists(java.lang.String)
*/
@Override
public boolean exists(String notificationProvider)
{
// Check the mandatory params
ParameterCheck.mandatory("notificationProvider", notificationProvider);
return providers.containsKey(notificationProvider);
}
/**
* @see org.alfresco.service.cmr.notification.NotificationService#getNotificationProviders()
*/
@Override
public List<String> getNotificationProviders()
{
return new ArrayList<String>(providers.keySet());
}
/**
* @see org.alfresco.service.cmr.notification.NotificationService#sendNotification(java.lang.String, org.alfresco.service.cmr.notification.NotificationContext)
*/
@Override
public void sendNotification(String notificationProvider, NotificationContext notificationContext)
{
// Check the mandatory params
ParameterCheck.mandatory("notificationProvider", notificationProvider);
ParameterCheck.mandatory("notificationContext", notificationContext);
// Check that the notificaiton provider exists
if (exists(notificationProvider) == false)
{
throw new AlfrescoRuntimeException(I18NUtil.getMessage(MSG_NP_DOES_NOT_EXIST, notificationProvider));
}
// Get the notification provider and send notification
NotificationProvider provider = providers.get(notificationProvider);
provider.sendNotification(notificationContext);
}
}