You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by re...@apache.org on 2001/04/28 05:43:34 UTC

cvs commit: jakarta-slide/src/share/org/apache/slide/common Uri.java

remm        01/04/27 20:43:34

  Modified:    src/share/org/apache/slide/common Uri.java
  Log:
  - The Uri will now be able to hold a reference to the SlideToken which was given
    by the client. This can be used by a store to keep track of user access, do
    additional access control, or more effectively control resources.
  - It is allowed that this field is not set. That means that the access to the store
    is made directly by Slide for additional internal operations (the internal ACL
    checks are one example of this).
  
  Revision  Changes    Path
  1.5       +49 -7     jakarta-slide/src/share/org/apache/slide/common/Uri.java
  
  Index: Uri.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Uri.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Uri.java	2000/11/19 04:18:35	1.4
  +++ Uri.java	2001/04/28 03:43:34	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Uri.java,v 1.4 2000/11/19 04:18:35 remm Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/11/19 04:18:35 $
  + * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Uri.java,v 1.5 2001/04/28 03:43:34 remm Exp $
  + * $Revision: 1.5 $
  + * $Date: 2001/04/28 03:43:34 $
    *
    * ====================================================================
    *
  @@ -74,7 +74,7 @@
    * manipulated by Slide.
    * 
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public final class Uri implements java.io.Serializable {
       
  @@ -89,11 +89,24 @@
        * @param uri Uri
        */
       public Uri(Namespace namespace, String uri) {
  -        this.namespace = namespace;
  -        parseUri(uri);
  +        this(null, namespace, uri);
       }
       
       
  +    /**
  +     * Constructor.
  +     * 
  +     * @param token Slide token
  +     * @param namespace Namespace associated with this Uri
  +     * @param uri Uri
  +     */
  +    public Uri(SlideToken token, Namespace namespace, String uri) {
  +        this.token = token;
  +        this.namespace = namespace;
  +        parseUri(uri);
  +    }
  +
  +
       // ----------------------------------------------------- Instance Variables
       
       
  @@ -133,6 +146,12 @@
       private transient Store store;
       
       
  +    /**
  +     * Associated SlideToken.
  +     */
  +    private transient SlideToken token;
  +    
  +    
       // ------------------------------------------------------------- Properties
       
       
  @@ -177,6 +196,27 @@
       }
       
       
  +    /**
  +     * Token accessor.
  +     * 
  +     * @return The SlideToken, or null if no token has been set 
  +     * (which is valid)
  +     */
  +    public SlideToken getToken() {
  +        return token;
  +    }
  +    
  +    
  +    /**
  +     * Token mutator.
  +     * 
  +     * @param token New Slide token
  +     */
  +    public void setToken(SlideToken token) {
  +        this.token = token;
  +    }
  +    
  +    
       // --------------------------------------------------------- Public Methods
       
       
  @@ -196,7 +236,9 @@
        * @return Uri
        */
       public Uri getParentUri() {
  -        return scopes.getParentUri();
  +        Uri result = scopes.getParentUri();
  +        result.setToken(token);
  +        return result;
       }