java.lang.Objectjava.security.Permission
java.net.SocketPermission
public final class SocketPermission
This class represents access to a network via sockets. A SocketPermission consists of a host specification and a set of "actions" specifying ways to connect to that host. The host is specified as
host = (hostname | IPv4address | iPv6reference) [:portrange] portrange = portnumber | -portnumber | portnumber-[portnumber]
The format of the IPv6reference should follow that specified in RFC 2732: Format for Literal IPv6 Addresses in URLs:
ipv6reference = "[" IPv6address "]"
} else { }
The full uncompressed form of an IPv6 literal address is also valid.
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.
The possible ways to connect to the host are
accept connect listen resolveThe "listen" action is only meaningful when used with "localhost". The "resolve" action is implied when any of the other actions are present. The action "resolve" refers to host/ip name service lookups.
As an example of the creation and meaning of SocketPermissions, note that if the following permission:
puffin.eng.sun.com, and to accept connections on that port.
Similarly, if the following permission:
Note: Granting code permission to accept or make connections to remote hosts may be dangerous because malevolent code can then more easily transfer and share confidential data among parties who may not otherwise have access to the data.
Permissions,
SocketPermission| Constructor Summary | |
|---|---|
SocketPermission(String host,
String action)
Creates a new SocketPermission object with the specified actions. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Checks two SocketPermission objects for equality. |
String |
getActions()
Returns the canonical string representation of the actions. |
int |
hashCode()
Returns the hash code value for this object. |
boolean |
implies(Permission p)
Checks if this socket permission object "implies" the specified permission. |
PermissionCollection |
newPermissionCollection()
Returns a new PermissionCollection object for storing SocketPermission objects. |
| 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 SocketPermission(String host, String action)
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 SocketPermission instantiation are the following:
host - the hostname or IPaddress of the computer, optionally
including a colon followed by a port or port range.action - the action string.| Method Detail |
|---|
public boolean implies(Permission p)
More specifically, this method first ensures that all of the following are true (and returns false if any of them are not):
implies checks each of the following, in order,
and for each returns true if the stated condition is true:
implies returns false.
implies in class Permissionp - the permission to check against.
public boolean equals(Object obj)
equals in class Permissionobj - the object to test for equality with this object.
Object.hashCode(),
Hashtablepublic int hashCode()
hashCode in class PermissionObject.equals(java.lang.Object),
Hashtablepublic String getActions()
getActions in class Permissionpublic PermissionCollection newPermissionCollection()
SocketPermission 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 PermissionCes informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
6 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)