|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AccessVerifier
Access verifier for hosts. It checks whether access from/to a host should be accepted or denied, by comparing with the tables in memory.
Field Summary | |
private java.util.ArrayList |
accesses
A table of integer constants (ALLOW or DENY), specifying the access |
(package private) static int |
ALLOW
|
(package private) static int |
BEGINS_ENDS_META
|
(package private) static int |
BEGINS_META
|
(package private) static int |
DENY
|
(package private) static int |
ENDS_META
|
private java.util.ArrayList |
hosts
A table of Strings, specifying the host |
(package private) static int |
NO_META
|
(package private) static int |
NOT_FOUND
|
Constructor Summary | |
AccessVerifier(java.lang.String filename)
Builds a new AccessVerifier following the directives written in the ASCII file passed as parameter. |
Method Summary | |
private int |
getAccess(java.lang.String hostname)
Checks the access directive for a given host. |
boolean |
shouldAcceptThisClient(java.lang.String clientName)
Checks whether a client is acceptable or not. |
boolean |
shouldAcceptThisServer(java.lang.String serverName)
Checks whether a server is acceptable or not. |
static void |
warnDeniedClient(java.io.OutputStream is)
Sends a message which informs that the proxy refuses connection from client. |
static void |
warnDeniedServer(java.io.OutputStream is,
java.lang.String deniedSite)
Sends a message which informs that the proxy denies access to a server. |
private static void |
writeWarningMsg(java.io.OutputStream is,
java.lang.String warnMsg)
Sends an HTML message into the connection stream. |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final int ALLOW
static final int DENY
static final int NOT_FOUND
static final int NO_META
static final int BEGINS_META
static final int ENDS_META
static final int BEGINS_ENDS_META
private java.util.ArrayList accesses
private java.util.ArrayList hosts
Constructor Detail |
public AccessVerifier(java.lang.String filename) throws java.io.IOException, UnrecognizedCfglineException
filename
- the name of the file containing the directivesMethod Detail |
private int getAccess(java.lang.String hostname) throws java.util.NoSuchElementException
hostname
- the host's namepublic boolean shouldAcceptThisClient(java.lang.String clientName)
clientName
- the client's namepublic boolean shouldAcceptThisServer(java.lang.String serverName)
serverName
- the server's namepublic static void warnDeniedClient(java.io.OutputStream is)
is
- the stream of the connectionpublic static void warnDeniedServer(java.io.OutputStream is, java.lang.String deniedSite)
is
- the stream of the connectiondeniedSite
- the name of the denied serverprivate static void writeWarningMsg(java.io.OutputStream is, java.lang.String warnMsg)
is
- the stream of the connectionwarnMsg
- the body message
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |