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

1.1       bmahe       1: // HTTPPrincipal.java
1.5     ! ylafon      2: // $Id: HTTPPrincipal.java,v 1.4 1999/04/27 14:17:36 bmahe Exp $
1.1       bmahe       3: // (c) COPYRIGHT MIT, INRIA and Keio, 1999.
                      4: // Please first read the full copyright statement in file COPYRIGHT.html
                      5:  
                      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.5     ! ylafon     14:  * @version $Revision: 1.4 $
1.1       bmahe      15:  * @author  Benoît Mahé (bmahe@w3.org)
                     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.5     ! ylafon     25:     protected Request     request = null;
        !            26: 
        !            27:     protected Request getRequest() {
        !            28:        return request;
        !            29:     }
1.1       bmahe      30: 
                     31:     protected InetAddress getInetAddress() {
1.5     ! ylafon     32:        return request.getClient().getInetAddress();
1.1       bmahe      33:     }
                     34: 
1.4       bmahe      35:     public boolean equals(Object another) {
                     36:        return false;
                     37:     }
                     38: 
                     39:     public String getName() {
1.5     ! ylafon     40:        return null;
1.4       bmahe      41:     }
                     42: 
1.3       bmahe      43:     public String toString() {
1.5     ! ylafon     44:        return request.getClient().getInetAddress().toString();
1.3       bmahe      45:     }
1.1       bmahe      46: 
1.4       bmahe      47:     public HTTPPrincipal(Request request) {
1.5     ! ylafon     48:        this.request = request;
1.1       bmahe      49:     }
                     50: 
                     51: }

Webmaster