Java Code Examples for org.apache.ignite.configuration.IgniteConfiguration#setPluginProviders()

The following examples show how to use org.apache.ignite.configuration.IgniteConfiguration#setPluginProviders() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JdbcThinConnectionAdditionalSecurityTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@SuppressWarnings("deprecation")
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setMarshaller(new BinaryMarshaller());

    cfg.setPluginProviders(new TestAdditionalSecurityPluginProvider("srv_" + igniteInstanceName, null, ALLOW_ALL,
        false, true, clientData()));

    cfg.setClientConnectorConfiguration(
        new ClientConnectorConfiguration()
            .setSslEnabled(true)
            .setUseIgniteSslContextFactory(setSslCtxFactoryToIgnite)
            .setSslClientAuth(true)
            .setSslContextFactory(setSslCtxFactoryToCli ? sslCtxFactory : null));

    cfg.setSslContextFactory(setSslCtxFactoryToIgnite ? sslCtxFactory : null);

    return cfg;
}
 
Example 2
Source File: GridDiscoveryManagerAttributesSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    if (binaryMarshallerEnabled)
        cfg.setMarshaller(new BinaryMarshaller());

    cfg.setIncludeProperties(PREFER_IPV4);
    cfg.setDeploymentMode(mode);
    cfg.setPeerClassLoadingEnabled(p2pEnabled);

    if (secEnabled)
        cfg.setPluginProviders(new TestReconnectSecurityPluginProvider());

    return cfg;
}
 
Example 3
Source File: MessageDirectTypeIdConflictTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setPluginProviders(new TestPluginProvider());

    return cfg;
}
 
Example 4
Source File: CommonSecurityCheckTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @param instanceName Instance name.
 */
@Override protected IgniteConfiguration getConfiguration(String instanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(instanceName);

    cfg.setActiveOnStart(false);

    boolean isClient = instanceName.endsWith("2");
    String name = isClient ? "client_" + instanceName : "srv_" + instanceName;

    cfg.setPluginProviders(getPluginProvider(name));

    SslContextFactory sslFactory = (SslContextFactory) GridTestUtils.sslFactory();

    cfg.setSslContextFactory(sslFactory);
    cfg.setConnectorConfiguration(new ConnectorConfiguration()
        .setSslEnabled(true)
        .setSslClientAuth(true)
        .setSslClientAuth(true)
        .setSslFactory(sslFactory));

    cfg.setClientConnectorConfiguration(new ClientConnectorConfiguration()
        .setSslEnabled(true)
        .setSslClientAuth(true)
        .setUseIgniteSslContextFactory(false)
        .setSslContextFactory(sslFactory));

    if (instanceName.endsWith("0"))
        cfg.setGridLogger(listeningLog);

    if (isClient)
        cfg.setClientMode(true);

    if (!fail) {
        Map<String, String> attrs = new UserAttributesFactory().create();

        cfg.setUserAttributes(attrs);
    }

    return cfg;
}
 
Example 5
Source File: RestProcessorInitializationTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * @throws Exception if failed.
 */
@Test
public void testCustomRestProcessorInitialization() throws Exception {
    IgniteConfiguration cfg = getConfiguration(getTestIgniteInstanceName(0));

    cfg.setPluginProviders(new TestRestProcessorProvider());

    IgniteEx ignite = startGrid(cfg);

    assertEquals(ignite.context().rest().getClass(), TestGridRestProcessorImpl.class);
}
 
Example 6
Source File: TcpDiscoveryNodeAttributesUpdateOnReconnectTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    if (gridName.contains("client")) {
        Map<String, String> attrs = new HashMap<>();

        attrs.put("test", "1");

        cfg.setUserAttributes(attrs);
    }

    IgniteClientReconnectAbstractTest.TestTcpDiscoverySpi spi = new IgniteClientReconnectAbstractTest.TestTcpDiscoverySpi();

    TcpDiscoveryIpFinder finder = ((TcpDiscoverySpi)cfg.getDiscoverySpi()).getIpFinder();

    spi.setIpFinder(finder);

    cfg.setDiscoverySpi(spi);

    cfg.setPluginProviders(new TestReconnectSecurityPluginProvider());

    return cfg;
}
 
Example 7
Source File: GridCacheMessageSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setIncludeEventTypes((int[])null);

    cfg.setFailureHandler(new TestFailureHandler());

    CacheConfiguration<?, ?> ccfg = new CacheConfiguration<>(DEFAULT_CACHE_NAME);

    ccfg.setCacheMode(CacheMode.PARTITIONED);
    ccfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    ccfg.setWriteSynchronizationMode(FULL_SYNC);

    ccfg.setBackups(0);

    cfg.setCacheConfiguration(ccfg);

    cfg.setPluginProviders(new TestPluginProvider());

    return cfg;
}
 
Example 8
Source File: PluginConfigurationTest.java    From ignite with Apache License 2.0 3 votes vote down vote up
/**
 * Asserts expectations.
 *
 * @param cfgProviders Config providers.
 * @param expProviders Expected providers.
 */
@SuppressWarnings("rawtypes")
private void doTest(PluginProvider<?>[] cfgProviders, List<PluginProvider> expProviders) throws Exception {
    List<String> exp = toClasses(expProviders);

    IgniteConfiguration cfg = getConfiguration();

    cfg.setPluginProviders(cfgProviders);

    IgniteEx ignite = startGrid(cfg);

    List<String> providers = toClasses(ignite.context().plugins().allProviders());

    assertEqualsCollections(exp, providers);
}
 
Example 9
Source File: TcpCommunicationStatisticsTest.java    From ignite with Apache License 2.0 3 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setConsistentId(igniteInstanceName);

    TcpCommunicationSpi spi = new SynchronizedCommunicationSpi();

    cfg.setCommunicationSpi(spi);

    cfg.setPluginProviders(new TestPluginProvider());

    return cfg;
}
 
Example 10
Source File: GridCommunicationSendMessageSelfTest.java    From ignite with Apache License 2.0 3 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

    c.setPluginProviders(new TestPluginProvider());

    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();

    c.setCommunicationSpi(commSpi);

    return c;
}
 
Example 11
Source File: GridManagerLocalMessageListenerSelfTest.java    From ignite with Apache License 2.0 3 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration c = super.getConfiguration(igniteInstanceName);

    c.setPluginProviders(new TestPluginProvider());

    TcpCommunicationSpi commSpi = new TcpCommunicationSpi();

    c.setCommunicationSpi(commSpi);

    return c;
}
 
Example 12
Source File: GridCacheConditionalDeploymentSelfTest.java    From ignite with Apache License 2.0 3 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setCacheConfiguration(cacheConfiguration());

    cfg.setPluginProviders(new TestPluginProvider());

    return cfg;
}