Codota Logo
org.apache.james.rrt.lib
Code IndexAdd Codota to your IDE (free)

How to use org.apache.james.rrt.lib

Best Java code snippets using org.apache.james.rrt.lib (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: org.apache.james/james-server-data-library

private Stream<Mapping> recurseMapping(Stream<Mapping> nonRecursiveResult, User targetUser, int remainingLoops) throws ErrorMappingException, RecipientRewriteTableException {
  Mappings childMappings = getMappings(targetUser, remainingLoops - 1);
  if (childMappings.isEmpty()) {
    return nonRecursiveResult;
  } else {
    return childMappings.asStream();
  }
}
origin: org.apache.james/james-server-file

/**
 * @see org.apache.james.rrt.lib.AbstractRecipientRewriteTable#mapAddressInternal(java.lang.String,
 *      java.lang.String)
 */
protected String mapAddressInternal(String user, String domain) throws RecipientRewriteTableException {
  if (mappings == null) {
    return null;
  } else {
    return RecipientRewriteTableUtil.getTargetString(user, domain, mappings);
  }
}
origin: org.apache.james/james-server-data-library

@Override
public void addForwardMapping(MappingSource source, String address) throws RecipientRewriteTableException {
  Mapping mapping = Mapping.forward(address)
    .appendDomainFromThrowingSupplierIfNone(this::defaultDomain);
  checkHasValidAddress(mapping);
  checkDuplicateMapping(source, mapping);
  LOGGER.info("Add forward mapping => {} for source: {}", mapping, source.asString());
  addMapping(source, mapping);
}
origin: org.apache.james/james-server-data-jpa

@Override
public void addMapping(MappingSource source, Mapping mapping) throws RecipientRewriteTableException {
  Mappings map = getUserDomainMappings(source);
  if (!map.isEmpty()) {
    Mappings updatedMappings = MappingsImpl.from(map).add(mapping).build();
    doUpdateMapping(source, updatedMappings.serialize());
  } else {
    doAddMapping(source, mapping.asString());
  }
}
origin: org.apache.james/james-server-data-file

protected void addMappingToConfiguration(MappingSource source, String mapping, Type type) throws RecipientRewriteTableException {
  Mappings mappings = Optional.ofNullable(virtualUserTable.getUserDomainMappings(source))
    .orElse(MappingsImpl.empty());
  Mappings updatedMappings = MappingsImpl.from(mappings)
    .add(Mapping.of(type, mapping))
    .build();
  updateConfiguration(source, mappings, updatedMappings);
}
origin: org.apache.james/james-server-data-library

@Override
public void addAddressMapping(MappingSource source, String address) throws RecipientRewriteTableException {
  Mapping mapping = Mapping.address(address)
    .appendDomainFromThrowingSupplierIfNone(this::defaultDomain);
  checkHasValidAddress(mapping);
  checkDuplicateMapping(source, mapping);
  LOGGER.info("Add address mapping => {} for source: {}", mapping, source.asString());
  addMapping(source, mapping);
}
origin: org.apache.james/james-server-data-library

@Override
public void addGroupMapping(MappingSource source, String address) throws RecipientRewriteTableException {
  Mapping mapping = Mapping.group(address)
    .appendDomainFromThrowingSupplierIfNone(this::defaultDomain);
  checkHasValidAddress(mapping);
  checkDuplicateMapping(source, mapping);
  LOGGER.info("Add group mapping => {} for source: {}", mapping, source.asString());
  addMapping(source, mapping);
}
origin: org.apache.james/james-server-data-library

@When("user \"([^\"]*)\" at domain \"([^\"]*)\" removes a error mapping \"([^\"]*)\"")
public void userAtDomainRemovesErrorMapping(String user, String domain, String error) throws Throwable {
  MappingSource source = MappingSource.fromUser(user, domain);
  rewriteTable.removeErrorMapping(source, error);
}
origin: org.apache.james/james-server-data-library

@When("user \"([^\"]*)\" at domain \"([^\"]*)\" removes a address mapping \"([^\"]*)\"")
public void userAtDomainRemovesAddressMapping(String user, String domain, String address) throws Throwable {
  MappingSource source = MappingSource.fromUser(user, domain);
  rewriteTable.removeAddressMapping(source, address);
}
origin: org.apache.james/james-server-data-library

@Given("store \"([^\"]*)\" forward mapping for user \"([^\"]*)\" at domain \"([^\"]*)\"")
public void storeForwardMappingForUserAtDomain(String address, String user, String domain) throws Throwable {
  MappingSource source = MappingSource.fromUser(user, domain);
  rewriteTable.addForwardMapping(source, address);
}
origin: org.apache.james/james-server-data-library

@Given("store \"([^\"]*)\" error mapping for user \"([^\"]*)\" at domain \"([^\"]*)\"")
public void storeErrorMappingForUserAtDomain(String error, String user, String domain) throws Throwable {
  MappingSource source = MappingSource.fromUser(user, domain);
  rewriteTable.addErrorMapping(source, error);
}
origin: org.apache.james/james-server-data-library

@Given("store \"([^\"]*)\" address mapping for user \"([^\"]*)\" at domain \"([^\"]*)\"")
public void storeAddressMappingForUserAtDomain(String address, String user, String domain) throws Throwable {
  MappingSource source = MappingSource.fromUser(user, domain);
  rewriteTable.addAddressMapping(source, address);
}
origin: org.apache.james/james-server-data-library

@Given("store \"([^\"]*)\" regexp mapping for user \"([^\"]*)\" at domain \"([^\"]*)\"")
public void storeRegexpMappingForUserAtDomain(String regexp, String user, String domain) throws Throwable {
  MappingSource source = MappingSource.fromUser(user, domain);
  rewriteTable.addRegexMapping(source, regexp);
}
origin: org.apache.james/james-server-data-library

@Override
public void removeAddressMapping(MappingSource source, String address) throws RecipientRewriteTableException {
  Mapping mapping = Mapping.address(address)
    .appendDomainFromThrowingSupplierIfNone(this::defaultDomain);
  LOGGER.info("Remove address mapping => {} for source: {}", mapping, source.asString());
  removeMapping(source, mapping);
}
origin: org.apache.james/james-server-data-library

@Override
public void removeGroupMapping(MappingSource source, String address) throws RecipientRewriteTableException {
  Mapping mapping = Mapping.group(address)
    .appendDomainFromThrowingSupplierIfNone(this::defaultDomain);
  LOGGER.info("Remove group mapping => {} for source: {}", mapping, source.asString());
  removeMapping(source, mapping);
}
origin: org.apache.james/james-server-data-library

@Override
public void removeForwardMapping(MappingSource source, String address) throws RecipientRewriteTableException {
  Mapping mapping = Mapping.forward(address)
    .appendDomainFromThrowingSupplierIfNone(this::defaultDomain);
  LOGGER.info("Remove forward mapping => {} for source: {}", mapping, source.asString());
  removeMapping(source, mapping);
}
origin: org.apache.james/james-server-data-library

@Override
public void addErrorMapping(MappingSource source, String error) throws RecipientRewriteTableException {
  Mapping mapping = Mapping.error(error);
  checkDuplicateMapping(source, mapping);
  LOGGER.info("Add error mapping => {} for source: {}", error, source.asString());
  addMapping(source, mapping);
}
origin: org.apache.james/james-server-data-library

@Override
public void removeErrorMapping(MappingSource source, String error) throws RecipientRewriteTableException {
  LOGGER.info("Remove error mapping => {} for source: {}", error, source.asString());
  removeMapping(source, Mapping.error(error));
}
origin: org.apache.james/james-server-data-library

@Override
public void removeRegexMapping(MappingSource source, String regex) throws RecipientRewriteTableException {
  LOGGER.info("Remove regex mapping => {} for source: {}", regex, source.asString());
  removeMapping(source, Mapping.regex(regex));
}
origin: org.apache.james/james-server-data-library

private void checkDuplicateMapping(MappingSource source, Mapping mapping) throws RecipientRewriteTableException {
  Mappings mappings = getUserDomainMappings(source);
  if (mappings != null && mappings.contains(mapping)) {
    throw new MappingAlreadyExistsException("Mapping " + mapping + " for " + source.asString() + " already exist!");
  }
}
org.apache.james.rrt.lib

Most used classes

  • MappingSource
  • MappingsImpl
  • Mapping
  • Mappings
  • AbstractRecipientRewriteTableTest
    The abstract test for the virtual user table. Contains tests related to simple, regexp, wildcard, er
  • AbstractRecipientRewriteTable,
  • RecipientRewriteTableUtil,
  • Mapping$Type,
  • RewriteTablesStepdefs,
  • UserRewritter$RegexRewriter,
  • UserRewritter
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now