/*
 * $Id$
 * $URL$
 */

package org.subethamail.web.action;

import java.util.List;

import lombok.Getter;
import lombok.Setter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.subethamail.core.lists.i.SubscriberData;
import org.subethamail.web.Backend;
import org.subethamail.web.action.auth.AuthAction;
import org.subethamail.web.model.PaginateModel;

/**
 * Gets a list of subscribers to the list
 * 
 * @author Jeff Schnitzer
 * @author Jon Stevens
 */
public class GetSubscribers extends AuthAction 
{
	/** */
	@SuppressWarnings("unused")
	private final static Logger log = LoggerFactory.getLogger(GetMyListRelationship.class);

	/** */
	public static class Model extends PaginateModel
	{
		/** */
		@Getter @Setter Long listId;
		@Getter @Setter String query = "";
		@Getter @Setter List<SubscriberData> subscribers;
	}

	public void initialize()
	{
		this.getCtx().setModel(new Model());
	}

	/** */
	public void execute() throws Exception
	{
		Model model = (Model)this.getCtx().getModel();
		
		if (model.query.trim().length() == 0)
		{
			model.subscribers = Backend.instance().getListMgr().getSubscribers(model.listId, model.getSkip(), model.getCount());
			model.setTotalCount(Backend.instance().getListMgr().countSubscribers(model.listId));
		}
		else
		{
			model.subscribers = Backend.instance().getListMgr().searchSubscribers(model.listId, model.query, model.getSkip(), model.getCount());
			model.setTotalCount(Backend.instance().getListMgr().countSubscribersQuery(model.listId, model.query));
			// See the comment in GetLists
		}
	}
}

@@ -138,67 +138,40 @@
 r;%0D%0A
-%0D%0A
 import 
-org.slf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory;
+lombok.extern.java.Log;%0D%0A
 %0D%0Aim
@@ -470,16 +470,22 @@
 s%0D%0A */%0D%0A
+@Log%0D%0A
 public c
@@ -532,139 +532,8 @@
 %0A%7B%0D%0A
-%09/** */%0D%0A%09@SuppressWarnings(%22unused%22)%0D%0A%09private final static Logger log = LoggerFactory.getLogger(GetMyListRelationship.class);%0D%0A%0D%0A
 %09/**

switch logging framework