org.apache.felix.eventadmin.impl.security
Class PermissionsUtil

java.lang.Object
  extended by org.apache.felix.eventadmin.impl.security.PermissionsUtil

public abstract class PermissionsUtil
extends Object

Utility class for permissions.

Author:
Felix Project Team

Constructor Summary
PermissionsUtil()
           
 
Method Summary
static Object createPublishPermission(String topic)
          Creates a TopicPermission for the given topic and the type PUBLISH Note that a java.lang.Object is returned in case creating a new TopicPermission fails.
static Object createSubscribePermission(String topic)
          Creates a TopicPermission for the given topic and the type SUBSCRIBE Note that a java.lang.Object is returned in case creating a new TopicPermission fails.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionsUtil

public PermissionsUtil()
Method Detail

createPublishPermission

public static Object createPublishPermission(String topic)
Creates a TopicPermission for the given topic and the type PUBLISH Note that a java.lang.Object is returned in case creating a new TopicPermission fails. This assumes that Bundle.hasPermission is used in order to evaluate the created Permission which in turn will return true if security is not supported by the framework. Otherwise, it will return false due to receiving something that is not a subclass of java.lang.SecurityPermission hence, this combination ensures that access is granted in case a topic permission could not be created due to missing security support by the framework.

Parameters:
topic - The target topic
Returns:
The created permission or a java.lang.Object in case the permission could not be created.
See Also:
TopicPermission

createSubscribePermission

public static Object createSubscribePermission(String topic)
Creates a TopicPermission for the given topic and the type SUBSCRIBE Note that a java.lang.Object is returned in case creating a new TopicPermission fails. This assumes that Bundle.hasPermission is used in order to evaluate the created Permission which in turn will return true if security is not supported by the framework. Otherwise, it will return false due to receiving something that is not a subclass of java.lang.SecurityPermission hence, this combination ensures that access is granted in case a topic permission could not be created due to missing security support by the framework.

Parameters:
topic - The target topic
Returns:
The created permission or a java.lang.Object in case the permission could not be created.
See Also:
TopicPermission


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.