Package org.openengsb.core.common

Examples of org.openengsb.core.common.SecurityAttributeProviderImpl


        defaultWiringService.setBundleContext(bundleContext);
        context.putBean("wiringService", defaultWiringService);
        serviceUtils = new DefaultOsgiUtilsService(bundleContext);
        context.putBean("osgiUtilsService", serviceUtils);
        ConnectorRegistrationManager registrationManager = new ConnectorRegistrationManager(bundleContext,
                mock(TransformationEngine.class), new ForwardMethodInterceptor(), new SecurityAttributeProviderImpl());
        XLinkConnectorManagerImpl serviceManager = new XLinkConnectorManagerImpl();
        serviceManager.setRegistrationManager(registrationManager);

        DummyConfigPersistenceService<String> backend = new DummyConfigPersistenceService<String>();
        DefaultConfigPersistenceService persistenceService = new DefaultConfigPersistenceService(backend);

        serviceManager.setConfigPersistence(persistenceService);

        Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put("configuration.id", Constants.CONFIG_CONNECTOR);
        registerService(persistenceService, props, ConfigPersistenceService.class);

        this.registrationManager = registrationManager;
        this.serviceManager = serviceManager;
        context.putBean("serviceManager", serviceManager);

        userManager = new UserManagerStub();
        userManager.createUser("test");
        userManager.setUserCredentials("test", "password", "password");
        userManager.addPermissionToUser("test", new WicketPermission("USER"));
        userManager.addPermissionToUser("test", new WicketPermission("INDEX"));

        userManager.createUser("user");
        userManager.setUserCredentials("user", "password", "password");
        userManager.addPermissionToUser("user", new WicketPermission("INDEX"));

        userManager.createUser("admin");
        userManager.setUserCredentials("admin", "password", "password");
        userManager.addPermissionToUser("admin", new RootPermission());
        context.putBean("userManager", userManager);

        Dictionary<String, Object> wicketProviderProps = new Hashtable<String, Object>();
        wicketProviderProps.put(org.openengsb.labs.delegation.service.Constants.PROVIDED_CLASSES_KEY,
            WicketPermission.class.getName());
        wicketProviderProps.put(org.openengsb.labs.delegation.service.Constants.DELEGATION_CONTEXT_KEY,
            Constants.DELEGATION_CONTEXT_PERMISSIONS);
        ClassProvider wicketPermissionProvider =
            new ClassProviderImpl(bundle, Sets.newHashSet(WicketPermission.class.getName()));
        registerService(wicketPermissionProvider, wicketProviderProps, ClassProvider.class);

        SecurityAttributeProvider attributeStore = new SecurityAttributeProviderImpl();
        context.putBean("attributeStore", attributeStore);
        context.putBean("attributeProviders", Collections.singletonList(attributeStore));

        context.putBean("domainProviders", makeServiceList(DomainProvider.class));
        context.putBean("permissionProviders", makeServiceList(ClassProvider.class));
View Full Code Here


    }

    private ConnectorManagerImpl createServiceManagerMock() {
        ConnectorManagerImpl serviceManagerImpl = new ConnectorManagerImpl();
        ConnectorRegistrationManager registrationManager = new ConnectorRegistrationManager(bundleContext,
                mock(TransformationEngine.class), new ForwardMethodInterceptor(), new SecurityAttributeProviderImpl());
        serviceUtils = new DefaultOsgiUtilsService(bundleContext);
        serviceManagerImpl.setRegistrationManager(registrationManager);
        serviceManagerImpl.setConfigPersistence(configPersistence);
        serviceManager = serviceManagerImpl;
        return serviceManagerImpl;
View Full Code Here

                    return invocation.getArguments()[2];
                }
            });
        MethodInterceptor securityInterceptor = new ForwardMethodInterceptor();
        serviceRegistrationManagerImpl = new ConnectorRegistrationManager(bundleContext, transformationEngine,
            securityInterceptor, new SecurityAttributeProviderImpl());
        serviceUtils = new DefaultOsgiUtilsService(bundleContext);
        mockedServiceUtils = mock(DefaultOsgiUtilsService.class);
        mockedServiceUtils = mock(DefaultOsgiUtilsService.class);
        testConnector = mock(LinkingSupport.class);
        LinkingSupport testConnector2 = mock(LinkingSupport.class);
View Full Code Here

        AdminAccessConnector adminAccessConnector = new AdminAccessConnector();
        adminAccessConnector.setUserManager(userManager);

        registerServiceAtLocation(adminAccessConnector, "authorization/admin", AuthorizationDomain.class);

        attributeStore = new SecurityAttributeProviderImpl();

        ServiceAclServiceImpl serviceAclServiceImpl = new ServiceAclServiceImpl(userManager, Collections
            .singletonList((SecurityAttributeProvider) attributeStore));

        servicePermissionAccessConnector = serviceAclServiceImpl;
View Full Code Here

        callrouter = mock(OutgoingPortUtilService.class);
        MethodResult result = MethodResult.newVoidResult();
        when(callrouter.sendMethodCallWithResult(anyString(), anyString(), any(MethodCall.class))).thenReturn(result);
        registerService(callrouter, new Hashtable<String, Object>(), OutgoingPortUtilService.class);
        registrationManager = new ConnectorRegistrationManager(bundleContext,
                mock(TransformationEngine.class), new ForwardMethodInterceptor(), new SecurityAttributeProviderImpl());
        ProxyConnectorProvider proxyConnectorProvider = new ProxyConnectorProvider();
        proxyConnectorProvider.setId(Constants.EXTERNAL_CONNECTOR_PROXY);
        proxyConnectorProvider.setBundleContext(bundleContext);
        proxyConnectorProvider.setOutgoingPortUtilService(callrouter);
        connectorRegistry = new ProxyConnectorRegistryImpl();
View Full Code Here

    @Before
    public void setUp() throws Exception {
        DefaultOsgiUtilsService defaultOsgiUtilsService = new DefaultOsgiUtilsService();
        defaultOsgiUtilsService.setBundleContext(bundleContext);
        connectorRegistrationManager = new ConnectorRegistrationManager(bundleContext,
                mock(TransformationEngine.class), new ForwardMethodInterceptor(), new SecurityAttributeProviderImpl());
        connectorInstanceFactory = mock(ConnectorInstanceFactory.class);
        Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put("connector", "a");
        props.put("domain", "a");
        registerService(connectorInstanceFactory, props, ConnectorInstanceFactory.class);
View Full Code Here

        registerService(provider, props, VirtualConnectorProvider.class);
    }

    private void setupConnectorManager() {
        ConnectorRegistrationManager serviceRegistrationManagerImpl = new ConnectorRegistrationManager(bundleContext,
                transformationEngine, null, new SecurityAttributeProviderImpl());
        serviceRegistrationManagerImpl.setBundleContext(bundleContext);

        ConnectorManagerImpl serviceManagerImpl = new ConnectorManagerImpl();
        serviceManagerImpl.setRegistrationManager(serviceRegistrationManagerImpl);
        serviceManagerImpl.setConfigPersistence(registerConfigPersistence());
View Full Code Here

TOP

Related Classes of org.openengsb.core.common.SecurityAttributeProviderImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.