Annotation of java/classes/org/w3c/jigsaw/acl/HTTPPrincipal.java, revision 1.9

1.1       bmahe       1: // HTTPPrincipal.java
1.9     ! ylafon      2: // $Id: HTTPPrincipal.java,v 1.8 2005/02/18 17:35:13 ylafon Exp $
1.1       bmahe       3: // (c) COPYRIGHT MIT, INRIA and Keio, 1999.
                      4: // Please first read the full copyright statement in file COPYRIGHT.html
1.7       ylafon      5: 
1.1       bmahe       6: package org.w3c.jigsaw.acl;
                      7: 
                      8: import java.net.InetAddress;
                      9: import java.security.Principal;
                     10: 
                     11: import org.w3c.jigsaw.http.Request;
                     12: 
                     13: /**
1.9     ! ylafon     14:  * @version $Revision: 1.8 $
        !            15:  * @author Benoît Mahé (bmahe@w3.org)
1.1       bmahe      16:  */
1.5       ylafon     17: 
                     18: /**
                     19:  * This class implements the most basic HTTP principal, allowing
                     20:  * you to check the IP of the request only
                     21:  */
                     22: 
1.4       bmahe      23: public class HTTPPrincipal implements Principal {
1.1       bmahe      24: 
1.9     ! ylafon     25:     protected Request request = null;
        !            26:     protected boolean lenient = false;
1.5       ylafon     27: 
                     28:     protected Request getRequest() {
1.9     ! ylafon     29:         return request;
1.5       ylafon     30:     }
1.1       bmahe      31: 
                     32:     protected InetAddress getInetAddress() {
1.9     ! ylafon     33:         return request.getClient().getInetAddress();
1.1       bmahe      34:     }
                     35: 
1.4       bmahe      36:     public boolean equals(Object another) {
1.9     ! ylafon     37:         return false;
1.4       bmahe      38:     }
                     39: 
                     40:     public String getName() {
1.9     ! ylafon     41:         return null;
1.6       ylafon     42:     }
                     43: 
1.8       ylafon     44:     public String getOriginalName() {
1.9     ! ylafon     45:         return null;
1.8       ylafon     46:     }
                     47: 
1.6       ylafon     48:     public String getRealm() {
1.9     ! ylafon     49:         return null;
1.4       bmahe      50:     }
                     51: 
1.3       bmahe      52:     public String toString() {
1.9     ! ylafon     53:         return request.getClient().getInetAddress().toString();
1.3       bmahe      54:     }
1.1       bmahe      55: 
1.4       bmahe      56:     public HTTPPrincipal(Request request) {
1.9     ! ylafon     57:         this.request = request;
1.1       bmahe      58:     }
                     59: 
1.8       ylafon     60:     public HTTPPrincipal(Request request, boolean lenient) {
1.9     ! ylafon     61:         this.lenient = lenient;
        !            62:         this.request = request;
1.8       ylafon     63:     }
1.1       bmahe      64: }

Webmaster