public final class MulticastProtocolPermission extends GCFPermission
MulticastProtocolPermission consists of a
URI string but no actions list.
The URI string specifies a connection for sending and receiving multicast datagrams. It takes the following general form:
multicast://{host}:{portspec}
The exact syntax for the MulticastProtocolPermission URI
is provided by the BNF rule multicast_permission.
The value of the {host} field must be a symbolic hostname,
a literal IPv4 multicast address or a literal IPv6 address surrounded by square brackets ("[", "]"),
as specified by
RFC 3986.
The hostspec may be "*" to allow connection to any multicast host group.
The {hostspec} field is omitted to indicate an inbound,
"server mode" connection.
Server-mode URIs may also omit the <portspec>
field to request a system-assigned port number. In such a case, the
MulticastProtocolPermission is
normalized to the equivalent
URI "multicast://:1024-65535".
The <portspec> string takes the following form:
portnumber | -portnumber | portnumber-[portnumber] | "*"A
<portspec> 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.
A single asterisk in the place of the <portspec>
field matches all ports.
Therefore, the URI "multicast://<ipaddr>:*" matches
multicast a host group to all ports, and
the URI "multicast://*:*" matches
multicast connections to all host groups on all ports.| Constructor and Description |
|---|
MulticastProtocolPermission(java.lang.String uri)
Creates a new
MulticastProtocolPermission with the
specified URI as its name. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Checks two
MulticastProtocolPermission objects for equality. |
java.lang.String |
getActions()
Returns the canonical string representation of the actions, which
currently is the empty string "", since there are no actions defined
for
MulticastProtocolPermission. |
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(java.security.Permission p)
Checks if this
MulticastProtocolPermission object "implies"
the specified permission. |
java.security.PermissionCollection |
newPermissionCollection()
Returns a new
PermissionCollection for storing
MulticastProtocolPermission objects. |
getProtocol, getURIpublic MulticastProtocolPermission(java.lang.String uri)
MulticastProtocolPermission with the
specified URI as its name. The URI string must conform to the
specification given above, and is
normalized
to facilitate subsequent comparisons.uri - the URI string.java.lang.IllegalArgumentException - if uri is malformed.java.lang.NullPointerException - if uri is null.Permission.getName()public boolean equals(java.lang.Object obj)
MulticastProtocolPermission objects for equality.equals in class java.security.Permissionobj - the object we are testing for equality with this object.true if obj is a
MulticastProtocolPermission and has the same URI string as
this MulticastProtocolPermission object.Object.hashCode(),
HashMappublic java.lang.String getActions()
MulticastProtocolPermission.getActions in class java.security.Permissionpublic int hashCode()
hashCode in class java.security.PermissionObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public boolean implies(java.security.Permission p)
MulticastProtocolPermission object "implies"
the specified permission.
To determine whether this object implies another permission, p, this method first ensures that all of the following are true (and returns false if any of them are not):
Then implies checks each of the following, in order,
and for each returns true if the stated condition is true:
If none of the above are true, implies returns false.
implies in class java.security.Permissionp - the permission to check against.true if the specified permission is implied by this object,
false if not.public java.security.PermissionCollection newPermissionCollection()
PermissionCollection for storing
MulticastProtocolPermission objects.
MulticastProtocolPermission 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.
If null is returned,
then the caller of this method is free to store permissions of this
type in any PermissionCollection they choose (one that uses a Hashtable,
one that uses a Vector, etc).
newPermissionCollection in class java.security.PermissionPermissionCollection suitable for storing
MulticastProtocolPermission objects, or
null if one is not defined.Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. Use of this specification is subject to license terms.