public final class EndpointPermission
extends java.security.Permission
export
action allows a bundle to export a service as an
Endpoint.import
action allows a bundle to import a service from an
Endpoint.read
action allows a bundle to read references to an
Endpoint.EndpointPermission
to read the specific service.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXPORT
The action string
export . |
static java.lang.String |
IMPORT
The action string
import . |
static java.lang.String |
READ
The action string
read . |
Constructor and Description |
---|
EndpointPermission(EndpointDescription endpoint,
java.lang.String localFrameworkUUID,
java.lang.String actions)
Creates a new requested
EndpointPermission object to be used by
code that must perform checkPermission . |
EndpointPermission(java.lang.String filterString,
java.lang.String actions)
Create a new EndpointPermission with the specified filter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Determines the equality of two EndpointPermission objects.
|
java.lang.String |
getActions()
Returns the canonical string representation of the actions.
|
int |
hashCode()
Returns the hash code value for this object.
|
boolean |
implies(java.security.Permission p)
Determines if a
EndpointPermission object "implies" the specified
permission. |
java.security.PermissionCollection |
newPermissionCollection()
Returns a new
PermissionCollection object for storing
EndpointPermission objects. |
public static final java.lang.String READ
read
.public static final java.lang.String IMPORT
import
. The import
action implies the
read
action.public static final java.lang.String EXPORT
export
. The export
action implies the
read
action.public EndpointPermission(java.lang.String filterString, java.lang.String actions)
The filter will be evaluated against the endpoint properties of a requested EndpointPermission.
There are three possible actions: read
, import
and
export
. The read
action allows the owner of this
permission to see the presence of distributed services. The
import
action allows the owner of this permission to import an
endpoint. The export
action allows the owner of this permission
to export a service.
filterString
- The filter string or "*" to match all
endpoints.actions
- The actions read
, import
, or
export
.java.lang.IllegalArgumentException
- If the filter has an invalid syntax or
the actions are not valid.public EndpointPermission(EndpointDescription endpoint, java.lang.String localFrameworkUUID, java.lang.String actions)
EndpointPermission
object to be used by
code that must perform checkPermission
.
EndpointPermission
objects created with this constructor cannot
be added to an EndpointPermission
permission collection.endpoint
- The requested endpoint.localFrameworkUUID
- The UUID of the local framework. This is used
to support matching the
endpoint.framework.uuid
endpoint property to the
<<LOCAL>>
value in the filter expression.actions
- The actions read
, import
, or
export
.java.lang.IllegalArgumentException
- If the endpoint is null
or the
actions are not valid.public boolean implies(java.security.Permission p)
EndpointPermission
object "implies" the specified
permission.implies
in class java.security.Permission
p
- The target permission to check.true
if the specified permission is implied by this
object; false
otherwise.public java.lang.String getActions()
read
,
import
, export
.getActions
in class java.security.Permission
public java.security.PermissionCollection newPermissionCollection()
PermissionCollection
object for storing
EndpointPermission
objects.newPermissionCollection
in class java.security.Permission
PermissionCollection
object suitable for storing
EndpointPermission
objects.public boolean equals(java.lang.Object obj)
EndpointPermission
.equals
in class java.security.Permission
obj
- The object to test for equality.EndpointPermission
, and has the same
name, actions and endpoint as this EndpointPermission
object; false
otherwise.public int hashCode()
hashCode
in class java.security.Permission
Copyright © OSGi Alliance (2000, 2018). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0