Annotation of java/classes/org/w3c/jigsaw/acl/HTTPPrincipal.java, revision 1.5.4.1
1.1 bmahe 1: // HTTPPrincipal.java
1.5.4.1 ! ylafon 2: // $Id: HTTPPrincipal.java,v 1.6 2000/06/23 13:15:00 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
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.4.1 ! ylafon 14: * @version $Revision: 1.6 $
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.4.1 ! ylafon 40: return null;
! 41: }
! 42:
! 43: public String getRealm() {
1.5 ylafon 44: return null;
1.4 bmahe 45: }
46:
1.3 bmahe 47: public String toString() {
1.5 ylafon 48: return request.getClient().getInetAddress().toString();
1.3 bmahe 49: }
1.1 bmahe 50:
1.4 bmahe 51: public HTTPPrincipal(Request request) {
1.5 ylafon 52: this.request = request;
1.1 bmahe 53: }
54:
55: }
Webmaster