Additional top-level class in compilation unit: TopicPermissionCollection.
A topic is a slash-separated string that defines a topic.
For example:
org/osgi/service/foo/FooEvent/ACTION
TopicPermission has two actions: publish and
subscribe.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private transient int | action_mask
The actions mask. |
| private static final int | |
| private static final int | |
| private static final int | |
| private volatile String | actions
The actions in canonical form. |
| private transient volatile String | prefix
prefix if the name is wildcarded. |
| public static final String | PUBLISH
The action string |
| pack-priv static final long | |
| public static final String | SUBSCRIBE
The action string |
| Access | Constructor and Description |
|---|---|
| public | TopicPermission(String
Topic name. name, String publish,subscribe (canonical order).Defines the authority to publish and/or subscribe to a topic within the EventAdmin service. |
| pack-priv | TopicPermission(String
class name name, int action mask mask)Package private constructor used by TopicPermissionCollection. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if obj is a TopicPermission, and has
the same topic name and actions as this TopicPermission
object; false otherwise.The object to test for equality with this
obj)TopicPermission object.Implements abstract java. Determines the equality of two |
| public String | Returns: Canonical string representation of theTopicPermission
actions.Implements abstract java. Returns the canonical string representation of the
|
| pack-priv synchronized int | |
| public int | Returns: A hash code value for this object.Implements abstract java. Returns the hash code value for this object. |
| public boolean | Returns: true if the specified TopicPermission action is
implied by this object; false otherwise.The target permission to interrogate. p)Implements abstract java. Determines if the specified permission is implied by this object. |
| public PermissionCollection | Returns: A newPermissionCollection object.Overrides java. Returns a new |
| private static int | Returns: action mask.Action string. actions)Parse action string into action mask. |
| private synchronized void | readObject(ObjectInputStream s)
readObject is called to restore the state of this permission from a stream. |
| private synchronized void | |
| private synchronized void | writeObject(ObjectOutputStream s)
WriteObject is called to save the state of this permission object to a stream. |
| ACTION_ALL | back to summary |
|---|---|
| private static final int ACTION_ALL | |
| action_mask | back to summary |
|---|---|
| private transient int action_mask The actions mask. | |
| ACTION_NONE | back to summary |
|---|---|
| private static final int ACTION_NONE | |
| ACTION_PUBLISH | back to summary |
|---|---|
| private static final int ACTION_PUBLISH | |
| ACTION_SUBSCRIBE | back to summary |
|---|---|
| private static final int ACTION_SUBSCRIBE | |
| actions | back to summary |
|---|---|
| private volatile String actions The actions in canonical form. | |
| prefix | back to summary |
|---|---|
| private transient volatile String prefix prefix if the name is wildcarded. | |
| PUBLISH | back to summary |
|---|---|
| public static final String PUBLISH The action string | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID | |
| SUBSCRIBE | back to summary |
|---|---|
| public static final String SUBSCRIBE The action string | |
| TopicPermission | back to summary |
|---|---|
| public TopicPermission(String name, String actions) Defines the authority to publish and/or subscribe to a topic within the EventAdmin service. The name is specified as a slash-separated string. Wildcards may be used. For example: org/osgi/service/fooFooEvent/ACTION com/isv/* *
A bundle that needs to publish events on a topic must have the
appropriate
| |
| TopicPermission | back to summary |
|---|---|
| pack-priv TopicPermission(String name, int mask) Package private constructor used by TopicPermissionCollection.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Implements abstract java. Determines the equality of two | |
| getActions | back to summary |
|---|---|
| public String getActions() Implements abstract java. Returns the canonical string representation of the
Always returns present | |
| getActionsMask | back to summary |
|---|---|
| pack-priv synchronized int getActionsMask() Returns the current action mask. Used by the TopicPermissionCollection class.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract java. Returns the hash code value for this object.
| |
| implies | back to summary |
|---|---|
| public boolean implies(Permission p) Implements abstract java. Determines if the specified permission is implied by this object.
This method checks that the topic name of the target is implied by the
topic name of this object. The list of x/y/*,"publish" -> x/y/z,"publish" is true *,"subscribe" -> x/y,"subscribe" is true *,"publish" -> x/y,"subscribe" is false x/y,"publish" -> x/y/z,"publish" is false
| |
| newPermissionCollection | back to summary |
|---|---|
| public PermissionCollection newPermissionCollection() Overrides java. Returns a new
| |
| parseActions | back to summary |
|---|---|
| private static int parseActions(final String actions) Parse action string into action mask.
| |
| readObject | back to summary |
|---|---|
| private synchronized void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException readObject is called to restore the state of this permission from a stream. | |
| setTransients | back to summary |
|---|---|
| private synchronized void setTransients(final int mask) Called by constructors and when deserialized.
| |
| writeObject | back to summary |
|---|---|
| private synchronized void writeObject(ObjectOutputStream s) throws IOException WriteObject is called to save the state of this permission object to a stream. The actions are serialized, and the superclass takes care of the name. | |