org.apache.felix.ipojo.util
Class SecurityHelper

java.lang.Object
  extended by org.apache.felix.ipojo.util.SecurityHelper

public class SecurityHelper
extends Object

Methods checking security permissions.

Author:
Felix Project Team

Constructor Summary
SecurityHelper()
           
 
Method Summary
static boolean hasPermissionToGetService(String itf, BundleContext comp)
          Checks if the component bundle context has enough permission to get the given service.
static boolean hasPermissionToGetServices(String[] itfs, BundleContext comp)
          Checks if the component bundle context has enough permission to get the given services.
static boolean hasPermissionToRegisterService(String itf, BundleContext comp)
          Checks if the component bundle context has enough permission to register the given service.
static boolean hasPermissionToRegisterServices(String[] itfs, BundleContext comp)
          Checks if the component bundle context has enough permission to register the given services.
static BundleContext selectContextToGetService(String itf, BundleContext comp, BundleContext ipojo)
          Gets a bundle context to get the given service.
static BundleContext selectContextToRegisterService(String itf, BundleContext comp, BundleContext ipojo)
          Gets a bundle context to register the given service.
static BundleContext selectContextToRegisterServices(String[] itfs, BundleContext comp, BundleContext ipojo)
          Gets a bundle context to register the given services.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityHelper

public SecurityHelper()
Method Detail

selectContextToRegisterServices

public static BundleContext selectContextToRegisterServices(String[] itfs,
                                                            BundleContext comp,
                                                            BundleContext ipojo)
Gets a bundle context to register the given services. This method can be used only if iPOJO is able to registers the services (so for ManagedServiceFactory, Factory and Architecture)

Parameters:
itfs - the service interfaces
comp - the component bundle context
ipojo - the ipojo bundle context
Returns:
comp if the bundle has enough permission to register the service, ipojo otherwise.

selectContextToRegisterService

public static BundleContext selectContextToRegisterService(String itf,
                                                           BundleContext comp,
                                                           BundleContext ipojo)
Gets a bundle context to register the given service. This method can be used only if iPOJO is able to registers the service (so for ManagedServiceFactory, Factory and Architecture)

Parameters:
itf - the service interface
comp - the component bundle context
ipojo - the ipojo bundle context
Returns:
comp if the bundle has enough permission to register the service, ipojo otherwise.

selectContextToGetService

public static BundleContext selectContextToGetService(String itf,
                                                      BundleContext comp,
                                                      BundleContext ipojo)
Gets a bundle context to get the given service. This method can be used only if iPOJO is able to get the service (so for ManagedServiceFactory, Factory, Architecture and LogService)

Parameters:
itf - the service interface
comp - the component bundle context
ipojo - the ipojo bundle context
Returns:
comp if the bundle has enough permission to get the service, ipojo otherwise.

hasPermissionToGetService

public static boolean hasPermissionToGetService(String itf,
                                                BundleContext comp)
Checks if the component bundle context has enough permission to get the given service.

Parameters:
itf - the service interface
comp - the component bundle context
Returns:
true if the bundle has enough permission to get the service, false otherwise.

hasPermissionToGetServices

public static boolean hasPermissionToGetServices(String[] itfs,
                                                 BundleContext comp)
Checks if the component bundle context has enough permission to get the given services.

Parameters:
itfs - the service interfaces
comp - the component bundle context
Returns:
true if the bundle has enough permission to get the services, false otherwise.

hasPermissionToRegisterService

public static boolean hasPermissionToRegisterService(String itf,
                                                     BundleContext comp)
Checks if the component bundle context has enough permission to register the given service.

Parameters:
itf - the service interface
comp - the component bundle context
Returns:
true if the bundle has enough permission to register the service, false otherwise.

hasPermissionToRegisterServices

public static boolean hasPermissionToRegisterServices(String[] itfs,
                                                      BundleContext comp)
Checks if the component bundle context has enough permission to register the given services.

Parameters:
itfs - the service interfaces
comp - the component bundle context
Returns:
true if the bundle has enough permission to register the services, false otherwise.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.