jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1570103 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security: Context.java SecurityProvider.java
Date Thu, 20 Feb 2014 08:22:37 GMT
Author: angela
Date: Thu Feb 20 08:22:37 2014
New Revision: 1570103

URL: http://svn.apache.org/r1570103
Log:
javadoc

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/SecurityProvider.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java?rev=1570103&r1=1570102&r2=1570103&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/Context.java
Thu Feb 20 08:22:37 2014
@@ -23,18 +23,61 @@ import org.apache.jackrabbit.oak.api.Tre
 import org.apache.jackrabbit.oak.plugins.tree.TreeLocation;
 
 /**
- * Context... TODO
+ * {@code Context} represents item related information in relation to a
+ * dedicated {@link org.apache.jackrabbit.oak.spi.security.SecurityConfiguration}.
+ * This information allows to determine if a given {@code Tree} or {@link PropertyState}
+ * is defined by or related to the security model provided by the configuration.
  */
 public interface Context {
 
+    /**
+     * Reveals if the specified {@code PropertyState} is defined by the security
+     * module that exposes this {@link Context} instance.
+     *
+     * @param parent The parent tree of the property state.
+     * @param property The {@code PropertyState} to be tested.
+     * @return {@code true} if the specified property state is related to or
+     * defined by the security module.
+     */
     boolean definesProperty(@Nonnull Tree parent, @Nonnull PropertyState property);
 
+    /**
+     * Reveals if the specified {@code Tree} is the root of a subtree defined by
+     * the security module that exposes this {@link Context} instance. Note,
+     * that in contrast to {@link #definesTree(org.apache.jackrabbit.oak.api.Tree)}
+     * this method will only return {@code false} for any tree located in the
+     * subtree.
+     *
+     * @param tree The tree to be tested.
+     * @return {@code true} if the specified tree is the root of a subtree of items
+     * that are defined by the security module.
+     */
     boolean definesContextRoot(@Nonnull Tree tree);
 
+    /**
+     * Reveals if the specified {@code Tree} is defined by the security
+     * module that exposes this {@link Context} instance.
+     *
+     * @param tree The tree to be tested.
+     * @return {@code true} if the specified tree is related to or defined by the
+     * security module.
+     */
     boolean definesTree(@Nonnull Tree tree);
 
+    /**
+     * Reveals if the specified {@code TreeLocation} is defined by the security
+     * module that exposes this {@link Context} instance.
+     *
+     * @param tree The tree location to be tested.
+     * @return {@code true} if the specified tree location is related to or
+     * defined by the security module.
+     */
     boolean definesLocation(@Nonnull TreeLocation location);
 
+    /**
+     * Default implementation of the {@code Context} interface that always returns
+     * {@code false}.
+     */
     class Default implements Context {
         @Override
         public boolean definesProperty(@Nonnull Tree parent, @Nonnull PropertyState property)
{

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/SecurityProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/SecurityProvider.java?rev=1570103&r1=1570102&r2=1570103&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/SecurityProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/SecurityProvider.java
Thu Feb 20 08:22:37 2014
@@ -20,16 +20,44 @@ import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
 /**
- * SecurityProvider... TODO
+ * Main entry point for security related plugins to an Oak repository. The
+ * interface allow to access the available {@code SecurityConfiguration}s
+ * defining the individual plugins. In addition this provider gives access
+ * to the configuration parameters that apply to the configurations with the
+ * specified {@link SecurityConfiguration#getName() name}.
  */
 public interface SecurityProvider {
 
+    /**
+     * Allows to retrieve the configuration parameters associated with a
+     * given {@link org.apache.jackrabbit.oak.spi.security.SecurityConfiguration}
+     * accessible by this provider. If the specified name is {@code null}
+     * the global config parameters will be returned.
+     *
+     * @param name The {@link SecurityConfiguration#getName() name} of the security
+     * configuration.
+     * @return The configuration parameters associated with the {@code SecurityConfiguration}
+     * identified by the specified name. If the specified name is {@code null}
+     * the global config parameters will be returned.
+     */
     @Nonnull
     ConfigurationParameters getParameters(@Nullable String name);
 
+    /**
+     * Returns all available {@link org.apache.jackrabbit.oak.spi.security.SecurityConfiguration}s.
+     *
+     * @return the available {@link org.apache.jackrabbit.oak.spi.security.SecurityConfiguration}s.
+     */
     @Nonnull
     Iterable<? extends SecurityConfiguration> getConfigurations();
 
+    /**
+     * Returns the security configuration of the specified {@code configClass}.
+     *
+     * @param configClass The class of the configuration to retrieve.
+     * @param <T>
+     * @return The desired security configuration.
+     */
     @Nonnull
-    <T> T getConfiguration(Class<T> configClass);
+    <T> T getConfiguration(@Nonnull Class<T> configClass);
 }



Mime
View raw message