Search in sources :

Example 6 with EncryptionMXBean

use of org.apache.ignite.mxbean.EncryptionMXBean in project ignite by apache.

the class EncryptionMXBeanTest method testMasterKeyChangeOnInactiveAndReadonlyCluster.

/**
 * @throws Exception If failed.
 */
@Test
public void testMasterKeyChangeOnInactiveAndReadonlyCluster() throws Exception {
    IgniteEx grid0 = startGrid(GRID_0);
    assertFalse(grid0.cluster().active());
    EncryptionMXBean mBean = getMBean(GRID_0);
    assertEquals(DEFAULT_MASTER_KEY_NAME, grid0.encryption().getMasterKeyName());
    assertThrowsWithCause(() -> mBean.changeMasterKey(MASTER_KEY_NAME_2), IgniteException.class);
    assertEquals(DEFAULT_MASTER_KEY_NAME, grid0.encryption().getMasterKeyName());
    grid0.cluster().state(ACTIVE_READ_ONLY);
    mBean.changeMasterKey(MASTER_KEY_NAME_2);
    assertEquals(MASTER_KEY_NAME_2, grid0.encryption().getMasterKeyName());
}
Also used : IgniteEx(org.apache.ignite.internal.IgniteEx) EncryptionMXBean(org.apache.ignite.mxbean.EncryptionMXBean) Test(org.junit.Test)

Aggregations

EncryptionMXBean (org.apache.ignite.mxbean.EncryptionMXBean)6 IgniteEx (org.apache.ignite.internal.IgniteEx)5 Test (org.junit.Test)5 ClusterLocalNodeMetricsMXBeanImpl (org.apache.ignite.internal.ClusterLocalNodeMetricsMXBeanImpl)1 ClusterMetricsMXBeanImpl (org.apache.ignite.internal.ClusterMetricsMXBeanImpl)1 ComputeMXBeanImpl (org.apache.ignite.internal.ComputeMXBeanImpl)1 IgniteKernal (org.apache.ignite.internal.IgniteKernal)1 IgniteMXBeanImpl (org.apache.ignite.internal.IgniteMXBeanImpl)1 QueryMXBeanImpl (org.apache.ignite.internal.QueryMXBeanImpl)1 ServiceMXBeanImpl (org.apache.ignite.internal.ServiceMXBeanImpl)1 TransactionMetricsMxBeanImpl (org.apache.ignite.internal.TransactionMetricsMxBeanImpl)1 TransactionsMXBeanImpl (org.apache.ignite.internal.TransactionsMXBeanImpl)1 EncryptionMXBeanImpl (org.apache.ignite.internal.managers.encryption.EncryptionMXBeanImpl)1 DataStorageMXBeanImpl (org.apache.ignite.internal.processors.cache.persistence.DataStorageMXBeanImpl)1 DefragmentationMXBeanImpl (org.apache.ignite.internal.processors.cache.persistence.defragmentation.DefragmentationMXBeanImpl)1 SnapshotMXBeanImpl (org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotMXBeanImpl)1 BaselineAutoAdjustMXBeanImpl (org.apache.ignite.internal.processors.cluster.BaselineAutoAdjustMXBeanImpl)1 MetricsMxBeanImpl (org.apache.ignite.internal.processors.metric.MetricsMxBeanImpl)1 PerformanceStatisticsMBeanImpl (org.apache.ignite.internal.processors.performancestatistics.PerformanceStatisticsMBeanImpl)1 FailureHandlingMxBeanImpl (org.apache.ignite.internal.worker.FailureHandlingMxBeanImpl)1