test_class.declarator: HTTP_SERVICE_FILTER = "(objectClass=org.osgi.service.http.HttpService)"
test_class.modifier: private static final
test_class.original_string: private static final String HTTP_SERVICE_FILTER = "(objectClass=org.osgi.service.http.HttpService)";
test_class.type: String
test_class.var_name: HTTP_SERVICE_FILTER
test_class.declarator: CONFIG_SERVICE_FILTER = "(objectClass=org.osgi.service.cm.ConfigurationAdmin)"
test_class.modifier: private static final
test_class.original_string: private static final String CONFIG_SERVICE_FILTER = "(objectClass=org.osgi.service.cm.ConfigurationAdmin)";
test_class.type: String
test_class.var_name: CONFIG_SERVICE_FILTER
test_class.declarator: AUTHENTICATOR_SERVICE_FILTER =
          "(objectClass=" + Authenticator.class.getName() + ")"
test_class.modifier: private static final
test_class.original_string: private static final String AUTHENTICATOR_SERVICE_FILTER =
          "(objectClass=" + Authenticator.class.getName() + ")";
test_class.type: String
test_class.var_name: AUTHENTICATOR_SERVICE_FILTER
test_class.declarator: context
test_class.modifier: private
test_class.original_string: private BundleContext context;
test_class.type: BundleContext
test_class.var_name: context
test_class.declarator: activator
test_class.modifier: private
test_class.original_string: private JolokiaActivator activator;
test_class.type: JolokiaActivator
test_class.var_name: activator
test_class.declarator: httpServiceListener
test_class.modifier: private
test_class.original_string: private ServiceListener httpServiceListener;
test_class.type: ServiceListener
test_class.var_name: httpServiceListener
test_class.declarator: registration
test_class.modifier: private
test_class.original_string: private ServiceRegistration registration;
test_class.type: ServiceRegistration
test_class.var_name: registration
test_class.declarator: httpService
test_class.modifier: private
test_class.original_string: private HttpService httpService;
test_class.type: HttpService
test_class.var_name: httpService
test_class.declarator: httpServiceReference
test_class.modifier: private
test_class.original_string: private ServiceReference httpServiceReference;
test_class.type: ServiceReference
test_class.var_name: httpServiceReference
test_class.declarator: configAdminRef
test_class.modifier: private
test_class.original_string: private ServiceReference configAdminRef;
test_class.type: ServiceReference
test_class.var_name: configAdminRef
test_class.declarator: configAdminServiceListener
test_class.modifier: private
test_class.original_string: private ServiceListener configAdminServiceListener;
test_class.type: ServiceListener
test_class.var_name: configAdminServiceListener
test_class.declarator: authenticationServiceListener
test_class.modifier: private
test_class.original_string: private ServiceListener authenticationServiceListener;
test_class.type: ServiceListener
test_class.var_name: authenticationServiceListener
test_class.file: agent/osgi/src/test/java/org/jolokia/osgi/JolokiaActivatorTest.java
test_class.identifier: JolokiaActivatorTest
test_case.body: @Test
      public void testNoServiceAvailable() throws Exception {
          final HttpServletRequest request = createMock(HttpServletRequest.class);
          final HttpServletResponse response = createNiceMock(HttpServletResponse.class);
          final Dictionary<String, String> dict = new Hashtable<String, String>();
          dict.put("org.jolokia.authMode", "service-all");
          startActivator(true, AUTHENTICATOR_SERVICE_FILTER, dict);
          startupHttpServiceWithConfigAdminProps(true);
  
          expect(request.getHeader("Authorization")).andReturn("Basic cm9sYW5kOnMhY3IhdA==");
          request.setAttribute(HttpContext.AUTHENTICATION_TYPE, HttpServletRequest.BASIC_AUTH);
          request.setAttribute(HttpContext.REMOTE_USER, "roland");
          replay(request, response);
  
          // w/o an Authenticator Service registered, requests should always be denied.
  
          final HttpContext httpContext = activator.getHttpContext();
          assertFalse(httpContext.handleSecurity(request, response));
  
          unregisterJolokiaServlet();
          stopActivator(true);
      }
test_case.class_method_signature: JolokiaActivatorTest.testNoServiceAvailable()
test_case.full_signature: @Test public void testNoServiceAvailable()
test_case.identifier: testNoServiceAvailable
test_case.invocations: createMock createNiceMock put startActivator startupHttpServiceWithConfigAdminProps andReturn expect getHeader setAttribute setAttribute replay getHttpContext assertFalse handleSecurity unregisterJolokiaServlet stopActivator
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNoServiceAvailable()
focal_class.declarator: HTTP_SERVICE_FILTER_BASE =
              "(" + Constants.OBJECTCLASS + "=" + HttpService.class.getName() + ")"
