Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleTenantProvider.java
/**
 * The <code>TenantProvider</code> defines the service interface of for a sevice
 * which may be asked for {@link Tenant tenant instances}.
 * <p>
 * For now this provider interface provides access to a tenant applying to a
 * particular request as well as to all tenants known to this provider.
 */
public interface TenantProvider {

    /**
     * Returns the {@link Tenant} with the given <code>tenantId</code> or
     * <code>null</code> if no such tenant exists.
     */
    Tenant getTenantById(String tenantId);

    /**
     * Returns an iterator of all {@link Tenant tenants} known to this provider.
     * If no tenants are known the iterator is empty.
     */
    Iterator<Tenant> getTenants();

    /**
     * Returns an iterator of {@link Tenant tenants} whose names match the given
     * <code>tenantName</code>. Since the name of a tenant is not required to be
     * globally unique, this method may return more than one tenant.
     * <p>
     * If no tenants are known with the requested name the iterator is empty.
     */
    Iterator<Tenant> getTenantsByName(String tenantName);

    /**
     * Returns an iterator of {@link Tenant tenants} matching the given
     * <code>tenantFilter</code>.
     * <p>
     * The <code>tenantFilter</code> is a valid OSGi filter string as defined in
     * Section 3.2.6, Filter Syntax, of the OSGi Core Specification, Release 4.
     * <p>
     * If no tenants match the <code>tenantFilter</code> or the
     * <code>tenantFilter</code> is not a valid filter string the iterator is
     * empty.
     */
    Iterator<Tenant> getTenantsByFilter(String tenantFilter);
}

AdapterFactory

The Tenant provider bundle should also register an AdapterFactory to adapt ResourceResolver and other objects to Tenant instances.

SlingHttpServletRequest

The SlingHttpServletRequest interface is extended to return the Tenant applicable for the request.

...