/*
 * $Id: OwnerAddress.java 562 2006-05-29 21:38:29Z skot $
 * $URL: http://subetha.tigris.org/svn/subetha/branches/resin/core/src/org/subethamail/core/util/OwnerAddress.java $
 */

package org.subethamail.core.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * Abstracts the handling of -owner list addresses.
 * 
 * An owner address looks like this:
 * 
 * announce-owner@domain.com
 * 
 * The extracted email will be announce@domain.com
 * 
 * @author Jeff Schnitzer
 */
public class OwnerAddress
{
	/** */
	private final static Logger log = LoggerFactory.getLogger(OwnerAddress.class);
	
	/** This is the suffix of all VERP'd addresses, plus the '@' */
	public static final String SUFFIX = "-owner@";
	
	/** default constructor prevents util class from being created. */
	private OwnerAddress() {}

	/**
	 * @return null if the address was not an owner address  
	 */
	public static String getList(String maybeOwner)
	{
		// Note the suffix includes the @
		int suffixIndex = maybeOwner.indexOf(SUFFIX);
		if (suffixIndex < 0)
			return null;
		
		String email = maybeOwner.substring(0, suffixIndex) + '@' + maybeOwner.substring(suffixIndex+SUFFIX.length());
		
		if (log.isDebugEnabled())
			log.debug(maybeOwner + " becomes " + email);
		
		return email;
	}
	
	/**
	 * @return an email address encoded with the token.
	 */
	public static String makeOwner(String listEmail)
	{
		int atIndex = listEmail.indexOf('@');
		
		return listEmail.substring(0, atIndex)
			+ SUFFIX 
			+ listEmail.substring(atIndex+1);
	}
}


	
@@ -230,57 +230,65 @@
 ort 
-org.slf4j.Logger;%0D%0Aimport org.slf4j.LoggerFactory
+java.util.logging.Level;%0D%0A%0D%0Aimport lombok.extern.java.Log
 ;%0D%0A%0D
@@ -520,16 +520,22 @@
 r%0D%0A */%0D%0A
+@Log%0D%0A
 public c
@@ -560,101 +560,8 @@
 %0A%7B%0D%0A
-%09/** */%0D%0A%09private final static Logger log = LoggerFactory.getLogger(OwnerAddress.class);%0D%0A%09%0D%0A
 %09/**
@@ -1164,70 +1164,106 @@
 g.is
-DebugEnabled(
+Loggable(Level.FINE
 ))%0D%0A%09%09
-%09
-log.debug(maybeOwner + %22 becomes %22 +
+    log.log(Level.FINE,%22%7B0%7D becomes %7B1%7D%22, new Object%5B%5D%7BmaybeOwner,
  email
+%7D
 );%0D%0A

switch logging framework