focal_class.modifier: public static final
focal_class.original_string: public static final String HTTP_SERVICE_FILTER_BASE =
              "(" + Constants.OBJECTCLASS + "=" + HttpService.class.getName() + ")";
focal_class.type: String
focal_class.var_name: HTTP_SERVICE_FILTER_BASE
focal_class.declarator: bundleContext
focal_class.modifier: private
focal_class.original_string: private BundleContext bundleContext;
focal_class.type: BundleContext
focal_class.var_name: bundleContext
focal_class.declarator: httpServiceTracker
focal_class.modifier: private
focal_class.original_string: private ServiceTracker httpServiceTracker;
focal_class.type: ServiceTracker
focal_class.var_name: httpServiceTracker
focal_class.declarator: configAdminTracker
focal_class.modifier: private
focal_class.original_string: private ServiceTracker configAdminTracker;
focal_class.type: ServiceTracker
focal_class.var_name: configAdminTracker
focal_class.declarator: CONFIG_PREFIX = "org.jolokia"
focal_class.modifier: private static final
focal_class.original_string: private static final String CONFIG_PREFIX = "org.jolokia";
focal_class.type: String
focal_class.var_name: CONFIG_PREFIX
focal_class.declarator: CONFIG_ADMIN_PID = "org.jolokia.osgi"
focal_class.modifier: private static final
focal_class.original_string: private static final String CONFIG_ADMIN_PID = "org.jolokia.osgi";
focal_class.type: String
focal_class.var_name: CONFIG_ADMIN_PID
focal_class.declarator: jolokiaHttpContext
focal_class.modifier: private
focal_class.original_string: private HttpContext jolokiaHttpContext;
focal_class.type: HttpContext
focal_class.var_name: jolokiaHttpContext
focal_class.declarator: jolokiaServiceRegistration
focal_class.modifier: private
focal_class.original_string: private ServiceRegistration jolokiaServiceRegistration;
focal_class.type: ServiceRegistration
focal_class.var_name: jolokiaServiceRegistration
focal_class.declarator: restrictor = null
focal_class.modifier: private
focal_class.original_string: private Restrictor restrictor = null;
focal_class.type: Restrictor
focal_class.var_name: restrictor
focal_class.file: agent/osgi/src/main/java/org/jolokia/osgi/JolokiaActivator.java
focal_class.identifier: JolokiaActivator
focal_class.interfaces: implements BundleActivator, JolokiaContext
focal_class.class_method_signature: JolokiaActivator.start(BundleContext pBundleContext)
focal_class.full_signature: public void start(BundleContext pBundleContext)
focal_class.identifier: start
focal_class.modifiers: public
focal_class.parameters: (BundleContext pBundleContext)
focal_class.return: void
focal_class.signature: void start(BundleContext pBundleContext)
focal_class.class_method_signature: JolokiaActivator.stop(BundleContext pBundleContext)
focal_class.full_signature: public void stop(BundleContext pBundleContext)
focal_class.identifier: stop
focal_class.modifiers: public
focal_class.parameters: (BundleContext pBundleContext)
focal_class.return: void
focal_class.signature: void stop(BundleContext pBundleContext)
focal_class.class_method_signature: JolokiaActivator.getHttpContext()
focal_class.full_signature: public synchronized HttpContext getHttpContext()
focal_class.identifier: getHttpContext
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: HttpContext
focal_class.signature: HttpContext getHttpContext()
focal_class.class_method_signature: JolokiaActivator.getServletAlias()
focal_class.full_signature: public String getServletAlias()
focal_class.identifier: getServletAlias
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getServletAlias()
focal_class.class_method_signature: JolokiaActivator.getConfiguration()
focal_class.full_signature: private Dictionary<String,String> getConfiguration()
focal_class.identifier: getConfiguration
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Dictionary<String,String>
focal_class.signature: Dictionary<String,String> getConfiguration()
focal_class.class_method_signature: JolokiaActivator.getConfiguration(ConfigKey pKey)
focal_class.full_signature: private String getConfiguration(ConfigKey pKey)
focal_class.identifier: getConfiguration
focal_class.modifiers: private
focal_class.parameters: (ConfigKey pKey)
focal_class.return: String
focal_class.signature: String getConfiguration(ConfigKey pKey)
focal_class.class_method_signature: JolokiaActivator.getConfigurationFromConfigAdmin(ConfigKey pkey)
focal_class.full_signature: private String getConfigurationFromConfigAdmin(ConfigKey pkey)
focal_class.identifier: getConfigurationFromConfigAdmin
focal_class.modifiers: private
focal_class.parameters: (ConfigKey pkey)
focal_class.return: String
focal_class.signature: String getConfigurationFromConfigAdmin(ConfigKey pkey)
focal_class.class_method_signature: JolokiaActivator.buildHttpServiceFilter(BundleContext pBundleContext)
focal_class.full_signature: private Filter buildHttpServiceFilter(BundleContext pBundleContext)
focal_class.identifier: buildHttpServiceFilter
focal_class.modifiers: private
focal_class.parameters: (BundleContext pBundleContext)
focal_class.return: Filter
focal_class.signature: Filter buildHttpServiceFilter(BundleContext pBundleContext)
focal_class.class_method_signature: JolokiaActivator.createAuthenticator(String authMode)
focal_class.full_signature: private Authenticator createAuthenticator(String authMode)
focal_class.identifier: createAuthenticator
focal_class.modifiers: private
focal_class.parameters: (String authMode)
focal_class.return: Authenticator
focal_class.signature: Authenticator createAuthenticator(String authMode)
focal_class.class_method_signature: JolokiaActivator.createCustomAuthenticator()
focal_class.full_signature: private Authenticator createCustomAuthenticator()
focal_class.identifier: createCustomAuthenticator
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Authenticator
focal_class.signature: Authenticator createCustomAuthenticator()
focal_class.class_method_signature: JolokiaActivator.lookupAuthenticator(final Class<?> pAuthClass)
focal_class.full_signature: private Authenticator lookupAuthenticator(final Class<?> pAuthClass)
focal_class.identifier: lookupAuthenticator
focal_class.modifiers: private
focal_class.parameters: (final Class<?> pAuthClass)
focal_class.return: Authenticator
focal_class.signature: Authenticator lookupAuthenticator(final Class<?> pAuthClass)
focal_class.class_method_signature: JolokiaActivator.lookupAuthenticatorWithDefaultConstructor(final Class<?> pAuthClass, final NoSuchMethodException ignore)
focal_class.full_signature: private Authenticator lookupAuthenticatorWithDefaultConstructor(final Class<?> pAuthClass, final NoSuchMethodException ignore)
focal_class.identifier: lookupAuthenticatorWithDefaultConstructor
focal_class.modifiers: private
focal_class.parameters: (final Class<?> pAuthClass, final NoSuchMethodException ignore)
focal_class.return: Authenticator
focal_class.signature: Authenticator lookupAuthenticatorWithDefaultConstructor(final Class<?> pAuthClass, final NoSuchMethodException ignore)
focal_class.class_method_signature: JolokiaActivator.createAuthenticatorFromAuthMode(String pAuthMode)
focal_class.full_signature: private Authenticator createAuthenticatorFromAuthMode(String pAuthMode)
focal_class.identifier: createAuthenticatorFromAuthMode
focal_class.modifiers: private
focal_class.parameters: (String pAuthMode)
focal_class.return: Authenticator
focal_class.signature: Authenticator createAuthenticatorFromAuthMode(String pAuthMode)
focal_method.body: public synchronized HttpContext getHttpContext() {
          if (jolokiaHttpContext == null) {
              final String user = getConfiguration(USER);
              final String authMode = getConfiguration(AUTH_MODE);
              if (user == null) {
                  if (ServiceAuthenticationHttpContext.shouldBeUsed(authMode)) {
                      jolokiaHttpContext = new ServiceAuthenticationHttpContext(bundleContext, authMode);
                  } else {
                      jolokiaHttpContext = new DefaultHttpContext();
                  }
              } else {
                  jolokiaHttpContext =
                      new BasicAuthenticationHttpContext(getConfiguration(REALM),
                                                         createAuthenticator(authMode));
              }
          }
          return jolokiaHttpContext;
      }
focal_method.class_method_signature: JolokiaActivator.getHttpContext()
focal_method.full_signature: public synchronized HttpContext getHttpContext()
focal_method.identifier: getHttpContext
focal_method.invocations: getConfiguration getConfiguration shouldBeUsed getConfiguration createAuthenticator
focal_method.modifiers: public synchronized
focal_method.parameters: ()
focal_method.return: HttpContext
focal_method.signature: HttpContext getHttpContext()