|
RMI Proxy 1.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.security.Permission
|
+--java.security.BasicPermission
|
+--com.rmiproxy.security.FirewallPermission
This class represents access to an RMI Proxy firewall by client hostname/IP address. A FirewallPermission consists of an action and a host specification. The possible actions are:
name into the RMI Proxy Registryname in the RMI Proxy Registry
The host is specified as
host = (hostname | IPaddress)[:portrange]
portrange = portnumber | -portnumber | portnumber-[portnumber]
The host is expressed as a DNS name, as a numerical IP address,
or as "localhost" (for the local machine).
The wildcard "*" may be included once in a DNS name host specification.
If it is included, it must be in the leftmost position, as in "*.sun.com".
The port or portrange is optional. A port specification of the form "N-", where N is a port number, signifies all ports numbered N and above, while a specification of the form "-N" indicates all ports numbered N and below.
All the above is identical to the hostname specification of java.net.SocketPermission.
When checking permissions, "host" is set to the client hostname/IP address as determined by java.rmi.server.RemoteServer.getClientHost().
All permissions are checked in the access-control context of the codebase of the remote object concerned.
It is possible to form intersections of protection domains, hostnames and actions, so that only hosts within specified domains may perform certain actions within a given protection domain.
Example:
grant codebase "http://www.rmiproxy.com/beta/" {
com.rmiproxy.security.FirewallPermission "bind.com.rmiproxy.test.RemoteEcho","developer.rmiproxy.com";
}
All actions support wildcards ('*') as their last character. All hostnames support wildcards ('*') as their first character. IP addresses do not support wildcards at all. Example:
grant codebase "http://codebase.rmiproxy.com/beta/" {
com.rmiproxy.security.FirewallPermission "access.com.rmiproxy.test.*","*";
com.rmiproxy.security.FirewallPermission "execute.com.rmiproxy.test.*","*";
com.rmiproxy.security.FirewallPermission "lookup.*","*";
}
SocketPermission,
BasicPermission, Serialized Form| Constructor Summary | |
FirewallPermission(java.lang.String action,
java.lang.String host)
Creates a new FirewallPermission object with the specified actions. |
|
| Method Summary | |
boolean |
equals(java.lang.Object that)
|
java.lang.String |
getActions()
|
boolean |
implies(java.security.Permission p)
|
java.security.PermissionCollection |
newPermissionCollection()
Returns a new PermissionCollection object for storing FirewallPermission objects. |
| Methods inherited from class java.security.BasicPermission |
hashCode |
| Methods inherited from class java.security.Permission |
checkGuard, getName, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FirewallPermission(java.lang.String action,
java.lang.String host)
To specify the local machine, use "localhost" as the host. Also note: An empty host String ("") is equivalent to "localhost".
The actions parameter contains a comma-separated list of the actions granted for the specified host (and port(s)). Possible actions are "connect", "listen", "accept", "resolve", or any combination of those. "resolve" is automatically added when any of the other three are specified.
Examples of FirewallPermission instantiation are the following:
nr = new FirewallPermission("access.*", "www.catalog.com");
nr = new FirewallPermission("bind.*", "www.sun.com:80");
nr = new FirewallPermission("execute.*", "204.160.241.0");
nr = new FirewallPermission("lookup.*", "204.160.241.0:1024-65535");
action - the action to be performedhost - the hostname or IPaddress of the computer, optionally
including a colon followed by a port or port range| Method Detail |
public java.lang.String getActions()
getActions in class java.security.BasicPermissionpublic boolean implies(java.security.Permission p)
implies in class java.security.BasicPermissionp - permission to matchpublic boolean equals(java.lang.Object that)
equals in class java.security.BasicPermissionpublic java.security.PermissionCollection newPermissionCollection()
FirewallPermission objects must be stored in a manner that allows them
to be inserted into the collection in any order, but that also enables the
PermissionCollection implies
method to be implemented in an efficient (and consistent) manner.
newPermissionCollection in class java.security.BasicPermission
|
www.rmiproxy.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||