You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by pe...@apache.org on 2010/08/01 08:44:12 UTC

svn commit: r981166 - /incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/

Author: peter_firmstone
Date: Sun Aug  1 06:44:11 2010
New Revision: 981166

URL: http://svn.apache.org/viewvc?rev=981166&view=rev
Log:
Clean up of javadoc documentation in org.apache.river.*

Modified:
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/CodeSourceGrant.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/DefaultPolicyParser.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/DefaultPolicyScanner.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PolicyParser.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PrincipalGrant.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/ProtectionDomainGrant.java
    incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/UnresolvedPrincipal.java

Modified: incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/CodeSourceGrant.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/CodeSourceGrant.java?rev=981166&r1=981165&r2=981166&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/CodeSourceGrant.java (original)
+++ incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/CodeSourceGrant.java Sun Aug  1 06:44:11 2010
@@ -64,8 +64,8 @@ class CodeSourceGrant extends PrincipalG
     }
     
     /**
-     * Checks if passed CodeSource matches this PolicyEntry. Null CodeSource of
-     * PolicyEntry implies any CodeSource; non-null CodeSource forwards to its
+     * Checks if passed CodeSource matches this PermissionGrant. Null CodeSource of
+     * PermissionGrant implies any CodeSource; non-null CodeSource forwards to its
      * imply() method.
      */
     protected boolean impliesCodeSource(CodeSource codeSource) {

Modified: incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/DefaultPolicyParser.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/DefaultPolicyParser.java?rev=981166&r1=981165&r2=981166&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/DefaultPolicyParser.java (original)
+++ incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/DefaultPolicyParser.java Sun Aug  1 06:44:11 2010
@@ -57,9 +57,10 @@ import org.apache.river.imp.security.pol
 /**
  * This is a basic loader of policy files. It delegates lexical analysis to 
  * a pluggable scanner and converts received tokens to a set of 
- * {@link org.apache.harmony.security.PolicyEntry PolicyEntries}. 
- * For details of policy format, see the 
- * {@link org.apache.harmony.security.DefaultPolicy default policy description}.
+ * {@link org.apache.river.security.PermissionGrant PermissionGrant's}. 
+ * For details of policy format, which should be identical to Sun's Java Policy
+ * files see the 
+ * {@link org.apache.river.imp.security.policy.ConcurrentPolicyFile default policy description}.
  * <br>
  * For ordinary uses, this class has just one public method <code>parse()</code>, 
  * which performs the main task.
@@ -69,9 +70,9 @@ import org.apache.river.imp.security.pol
  * This implementation is effectively thread-safe, as it has no field references 
  * to data being processed (that is, passes all the data as method parameters).
  * 
- * @see org.apache.harmony.security.DefaultPolicy
- * @see org.apache.harmony.security.DefaultPolicyScanner
- * @see org.apache.harmony.security.PolicyEntry
+ * @see org.apache.river.imp.security.policy.ConcurrentPolicyFile
+ * @see org.apache.river.imp.security.policy.util.DefaultPolicyScanner
+ * @see org.apache.river.security.PermissionGrant
  */
 public class DefaultPolicyParser implements PolicyParser {
 
@@ -97,16 +98,16 @@ public class DefaultPolicyParser impleme
     /**
      * This is the main business method. It manages loading process as follows:
      * the associated scanner is used to parse the stream to a set of 
-     * {@link org.apache.harmony.security.DefaultPolicyScanner.GrantEntry composite tokens},
-     * then this set is iterated and each token is translated to a PolicyEntry.
-     * Semantically invalid tokens are ignored, the same as void PolicyEntries.
+     * {@link org.apache.river.imp.security.policy.util.DefaultPolicyScanner.GrantEntry composite tokens},
+     * then this set is iterated and each token is translated to a PermissionGrant.
+     * Semantically invalid tokens are ignored, the same as void PermissionGrant's.
      * <br>
      * A policy file may refer to some KeyStore(s), and in this case the first
      * valid reference is initialized and used in processing tokens.   
      * 
      * @param location an URL of a policy file to be loaded
      * @param system system properties, used for property expansion
-     * @return a collection of PolicyEntry objects, may be empty
+     * @return a collection of PermissionGrant objects, may be empty
      * @throws Exception IO error while reading location or file syntax error 
      */
     public Collection<PermissionGrant> parse(URL location, Properties system)
@@ -148,7 +149,7 @@ public class DefaultPolicyParser impleme
     }
 
     /**
-     * Translates GrantEntry token to PolicyEntry object. It goes step by step, 
+     * Translates GrantEntry token to PermissionGrant object. It goes step by step, 
      * trying to resolve each component of the GrantEntry:
      * <ul>
      * <li> If <code>codebase</code> is specified, expand it and construct an URL.
@@ -166,19 +167,19 @@ public class DefaultPolicyParser impleme
      * In fact, property expansion in the steps above is conditional and is ruled by
      * the parameter <i>resolve</i>.  
      * <br>
-     * Finally a new PolicyEntry is created, which associates the trinity 
+     * Finally a new PermissionGrant is created, which associates the trinity 
      * of resolved URL, Certificates and Principals to a set of granted Permissions.
      * 
      * @param ge GrantEntry token to be resolved
      * @param ks KeyStore for resolving Certificates, may be <code>null</code> 
      * @param system system properties, used for property expansion 
      * @param resolve flag enabling/disabling property expansion
-     * @return resolved PolicyEntry
+     * @return resolved PermissionGrant
      * @throws Exception if unable to resolve codebase, signers or principals 
      * of the GrantEntry
      * @see DefaultPolicyScanner.PrincipalEntry
      * @see DefaultPolicyScanner.PermissionEntry
-     * @see org.apache.harmony.security.PolicyUtils
+     * @see org.apache.river.imp.security.policy.util.PolicyUtils
      */
     protected PermissionGrant resolveGrant(DefaultPolicyScanner.GrantEntry ge,
             KeyStore ks, Properties system, boolean resolve) throws Exception {
@@ -230,9 +231,6 @@ public class DefaultPolicyParser impleme
                 .permissions(permissions.toArray(new Permission[permissions.size()]))
                 .context(PermissionGrantBuilder.CODESOURCE)
                 .build();
-        
-//        return new PolicyEntry(new CodeSource(codebase, signers), principals,
-//                permissions);
     }
 
     /**

Modified: incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/DefaultPolicyScanner.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/DefaultPolicyScanner.java?rev=981166&r1=981165&r2=981166&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/DefaultPolicyScanner.java (original)
+++ incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/DefaultPolicyScanner.java Sun Aug  1 06:44:11 2010
@@ -395,10 +395,10 @@ public class DefaultPolicyScanner {
 
     /**
      * Compound token representing <i>keystore </i> clause. See policy format
-     * {@link org.apache.harmony.security.DefaultPolicy description}for details.
+     * {@link org.apache.river.imp.security.policy.se.ConcurrentPolicyFile description}for details.
      * 
-     * @see org.apache.harmony.security.fortress.DefaultPolicyParser
-     * @see org.apache.harmony.security.DefaultPolicyScanner
+     * @see org.apache.river.imp.security.policy.util.DefaultPolicyParser
+     * @see org.apache.river.imp.security.policy.util.DefaultPolicyScanner
      */
     public static class KeystoreEntry {
 
@@ -415,10 +415,10 @@ public class DefaultPolicyScanner {
 
     /**
      * Compound token representing <i>grant </i> clause. See policy format
-     * {@link org.apache.harmony.security.DefaultPolicy description}for details.
+     * {@link org.apache.river.imp.security.policy.se.ConcurrentPolicyFile description}for details.
      * 
-     * @see org.apache.harmony.security.fortress.DefaultPolicyParser
-     * @see org.apache.harmony.security.DefaultPolicyScanner
+     * @see org.apache.river.imp.security.policy.util.DefaultPolicyParser
+     * @see org.apache.river.imp.security.policy.util.DefaultPolicyScanner
      */
     public static class GrantEntry {
 
@@ -460,10 +460,10 @@ public class DefaultPolicyScanner {
     /**
      * Compound token representing <i>principal </i> entry of a <i>grant </i>
      * clause. See policy format
-     * {@link org.apache.harmony.security.DefaultPolicy description}for details.
+     * {@link org.apache.river.imp.security.policy.se.ConcurrentPolicyFile description}for details.
      * 
-     * @see org.apache.harmony.security.fortress.DefaultPolicyParser
-     * @see org.apache.harmony.security.DefaultPolicyScanner
+     * @see org.apache.river.imp.security.policy.util.DefaultPolicyParser
+     * @see org.apache.river.imp.security.policy.util.DefaultPolicyScanner
      */
     public static class PrincipalEntry {
 
@@ -488,10 +488,10 @@ public class DefaultPolicyScanner {
     /**
      * Compound token representing <i>permission </i> entry of a <i>grant </i>
      * clause. See policy format
-     * {@link org.apache.harmony.security.DefaultPolicy description}for details.
+     * {@link org.apache.river.imp.security.policy.se.ConcurrentPolicyFile description}for details.
      * 
-     * @see org.apache.harmony.security.fortress.DefaultPolicyParser
-     * @see org.apache.harmony.security.DefaultPolicyScanner
+     * @see org.apache.river.imp.security.policy.util.DefaultPolicyParser
+     * @see org.apache.river.imp.security.policy.util.DefaultPolicyScanner
      */
     public static class PermissionEntry {
 

Modified: incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PolicyParser.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PolicyParser.java?rev=981166&r1=981165&r2=981166&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PolicyParser.java (original)
+++ incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PolicyParser.java Sun Aug  1 06:44:11 2010
@@ -1,6 +1,19 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package org.apache.river.imp.security.policy.util;
@@ -11,16 +24,16 @@ import java.util.Properties;
 import org.apache.river.api.security.PermissionGrant;
 
 /**
- *
- * @author peter
+ * Based on the Apache Harmony interface of the same name.
+ * @author Peter Firmstone
  */
 public interface PolicyParser {
 
     /**
      * This is the main business method. It manages loading process as follows:
      * the associated scanner is used to parse the stream to a set of
-     * {@link org.apache.harmony.security.DefaultPolicyScanner.GrantEntry composite tokens},
-     * then this set is iterated and each token is translated to a PolicyEntry.
+     * {@link org.apache.river.imp.security.policy.util.DefaultPolicyScanner.GrantEntry composite tokens},
+     * then this set is iterated and each token is translated to a PermissionGrant.
      * Semantically invalid tokens are ignored, the same as void PolicyEntries.
      * <br>
      * A policy file may refer to some KeyStore(s), and in this case the first
@@ -28,7 +41,7 @@ public interface PolicyParser {
      *
      * @param location an URL of a policy file to be loaded
      * @param system system properties, used for property expansion
-     * @return a collection of PolicyEntry objects, may be empty
+     * @return a collection of PermissionGrant objects, may be empty
      * @throws Exception IO error while reading location or file syntax error
      */
     Collection<PermissionGrant> parse(URL location, Properties system) throws Exception;

Modified: incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PrincipalGrant.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PrincipalGrant.java?rev=981166&r1=981165&r2=981166&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PrincipalGrant.java (original)
+++ incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/PrincipalGrant.java Sun Aug  1 06:44:11 2010
@@ -84,9 +84,9 @@ abstract class PrincipalGrant implements
     protected boolean implies(Principal[] prs) {
         if ( principals.isEmpty()) return true;
         if ( prs == null || prs.length == 0 ) return false;
-        // PolicyEntry Principals match if equal or if they are Groups and
+        // PermissionGrant Principals match if equal or if they are Groups and
         // the Principals being tested are their members.  Every Principal
-        // in this PolicyEntry must have a match.
+        // in this PermissionGrant must have a match.
         List<Principal> princp = Arrays.asList(prs);
         int matches = 0;
         Iterator<Principal> principalItr = principals.iterator();

Modified: incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/ProtectionDomainGrant.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/ProtectionDomainGrant.java?rev=981166&r1=981165&r2=981166&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/ProtectionDomainGrant.java (original)
+++ incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/ProtectionDomainGrant.java Sun Aug  1 06:44:11 2010
@@ -77,10 +77,10 @@ class ProtectionDomainGrant extends Prin
     }
     
     /*
-     * Checks if passed ProtectionDomain matches this PolicyEntry. Null ProtectionDomain of
-     * PolicyEntry implies any ProtectionDomain; non-null ProtectionDomain's are
+     * Checks if passed ProtectionDomain matches this PermissionGrant. Null ProtectionDomain of
+     * PermissionGrant implies any ProtectionDomain; non-null ProtectionDomain's are
      * compared with equals() and if false are compared by ClassLoader and
-     * CodeSource, in case of PermissionDomain's created by a DomainCombiner
+     * CodeSource, in case of new PermissionDomain's created by a DomainCombiner
      */   
     // for grant
     public boolean impliesProtectionDomain(ProtectionDomain pd) {

Modified: incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/UnresolvedPrincipal.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/UnresolvedPrincipal.java?rev=981166&r1=981165&r2=981166&view=diff
==============================================================================
--- incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/UnresolvedPrincipal.java (original)
+++ incubator/river/jtsk/trunk/src/org/apache/river/imp/security/policy/util/UnresolvedPrincipal.java Sun Aug  1 06:44:11 2010
@@ -35,8 +35,8 @@ import java.security.Principal;
  * execution thread. So the policy refers to this model definition of 
  * acceptable principal and compares it with the actual principal. 
  * 
- * @see PolicyEntry
- * @see org.apache.harmony.security.DefaultPolicy
+ * @see PermissionGrant
+ * @see org.apache.river.imp.security.policy.se.ConcurrentPolicyFile
  */
 public final class UnresolvedPrincipal implements Principal {