org.apache.james.impl.vut
Class VirtualUserTableUtil

java.lang.Object
  extended by org.apache.james.impl.vut.VirtualUserTableUtil

public class VirtualUserTableUtil
extends java.lang.Object

This helper class contains methods for the VirtualUserTable implementations


Field Summary
static java.lang.String QUERY
           
 
Method Summary
static java.lang.String CollectionToMapping(java.util.Collection map)
          Convert a Collection which holds mappings to a raw mapping String
static java.util.Collection getMappings(java.lang.String rawMapping)
          Deprecated. Use mappingToCollection(String rawMapping)
static java.lang.String getSeparator(java.lang.String targetString)
          Returns the character used to delineate multiple addresses.
static java.lang.String getTargetString(java.lang.String user, java.lang.String domain, java.util.Map mappings)
          Returns the real recipient given a virtual username and domain.
static java.util.Map getXMLMappings(java.lang.String mapping)
          Returns a Map which contains the mappings
static java.util.ArrayList mappingToCollection(java.lang.String rawMapping)
          Convert a raw mapping String to a Collection
static java.lang.String regexMap(org.apache.mailet.MailAddress address, java.lang.String targetString)
          Processes regex virtual user mapping If a mapped target string begins with the prefix regex:, it must be formatted as regex::, e.g., regex:(.*)@(.*):${1}@tld
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUERY

public static java.lang.String QUERY
Method Detail

regexMap

public static java.lang.String regexMap(org.apache.mailet.MailAddress address,
                                        java.lang.String targetString)
                                 throws org.apache.oro.text.regex.MalformedPatternException
Processes regex virtual user mapping If a mapped target string begins with the prefix regex:, it must be formatted as regex::, e.g., regex:(.*)@(.*):${1}@tld

Parameters:
address - the MailAddress to be mapped
targetString - a String specifying the mapping
Throws:
org.apache.oro.text.regex.MalformedPatternException

getTargetString

public static java.lang.String getTargetString(java.lang.String user,
                                               java.lang.String domain,
                                               java.util.Map mappings)
Returns the real recipient given a virtual username and domain.

Parameters:
user - the virtual user
domain - the virtual domain
Returns:
the real recipient address, or null if no mapping exists

getSeparator

public static java.lang.String getSeparator(java.lang.String targetString)
Returns the character used to delineate multiple addresses.

Parameters:
targetString - the string to parse
Returns:
the character to tokenize on

getXMLMappings

public static java.util.Map getXMLMappings(java.lang.String mapping)
Returns a Map which contains the mappings

Parameters:
mapping - A String which contains a list of mappings
Returns:
Map which contains the mappings

getMappings

public static java.util.Collection getMappings(java.lang.String rawMapping)
Deprecated. Use mappingToCollection(String rawMapping)

Return a Collection which holds the extracted mappings of the given String

Parameters:
rawMapping -

mappingToCollection

public static java.util.ArrayList mappingToCollection(java.lang.String rawMapping)
Convert a raw mapping String to a Collection

Parameters:
rawMapping - the mapping Strin
Returns:
map a collection which holds all mappings

CollectionToMapping

public static java.lang.String CollectionToMapping(java.util.Collection map)
Convert a Collection which holds mappings to a raw mapping String

Parameters:
map - the Collection
Returns:
mapping the mapping String


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.