File:  [Public] / java / classes / org / w3c / jigsaw / acl / HTTPPrincipal.java
Revision 1.5: download - view: text, annotated - select for diffs
Fri Jun 18 11:58:01 1999 UTC (25 years ago) by ylafon
Branches: MAIN
CVS tags: rel-2-1, rel-2-0, R_2_1_1_B0, R_2_1_0_B4, R_2_1_0_B3, R_2_1_0_B2, R_2_1_0_B1, R_2_1_0_B0, R_2_0_4_B1, R_2_0_4_B0, R_2_0_3_B0, HEAD
HTTP principal now takes request, this makes it easier to access the information, using cookies or other things if the user wants

// HTTPPrincipal.java
// $Id: HTTPPrincipal.java,v 1.5 1999/06/18 11:58:01 ylafon Exp $
// (c) COPYRIGHT MIT, INRIA and Keio, 1999.
// Please first read the full copyright statement in file COPYRIGHT.html
 
package org.w3c.jigsaw.acl;

import java.net.InetAddress;
import java.security.Principal;

import org.w3c.jigsaw.http.Request;

/**
 * @version $Revision: 1.5 $
 * @author  Benoît Mahé (bmahe@w3.org)
 */

/**
 * This class implements the most basic HTTP principal, allowing
 * you to check the IP of the request only
 */

public class HTTPPrincipal implements Principal {

    protected Request     request = null;

    protected Request getRequest() {
	return request;
    }

    protected InetAddress getInetAddress() {
	return request.getClient().getInetAddress();
    }

    public boolean equals(Object another) {
	return false;
    }

    public String getName() {
	return null;
    }

    public String toString() {
	return request.getClient().getInetAddress().toString();
    }

    public HTTPPrincipal(Request request) {
	this.request = request;
    }

}

Webmaster