jif.lang
Class PrincipalUtil

java.lang.Object
  extended by jif.lang.PrincipalUtil

public class PrincipalUtil
extends java.lang.Object

Utility methods for principals. See the Jif source code, in lib-src/jif/lang/PrincipalUtil.jif


Constructor Summary
PrincipalUtil()
           
 
Method Summary
static boolean acts_for(Principal p, Principal q)
          Returns true if and only if the principal p acts for the principal q.
static boolean actsFor(Principal p, Principal q)
          Returns true if and only if the principal p acts for the principal q.
static ActsForProof actsForProof(Principal p, Principal q)
          Returns an actsfor proof if and only if the principal p acts for the principal q.
static Capability authorize(Principal p, java.lang.Object authPrf, Closure c, Label lb)
          Obtain a Capability for the given principal and closure.
static Principal bottomPrincipal()
           
static Principal conjunction(java.util.Collection<Principal> principals)
           
static Principal conjunction(Principal left, Principal right)
           
static boolean delegatesTo(Principal granter, Principal superior)
           
static Principal disjunction(java.util.Collection<Principal> principals)
           
static Principal disjunction(Principal left, Principal right)
           
static boolean equals(Principal p, Principal q)
           
static boolean equivalentTo(Principal p, Principal q)
           
static java.lang.Object execute(Principal p, java.lang.Object authPrf, Closure c, Label lb)
          Execute the given closure, if the principal agrees.
static ActsForProof findActsForProof(Principal p, Principal q, java.lang.Object searchState)
          Search for an ActsForProof between p and q.
static void notifyNewDelegation(Principal granter, Principal superior)
          Notification that a new delegation has been created.
static void notifyRevokeDelegation(Principal granter, Principal superior)
          Notification that an existing delegation has been revoked.
static Principal nullPrincipal()
          returns the null principal, the principal that every other principal can act for.
static ConfPolicy readableByPrinPolicy(Principal p)
           
static java.lang.String stringValue(Principal p)
           
static Principal topPrincipal()
           
static java.lang.String toString(Principal p)
           
static boolean verifyProof(ActsForProof prf, Principal actor, Principal granter)
          Verify that the chain is a valid delegates-chain between p and q.
static IntegPolicy writableByPrinPolicy(Principal p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrincipalUtil

public PrincipalUtil()
Method Detail

acts_for

public static boolean acts_for(Principal p,
                               Principal q)
Returns true if and only if the principal p acts for the principal q. A synonym for the actsFor method.


actsFor

public static boolean actsFor(Principal p,
                              Principal q)
Returns true if and only if the principal p acts for the principal q.


actsForProof

public static ActsForProof actsForProof(Principal p,
                                        Principal q)
Returns an actsfor proof if and only if the principal p acts for the principal q.


notifyNewDelegation

public static void notifyNewDelegation(Principal granter,
                                       Principal superior)
Notification that a new delegation has been created.


notifyRevokeDelegation

public static void notifyRevokeDelegation(Principal granter,
                                          Principal superior)
Notification that an existing delegation has been revoked.


findActsForProof

public static ActsForProof findActsForProof(Principal p,
                                            Principal q,
                                            java.lang.Object searchState)
Search for an ActsForProof between p and q. An ActsForProof between p and q is a a checkable proof object.

Parameters:
p -
q -
searchState - records the goals that we are in the middle of attempting
Returns:
An ActsForPoorf between p and q, or null if none can be found.

verifyProof

public static boolean verifyProof(ActsForProof prf,
                                  Principal actor,
                                  Principal granter)
Verify that the chain is a valid delegates-chain between p and q. That is, q == chain[n], chain[n] delegates to chain[n-1], ..., chain[0] == p, i.e., p acts for q.


delegatesTo

public static boolean delegatesTo(Principal granter,
                                  Principal superior)

equivalentTo

public static boolean equivalentTo(Principal p,
                                   Principal q)

equals

public static boolean equals(Principal p,
                             Principal q)

execute

public static java.lang.Object execute(Principal p,
                                       java.lang.Object authPrf,
                                       Closure c,
                                       Label lb)
Execute the given closure, if the principal agrees.


authorize

public static Capability authorize(Principal p,
                                   java.lang.Object authPrf,
                                   Closure c,
                                   Label lb)
Obtain a Capability for the given principal and closure.


nullPrincipal

public static Principal nullPrincipal()
returns the null principal, the principal that every other principal can act for.


bottomPrincipal

public static Principal bottomPrincipal()

topPrincipal

public static Principal topPrincipal()

readableByPrinPolicy

public static ConfPolicy readableByPrinPolicy(Principal p)

writableByPrinPolicy

public static IntegPolicy writableByPrinPolicy(Principal p)

disjunction

public static Principal disjunction(Principal left,
                                    Principal right)

conjunction

public static Principal conjunction(Principal left,
                                    Principal right)

disjunction

public static Principal disjunction(java.util.Collection<Principal> principals)

conjunction

public static Principal conjunction(java.util.Collection<Principal> principals)

toString

public static java.lang.String toString(Principal p)

stringValue

public static java.lang.String stringValue(Principal p)