diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..e1d1cc748 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/maven-pr-builder.yaml b/.github/workflows/maven-pr-builder.yaml new file mode 100644 index 000000000..2d2387f1e --- /dev/null +++ b/.github/workflows/maven-pr-builder.yaml @@ -0,0 +1,29 @@ +name: Compile Java source files + +on: + pull_request: + branches: + - main + paths: + - '**/*.java' + - 'pom.xml' + - 'docs/antora.yml' + - '.github/workflows/maven-pr-builder.yaml' + schedule: + - cron: '15 2 * * 0' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + - name: Maven compile + run: | + HZ_VERSION=$(grep full-version docs/antora.yml|sed "s/.*:[ ]*'\(.*\)'/\1/") + mvn --show-version --batch-mode --no-transfer-progress test "-Dhazelcast.version=$HZ_VERSION" diff --git a/.gitignore b/.gitignore index 584542984..3c2fd1beb 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ package-lock.json .project .settings/ .vscode/settings.json +/target/ +.classpath diff --git a/docs/modules/ROOT/examples/dds/map/Employee.java b/docs/modules/ROOT/examples/dds/map/Employee.java index 0bc2213e8..1f3579bdc 100644 --- a/docs/modules/ROOT/examples/dds/map/Employee.java +++ b/docs/modules/ROOT/examples/dds/map/Employee.java @@ -1,7 +1,9 @@ +import com.hazelcast.core.HazelcastJsonValue; + //tag::emp[] public class Employee { public static HazelcastJsonValue asJson(String surname) { return new HazelcastJsonValue("{ \"surname\": \"" + surname + "\" }"); } } -//end::emp[] \ No newline at end of file +//end::emp[] diff --git a/docs/modules/ROOT/examples/dds/map/ListenerWithPredicate.java b/docs/modules/ROOT/examples/dds/map/ListenerWithPredicate.java index 87fa097c7..574128ca7 100644 --- a/docs/modules/ROOT/examples/dds/map/ListenerWithPredicate.java +++ b/docs/modules/ROOT/examples/dds/map/ListenerWithPredicate.java @@ -2,6 +2,7 @@ import com.hazelcast.core.EntryEvent; import com.hazelcast.core.Hazelcast; import com.hazelcast.core.HazelcastInstance; +import com.hazelcast.core.HazelcastJsonValue; import com.hazelcast.map.IMap; import com.hazelcast.map.listener.EntryAddedListener; import com.hazelcast.map.listener.EntryRemovedListener; @@ -41,4 +42,4 @@ public void entryUpdated(EntryEvent event) { } } } -//end::lwp[] \ No newline at end of file +//end::lwp[] diff --git a/docs/modules/ROOT/examples/dds/map/Modify.java b/docs/modules/ROOT/examples/dds/map/Modify.java deleted file mode 100644 index e10ae8160..000000000 --- a/docs/modules/ROOT/examples/dds/map/Modify.java +++ /dev/null @@ -1,21 +0,0 @@ -import com.hazelcast.config.Config; -import com.hazelcast.core.Hazelcast; -import com.hazelcast.core.HazelcastInstance; -import com.hazelcast.map.IMap; - -//tag::modify[] -public class Modify { - - public static void main(String[] args) { - Config config = new Config(); - config.setProperty("hazelcast.map.entry.filtering.natural.event.types", "true"); - HazelcastInstance hz = Hazelcast.newHazelcastInstance(config); - IMap map = hz.getMap("map"); - - map.put("1", new Employee("smith")); - map.put("2", new Employee("jordan")); - System.out.println("done"); - System.exit(0); - } -} -//end::modify[] \ No newline at end of file diff --git a/docs/modules/ROOT/examples/dds/map/Supplement.java b/docs/modules/ROOT/examples/dds/map/Supplement.java index 56f7bcd57..6e840d363 100644 --- a/docs/modules/ROOT/examples/dds/map/Supplement.java +++ b/docs/modules/ROOT/examples/dds/map/Supplement.java @@ -1,3 +1,5 @@ +package dds.map; + import java.io.Serializable; @@ -18,4 +20,4 @@ public String getName() { public Integer getPrice() { return price; } -} \ No newline at end of file +} diff --git a/docs/modules/ROOT/examples/dds/map/YourMapStoreImplementation.java b/docs/modules/ROOT/examples/dds/map/YourMapStoreImplementation.java index 06ec3f58a..6c3016432 100644 --- a/docs/modules/ROOT/examples/dds/map/YourMapStoreImplementation.java +++ b/docs/modules/ROOT/examples/dds/map/YourMapStoreImplementation.java @@ -1,3 +1,5 @@ +package dds.map; + import com.hazelcast.core.HazelcastInstance; import com.hazelcast.map.MapLoaderLifecycleSupport; import com.hazelcast.map.MapStore; @@ -106,4 +108,4 @@ public void delete(String key) { public void deleteAll(Collection keys) { this.collection.deleteMany(in("_id", keys)); } -} \ No newline at end of file +} diff --git a/docs/modules/ROOT/examples/dds/queue/ConsumerMember.java b/docs/modules/ROOT/examples/dds/queue/ConsumerMember.java index 4e47e0953..d70bf1b48 100644 --- a/docs/modules/ROOT/examples/dds/queue/ConsumerMember.java +++ b/docs/modules/ROOT/examples/dds/queue/ConsumerMember.java @@ -7,17 +7,17 @@ public class ConsumerMember { public static void main( String[] args ) throws Exception { HazelcastInstance hz = Hazelcast.newHazelcastInstance(); - IQueue queue = hz.getQueue( "queue" ); <1> + IQueue queue = hz.getQueue( "queue" ); // <1> while ( true ) { - int item = queue.take(); <2> + int item = queue.take(); // <2> System.out.println( "Consumed: " + item ); if ( item == -1 ) { queue.put( -1 ); break; } - Thread.sleep( 5000 ); <3> + Thread.sleep( 5000 ); // <3> } System.out.println( "Consumer Finished!" ); } } -//end::consumer[] \ No newline at end of file +//end::consumer[] diff --git a/docs/modules/ROOT/examples/dds/queue/ProducerMember.java b/docs/modules/ROOT/examples/dds/queue/ProducerMember.java index 78103ace7..802e32155 100644 --- a/docs/modules/ROOT/examples/dds/queue/ProducerMember.java +++ b/docs/modules/ROOT/examples/dds/queue/ProducerMember.java @@ -7,9 +7,9 @@ public class ProducerMember { public static void main( String[] args ) throws Exception { HazelcastInstance hz = Hazelcast.newHazelcastInstance(); - IQueue queue = hz.getQueue( "queue" ); <1> + IQueue queue = hz.getQueue( "queue" ); // <1> - <2> + // <2> for ( int k = 1; k < 100; k++ ) { queue.put( k ); System.out.println( "Producing: " + k ); @@ -19,4 +19,4 @@ public static void main( String[] args ) throws Exception { System.out.println( "Producer Finished!" ); } } -//end::producer[] \ No newline at end of file +//end::producer[] diff --git a/docs/modules/ROOT/examples/dds/queue/TheQueueStore.java b/docs/modules/ROOT/examples/dds/queue/TheQueueStore.java index 3f4001e73..796cba0a8 100644 --- a/docs/modules/ROOT/examples/dds/queue/TheQueueStore.java +++ b/docs/modules/ROOT/examples/dds/queue/TheQueueStore.java @@ -28,7 +28,7 @@ public void deleteAll(Collection keys) { } @Override - <1> + // <1> public Item load(Long key) { System.out.println("load"); return null; @@ -46,4 +46,4 @@ public Set loadAllKeys() { return null; } } -//end::qs[] \ No newline at end of file +//end::qs[] diff --git a/docs/modules/ROOT/examples/distributedcomputing/ScheduledExecutorConfiguration.java b/docs/modules/ROOT/examples/distributedcomputing/ScheduledExecutorConfiguration.java index c7ae5cc65..116e8aefd 100644 --- a/docs/modules/ROOT/examples/distributedcomputing/ScheduledExecutorConfiguration.java +++ b/docs/modules/ROOT/examples/distributedcomputing/ScheduledExecutorConfiguration.java @@ -1,7 +1,9 @@ import com.hazelcast.config.Config; +import com.hazelcast.config.MergePolicyConfig; import com.hazelcast.core.Hazelcast; import com.hazelcast.core.HazelcastInstance; import com.hazelcast.scheduledexecutor.IScheduledExecutorService; +import com.hazelcast.config.ScheduledExecutorConfig; public class ScheduledExecutorConfiguration { public static void main(String[] args) throws Exception{ diff --git a/docs/modules/ROOT/examples/distributedevents/ExampleEntryListener.java b/docs/modules/ROOT/examples/distributedevents/ExampleEntryListener.java index 03a7ebd1e..8f925a20e 100644 --- a/docs/modules/ROOT/examples/distributedevents/ExampleEntryListener.java +++ b/docs/modules/ROOT/examples/distributedevents/ExampleEntryListener.java @@ -16,5 +16,17 @@ public void entryUpdated(EntryEvent event) { public void mapCleared(MapEvent event) { System.out.println( "Map Cleared: " + event ); } + @Override + public void entryRemoved(EntryEvent event) { + } + @Override + public void entryEvicted(EntryEvent event) { + } + @Override + public void entryExpired(EntryEvent event) { + } + @Override + public void mapEvicted(MapEvent event) { + } } -//end::mm[] \ No newline at end of file +//end::mm[] diff --git a/docs/modules/ROOT/examples/distributedevents/Listen.java b/docs/modules/ROOT/examples/distributedevents/Listen.java index 6936d2723..35f64cee5 100644 --- a/docs/modules/ROOT/examples/distributedevents/Listen.java +++ b/docs/modules/ROOT/examples/distributedevents/Listen.java @@ -1,6 +1,6 @@ import com.hazelcast.core.Hazelcast; import com.hazelcast.core.HazelcastInstance; -import com.hazelcast.core.HazelcastClient; +import com.hazelcast.client.HazelcastClient; import com.hazelcast.map.IMap; import com.hazelcast.map.MapEvent; import com.hazelcast.core.EntryEvent; @@ -10,7 +10,7 @@ public class Listen { public static void main( String[] args ) { - HazelcastInstance hz = HazelcastClient.newHazelcastCllient(); + HazelcastInstance hz = HazelcastClient.newHazelcastClient(); IMap map = hz.getMap( "somemap" ); map.addEntryListener( new MyEntryListener(), true ); System.out.println( "EntryListener registered" ); @@ -60,4 +60,4 @@ public void mapCleared( MapEvent event ) { } } } -//end::listen[] \ No newline at end of file +//end::listen[] diff --git a/docs/modules/ROOT/examples/jcache/ExampleJCacheApplication.java b/docs/modules/ROOT/examples/jcache/ExampleJCacheApplication.java index bcd866f63..9e3d9606f 100644 --- a/docs/modules/ROOT/examples/jcache/ExampleJCacheApplication.java +++ b/docs/modules/ROOT/examples/jcache/ExampleJCacheApplication.java @@ -1,3 +1,5 @@ +package jcache; + import javax.cache.Cache; import javax.cache.CacheManager; import javax.cache.Caching; @@ -37,4 +39,4 @@ public static void main(String[] args){ System.out.println( value ); //end::jcacheapp[] } -} \ No newline at end of file +} diff --git a/docs/modules/ROOT/examples/jcache/PartitionLostListenerUsage.java b/docs/modules/ROOT/examples/jcache/PartitionLostListenerUsage.java index aa58b027c..421634479 100644 --- a/docs/modules/ROOT/examples/jcache/PartitionLostListenerUsage.java +++ b/docs/modules/ROOT/examples/jcache/PartitionLostListenerUsage.java @@ -1,3 +1,5 @@ +package jcache; + import com.hazelcast.cache.ICache; import com.hazelcast.cache.impl.event.CachePartitionLostEvent; import com.hazelcast.cache.impl.event.CachePartitionLostListener; @@ -34,4 +36,4 @@ public void partitionLost(CachePartitionLostEvent event) { }); } } -//end::pllu[] \ No newline at end of file +//end::pllu[] diff --git a/docs/modules/ROOT/examples/jcache/User.java b/docs/modules/ROOT/examples/jcache/User.java index 129a70ba8..37d3f3a0b 100644 --- a/docs/modules/ROOT/examples/jcache/User.java +++ b/docs/modules/ROOT/examples/jcache/User.java @@ -1,3 +1,5 @@ +package jcache; + import java.io.Serializable; @SuppressWarnings("unused") @@ -66,4 +68,4 @@ public String toString() { + ", username='" + username + '\'' + '}'; } -} \ No newline at end of file +} diff --git a/docs/modules/ROOT/examples/jcache/UserCacheEntryListener.java b/docs/modules/ROOT/examples/jcache/UserCacheEntryListener.java index 3a1747294..183f02867 100644 --- a/docs/modules/ROOT/examples/jcache/UserCacheEntryListener.java +++ b/docs/modules/ROOT/examples/jcache/UserCacheEntryListener.java @@ -1,3 +1,5 @@ +package jcache; + import javax.cache.event.CacheEntryCreatedListener; import javax.cache.event.CacheEntryEvent; import javax.cache.event.CacheEntryExpiredListener; @@ -45,4 +47,4 @@ private void printEvents(Iterable create() { return new UserCacheEntryListener(); } } -//end::ucelf[] \ No newline at end of file +//end::ucelf[] diff --git a/docs/modules/ROOT/examples/jcache/UserCacheLoader.java b/docs/modules/ROOT/examples/jcache/UserCacheLoader.java index 701022414..e08124845 100644 --- a/docs/modules/ROOT/examples/jcache/UserCacheLoader.java +++ b/docs/modules/ROOT/examples/jcache/UserCacheLoader.java @@ -1,3 +1,5 @@ +package jcache; + import javax.cache.integration.CacheLoader; import javax.cache.integration.CacheLoaderException; import java.io.Serializable; @@ -36,4 +38,4 @@ public Map loadAll(Iterable keys) throws Cache return loaded; } } -//end::ucl[] \ No newline at end of file +//end::ucl[] diff --git a/docs/modules/ROOT/examples/jcache/UserCacheWriter.java b/docs/modules/ROOT/examples/jcache/UserCacheWriter.java index 08d895c1d..9537a4695 100644 --- a/docs/modules/ROOT/examples/jcache/UserCacheWriter.java +++ b/docs/modules/ROOT/examples/jcache/UserCacheWriter.java @@ -1,3 +1,5 @@ +package jcache; + import javax.cache.Cache; import javax.cache.integration.CacheWriter; import javax.cache.integration.CacheWriterException; @@ -55,4 +57,4 @@ public void deleteAll(Collection keys) throws CacheWriterException { } } } -//end::ucw[] \ No newline at end of file +//end::ucw[] diff --git a/docs/modules/ROOT/examples/jcache/UserDao.java b/docs/modules/ROOT/examples/jcache/UserDao.java index f71840d34..2176a083c 100644 --- a/docs/modules/ROOT/examples/jcache/UserDao.java +++ b/docs/modules/ROOT/examples/jcache/UserDao.java @@ -1,3 +1,5 @@ +package jcache; + import java.util.Collection; //tag::userdao[] @@ -8,4 +10,4 @@ public interface UserDao { boolean removeUser(int userId); Collection allUserIds(); } -//end::userdao[] \ No newline at end of file +//end::userdao[] diff --git a/docs/modules/ROOT/examples/jcache/UserUpdateEntryProcessor.java b/docs/modules/ROOT/examples/jcache/UserUpdateEntryProcessor.java index 3703f5850..ec2ed4460 100644 --- a/docs/modules/ROOT/examples/jcache/UserUpdateEntryProcessor.java +++ b/docs/modules/ROOT/examples/jcache/UserUpdateEntryProcessor.java @@ -1,3 +1,5 @@ +package jcache; + import javax.cache.processor.EntryProcessor; import javax.cache.processor.EntryProcessorException; import javax.cache.processor.MutableEntry; @@ -34,4 +36,4 @@ public User process(MutableEntry entry, Object... arguments) thro return user; } } -//end::uuep[] \ No newline at end of file +//end::uuep[] diff --git a/docs/modules/ROOT/examples/security/CredentialsCallback.java b/docs/modules/ROOT/examples/security/CredentialsCallback.java index 212731119..29f807a95 100644 --- a/docs/modules/ROOT/examples/security/CredentialsCallback.java +++ b/docs/modules/ROOT/examples/security/CredentialsCallback.java @@ -1,3 +1,5 @@ +package security; + import com.hazelcast.security.Credentials; import javax.security.auth.callback.Callback; diff --git a/docs/modules/ROOT/examples/security/CustomLoginModule.java b/docs/modules/ROOT/examples/security/CustomLoginModule.java index 0f7b765ed..bccac56ca 100644 --- a/docs/modules/ROOT/examples/security/CustomLoginModule.java +++ b/docs/modules/ROOT/examples/security/CustomLoginModule.java @@ -1,3 +1,5 @@ +package security; + import com.hazelcast.security.Credentials; import javax.security.auth.Subject; diff --git a/docs/modules/ROOT/examples/CustomLoginModuleTest.java b/docs/modules/ROOT/examples/security/CustomLoginModuleTest.java similarity index 100% rename from docs/modules/ROOT/examples/CustomLoginModuleTest.java rename to docs/modules/ROOT/examples/security/CustomLoginModuleTest.java diff --git a/docs/modules/ROOT/examples/security/EnablingSecurity.java b/docs/modules/ROOT/examples/security/EnablingSecurity.java index ea640efaf..71f4f3717 100644 --- a/docs/modules/ROOT/examples/security/EnablingSecurity.java +++ b/docs/modules/ROOT/examples/security/EnablingSecurity.java @@ -1,13 +1,56 @@ +package security; + import com.hazelcast.config.Config; +import com.hazelcast.config.PermissionConfig; +import com.hazelcast.config.PermissionConfig.PermissionType; import com.hazelcast.config.SecurityConfig; +import com.hazelcast.config.security.LdapAuthenticationConfig; +import com.hazelcast.config.security.RealmConfig; +import com.hazelcast.config.security.SimpleAuthenticationConfig; public class EnablingSecurity { public static void main(String[] args) throws Exception{ - //tag::es[] - Config cfg = new Config(); - SecurityConfig securityCfg = cfg.getSecurityConfig(); - securityCfg.setEnabled( true ); - //end::es[] +//tag::es[] +Config cfg = new Config(); +SecurityConfig securityCfg = cfg.getSecurityConfig(); +securityCfg.setEnabled( true ); +//end::es[] + } + + public static void authenticationSample() throws Exception{ +//tag::authn[] +Config cfg = new Config(); +SimpleAuthenticationConfig sac = new SimpleAuthenticationConfig() + .addUser("test", "V3ryS3cr3tString", "monitor", "hazelcast") + .addUser("man-center", "HardToGuess", "root"); +cfg.getSecurityConfig().setEnabled(true) + .setClientRealmConfig("simpleRealm", + new RealmConfig().setSimpleAuthenticationConfig(sac)); +//end::authn[] + } + + public static void identitySample() throws Exception{ +//tag::identity[] +Config cfg = new Config(); +cfg.getSecurityConfig() + .setEnabled(true) + .addRealmConfig("aRealm", + new RealmConfig().setLdapAuthenticationConfig(new LdapAuthenticationConfig()/* ... */) + .setUsernamePasswordIdentityConfig("uid=hazelcast,ou=Services,dc=hazelcast,dc=com", "theSecret")) + .setClientRealm("aRealm") + .setMemberRealm("aRealm"); +//end::identity[] + } + + public static void authorizationSample() throws Exception{ +//tag::authz[] +Config cfg = new Config(); +cfg.getSecurityConfig() + .setEnabled(true) + .setClientRealmConfig("aRealm", new RealmConfig()/* ... */) + .addClientPermissionConfig(new PermissionConfig(PermissionType.ALL, null, "man-center")) + .addClientPermissionConfig(new PermissionConfig(PermissionType.MAP, "playground", "*").addAction("all")); +//end::authz[] } -} \ No newline at end of file +} diff --git a/docs/modules/ROOT/examples/security/MapSecurityInterceptor.java b/docs/modules/ROOT/examples/security/MapSecurityInterceptor.java index 11da5089f..411446967 100644 --- a/docs/modules/ROOT/examples/security/MapSecurityInterceptor.java +++ b/docs/modules/ROOT/examples/security/MapSecurityInterceptor.java @@ -1,3 +1,5 @@ +package security; + import com.hazelcast.client.HazelcastClient; import com.hazelcast.client.config.ClientConfig; import com.hazelcast.config.Config; diff --git a/docs/modules/ROOT/examples/security/SocketInterceptorClient.java b/docs/modules/ROOT/examples/security/SocketInterceptorClient.java index 7e11da16b..2bfb7c0dd 100644 --- a/docs/modules/ROOT/examples/security/SocketInterceptorClient.java +++ b/docs/modules/ROOT/examples/security/SocketInterceptorClient.java @@ -1,3 +1,5 @@ +package security; + import com.hazelcast.client.HazelcastClient; import com.hazelcast.client.config.ClientConfig; import com.hazelcast.config.Config; diff --git a/docs/modules/ROOT/examples/security/SocketInterceptorMember.java b/docs/modules/ROOT/examples/security/SocketInterceptorMember.java index b9df9c4ef..8c6493ed6 100644 --- a/docs/modules/ROOT/examples/security/SocketInterceptorMember.java +++ b/docs/modules/ROOT/examples/security/SocketInterceptorMember.java @@ -1,3 +1,5 @@ +package security; + import com.hazelcast.config.Config; import com.hazelcast.config.SocketInterceptorConfig; import com.hazelcast.core.Hazelcast; diff --git a/docs/modules/ROOT/examples/storage/SampleEncryptionAtRestConfiguration.java b/docs/modules/ROOT/examples/storage/SampleEncryptionAtRestConfiguration.java index 5d08680d5..9d3923fa8 100644 --- a/docs/modules/ROOT/examples/storage/SampleEncryptionAtRestConfiguration.java +++ b/docs/modules/ROOT/examples/storage/SampleEncryptionAtRestConfiguration.java @@ -4,7 +4,6 @@ import com.hazelcast.config.PersistenceConfig; import com.hazelcast.config.JavaKeyStoreSecureStoreConfig; import com.hazelcast.config.SSLConfig; -import com.hazelcast.config.SecureStoreConfig; import com.hazelcast.config.VaultSecureStoreConfig; import java.io.File; @@ -12,14 +11,6 @@ public class SampleEncryptionAtRestConfiguration { public static void main(String[] args) throws Exception{ - //tag::encryptionatrest[] - PersistenceConfig PersistenceConfig = new PersistenceConfig(); - EncryptionAtRestConfig encryptionAtRestConfig = - PersistenceConfig.getEncryptionAtRestConfig(); - encryptionAtRestConfig.setEnabled(true) - .setAlgorithm("AES/CBC/PKCS5Padding") - .setSecureStoreConfig(/* pass in a configuration object for a secure store here */); - //end::encryptionatrest[] //tag::keystore[] JavaKeyStoreSecureStoreConfig keyStoreConfig = new JavaKeyStoreSecureStoreConfig(new File("/path/to/keystore.file")) @@ -28,6 +19,14 @@ public static void main(String[] args) throws Exception{ .setCurrentKeyAlias("current") .setPollingInterval(60); //end::keystore[] + //tag::encryptionatrest[] + PersistenceConfig PersistenceConfig = new PersistenceConfig(); + EncryptionAtRestConfig encryptionAtRestConfig = + PersistenceConfig.getEncryptionAtRestConfig(); + encryptionAtRestConfig.setEnabled(true) + .setAlgorithm("AES/CBC/PKCS5Padding") + .setSecureStoreConfig(/* pass in a configuration object for a secure store here */keyStoreConfig); + //end::encryptionatrest[] //tag::vault[] VaultSecureStoreConfig vaultConfig = new VaultSecureStoreConfig("http://localhost:1234", "secret/path", "token") @@ -38,4 +37,4 @@ public static void main(String[] args) throws Exception{ private static void configureSSL(SSLConfig sslConfig) { } -} \ No newline at end of file +} diff --git a/docs/modules/ROOT/examples/storage/SampleHotRestartConfiguration.java b/docs/modules/ROOT/examples/storage/SamplePersistenceConfiguration.java similarity index 86% rename from docs/modules/ROOT/examples/storage/SampleHotRestartConfiguration.java rename to docs/modules/ROOT/examples/storage/SamplePersistenceConfiguration.java index 21d8eee1f..115483223 100644 --- a/docs/modules/ROOT/examples/storage/SampleHotRestartConfiguration.java +++ b/docs/modules/ROOT/examples/storage/SamplePersistenceConfiguration.java @@ -7,16 +7,16 @@ public class SamplePersistenceConfiguration { public static void main(String[] args) throws Exception{ //tag::hrconf[] Config config = new Config(); - PersistenceConfig PersistenceConfig = new PersistenceConfig() + PersistenceConfig persistenceConfig = new PersistenceConfig() .setEnabled(true) .setBaseDir(new File("/mnt/persistence")) .setParallelism(1) .setValidationTimeoutSeconds(120) .setDataLoadTimeoutSeconds(900) .setClusterDataRecoveryPolicy(PersistenceClusterDataRecoveryPolicy.FULL_RECOVERY_ONLY) - .setAutoRemoveStaleData(true); - .setRebalanceDelaySeconds(0) - config.setPersistenceConfig(PersistenceConfig); + .setAutoRemoveStaleData(true) + .setRebalanceDelaySeconds(0); + config.setPersistenceConfig(persistenceConfig); MapConfig mapConfig = config.getMapConfig("test-map"); mapConfig.getDataPersistenceConfig().setEnabled(true); @@ -35,4 +35,4 @@ public static void main(String[] args) throws Exception{ config.getJetConfig().setLosslessRestartEnabled(true); //end::hrconf[] } -} \ No newline at end of file +} diff --git a/docs/modules/ROOT/examples/wan/EnablingWRforCache.java b/docs/modules/ROOT/examples/wan/EnablingWRforCache.java index ab8d6d3bc..7b441c897 100644 --- a/docs/modules/ROOT/examples/wan/EnablingWRforCache.java +++ b/docs/modules/ROOT/examples/wan/EnablingWRforCache.java @@ -1,6 +1,7 @@ import com.hazelcast.config.Config; import com.hazelcast.config.WanReplicationConfig; import com.hazelcast.config.WanReplicationRef; +import com.hazelcast.spi.merge.PassThroughMergePolicy; public class EnablingWRforCache { diff --git a/docs/modules/security/pages/jaas-authentication.adoc b/docs/modules/security/pages/jaas-authentication.adoc index e4da0edf4..e243208fa 100644 --- a/docs/modules/security/pages/jaas-authentication.adoc +++ b/docs/modules/security/pages/jaas-authentication.adoc @@ -43,7 +43,7 @@ The callbacks are usually used in the `login()` method of a login module: [source,java] ---- -include::ROOT:example$/CustomLoginModuleTest.java[tag=callback-sample] +include::ROOT:example$/security/CustomLoginModuleTest.java[tag=callback-sample] ---- == ClusterLoginModule @@ -129,4 +129,4 @@ return the roles that are attributed to the user. These roles can then be used for data structure authorization. NOTE: See the http://docs.oracle.com/javase/8/docs/technotes/guides/security/jaas/JAASRefGuide.html[JAAS Reference Guide^] -for further information. \ No newline at end of file +for further information. diff --git a/docs/modules/security/pages/security-realms.adoc b/docs/modules/security/pages/security-realms.adoc index 65d67fd86..e5bf3b6b2 100644 --- a/docs/modules/security/pages/security-realms.adoc +++ b/docs/modules/security/pages/security-realms.adoc @@ -910,7 +910,7 @@ Here is an example: [source,java] ---- -include::ROOT:example$/CustomLoginModuleTest.java[tag=credentials-callback] +include::ROOT:example$/security/CustomLoginModuleTest.java[tag=credentials-callback] ---- === Password Credentials diff --git a/docs/modules/storage/pages/configuring-persistence.adoc b/docs/modules/storage/pages/configuring-persistence.adoc index 695bf7ade..1920e190f 100644 --- a/docs/modules/storage/pages/configuring-persistence.adoc +++ b/docs/modules/storage/pages/configuring-persistence.adoc @@ -1469,7 +1469,7 @@ Java:: -- [source,java] ---- -include::ROOT:example$/storage/SampleHotRestartConfiguration.java[tag=hrconf] +include::ROOT:example$/storage/SamplePersistenceConfiguration.java[tag=hrconf] ---- -- ==== diff --git a/pom.xml b/pom.xml new file mode 100644 index 000000000..f0b4203f0 --- /dev/null +++ b/pom.xml @@ -0,0 +1,83 @@ + + 4.0.0 + + hzdocs + hzdocs + 0.1-SNAPSHOT + jar + + ${project.artifactId} + + + UTF-8 + 17 + + 5.5.0 + + + + docs/modules/ROOT/examples + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + + + + + + + com.hazelcast + hazelcast-enterprise + ${version.hazelcast} + + + junit + junit + 4.13.2 + + + javax.cache + cache-api + 1.1.1 + + + javax.transaction + jta + 1.1 + + + com.atomikos + transactions-jta + 3.7.0 + + + org.mongodb + mongo-java-driver + 3.12.14 + + + + + + snapshot-repository + https://repository.hazelcast.com/snapshot/ + + false + + + + release-repository + https://repository.hazelcast.com/release/ + + false + + + +