directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vte...@apache.org
Subject svn commit: rev 57043 - incubator/directory/janus/trunk/sandbox/src/java/org/apache/janus/authorization/predicate
Date Tue, 09 Nov 2004 14:50:39 GMT
Author: vtence
Date: Tue Nov  9 06:50:38 2004
New Revision: 57043

Added:
   incubator/directory/janus/trunk/sandbox/src/java/org/apache/janus/authorization/predicate/Predicates.java
Log:
A factory for predicates

Added: incubator/directory/janus/trunk/sandbox/src/java/org/apache/janus/authorization/predicate/Predicates.java
==============================================================================
--- (empty file)
+++ incubator/directory/janus/trunk/sandbox/src/java/org/apache/janus/authorization/predicate/Predicates.java
Tue Nov  9 06:50:38 2004
@@ -0,0 +1,52 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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.janus.authorization.predicate;
+
+import org.apache.janus.authorization.Permission;
+import org.apache.janus.authorization.Predicate;
+
+import java.security.Principal;
+
+public final class Predicates
+{
+    public static final Predicate TRUE = new TruePredicate();
+    public static final Predicate FALSE = new FalsePredicate();
+
+    private Predicates()
+    {
+    }
+
+    public static Predicate isImplied( Permission p )
+    {
+        return new ImpliedPermissionPredicate( p );
+    }
+
+    public static Predicate isDependedUpon( Permission p )
+    {
+        return new DependedUponPermissionPredicate( p );
+    }
+
+    public static Predicate is( Object o )
+    {
+        return new EqualPredicate( o );
+    }
+
+    public static Predicate hasPrincipal( Principal p )
+    {
+        return new HasPrincipalPredicate( p );
+    }
+}

Mime
View raw message