Package org.osgi.service.wireadmin
Class WirePermission
- java.lang.Object
-
- java.security.Permission
-
- java.security.BasicPermission
-
- org.osgi.service.wireadmin.WirePermission
-
- All Implemented Interfaces:
java.io.Serializable,java.security.Guard
public final class WirePermission extends java.security.BasicPermissionPermission for the scope of aWireobject. When aEnvelopeobject is used for communication with thepollorupdatemethod, and the scope is set, then theWireobject must verify that the Consumer service hasWirePermission[name,CONSUME]and the Producer service hasWirePermission[name,PRODUCE]for all names in the scope.The names are compared with the normal rules for permission names. This means that they may end with a "*" to indicate wildcards. E.g. Door.* indicates all scope names starting with the string "Door". The last period is required due to the implementations of the
BasicPermissionclass.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WirePermission(java.lang.String name, java.lang.String actions)Create a new WirePermission with the given name (may be wildcard) and actions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Determines the equality of twoWirePermissionobjects.java.lang.StringgetActions()Returns the canonical string representation of the actions.inthashCode()Returns the hash code value for this object.booleanimplies(java.security.Permission p)Checks if thisWirePermissionobjectimpliesthe specified permission.java.security.PermissionCollectionnewPermissionCollection()Returns a newPermissionCollectionobject for storingWirePermissionobjects.java.lang.StringtoString()Returns a string describing thisWirePermission.
-
-
-
Field Detail
-
PRODUCE
public static final java.lang.String PRODUCE
The action string for theproduceaction.- See Also:
- Constant Field Values
-
CONSUME
public static final java.lang.String CONSUME
The action string for theconsumeaction.- See Also:
- Constant Field Values
-
-
Method Detail
-
implies
public boolean implies(java.security.Permission p)
Checks if thisWirePermissionobjectimpliesthe specified permission.More specifically, this method returns
trueif:- p is an instanceof the
WirePermissionclass, - p's actions are a proper subset of this object's actions, and
- p's name is implied by this object's name. For example,
java.*impliesjava.home.
- Overrides:
impliesin classjava.security.BasicPermission- Parameters:
p- The permission to check against.- Returns:
trueif the specified permission is implied by this object;falseotherwise.
- p is an instanceof the
-
getActions
public java.lang.String getActions()
Returns the canonical string representation of the actions. Always returns present actions in the following order:produce,consume.- Overrides:
getActionsin classjava.security.BasicPermission- Returns:
- The canonical string representation of the actions.
-
newPermissionCollection
public java.security.PermissionCollection newPermissionCollection()
Returns a newPermissionCollectionobject for storingWirePermissionobjects.- Overrides:
newPermissionCollectionin classjava.security.BasicPermission- Returns:
- A new
PermissionCollectionobject suitable for storingWirePermissionobjects.
-
equals
public boolean equals(java.lang.Object obj)
Determines the equality of twoWirePermissionobjects. Checks that specified object has the same name and actions as thisWirePermissionobject.- Overrides:
equalsin classjava.security.BasicPermission- Parameters:
obj- The object to test for equality.- Returns:
- true if
objis aWirePermission, and has the same name and actions as thisWirePermissionobject;falseotherwise.
-
hashCode
public int hashCode()
Returns the hash code value for this object.- Overrides:
hashCodein classjava.security.BasicPermission- Returns:
- Hash code value for this object.
-
toString
public java.lang.String toString()
Returns a string describing thisWirePermission. The convention is to specify the class name, the permission name, and the actions in the following format: '(org.osgi.service.wireadmin.WirePermission "name" "actions")'.- Overrides:
toStringin classjava.security.Permission- Returns:
- information about this
Permissionobject.
-
-