diff --git a/geode/events/pom.xml b/geode/events/pom.xml index 51c10ee5..b8cd2397 100755 --- a/geode/events/pom.xml +++ b/geode/events/pom.xml @@ -10,6 +10,7 @@ 2.0.0.BUILD-SNAPSHOT - events + spring-data-geode-events-example + Spring Data Geode - Events diff --git a/geode/events/src/main/java/example/springdata/geode/server/events/CustomerCacheWriter.java b/geode/events/src/main/java/example/springdata/geode/server/events/CustomerCacheWriter.java index 2cd32c9c..42401f41 100755 --- a/geode/events/src/main/java/example/springdata/geode/server/events/CustomerCacheWriter.java +++ b/geode/events/src/main/java/example/springdata/geode/server/events/CustomerCacheWriter.java @@ -29,7 +29,7 @@ public class CustomerCacheWriter extends CacheWriterAdapter { @Override public void beforeCreate(EntryEvent event) throws CacheWriterException { - EntryEventImpl e = (EntryEventImpl) event; + var e = (EntryEventImpl) event; super.beforeCreate(e); } } diff --git a/geode/events/src/main/java/example/springdata/geode/server/events/EventServer.java b/geode/events/src/main/java/example/springdata/geode/server/events/EventServer.java index a0d76c82..3029540e 100755 --- a/geode/events/src/main/java/example/springdata/geode/server/events/EventServer.java +++ b/geode/events/src/main/java/example/springdata/geode/server/events/EventServer.java @@ -23,8 +23,6 @@ import java.util.stream.LongStream; import lombok.extern.apachecommons.CommonsLog; import org.apache.geode.cache.Region; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.ApplicationRunner; @@ -57,18 +55,18 @@ public class EventServer { log.info("Completed creating orders "); - List allForProductID = orderProductSummaryRepository.findAllForProductID(3L); + var allForProductID = orderProductSummaryRepository.findAllForProductID(3L); allForProductID.forEach(orderProductSummary -> log.info("orderProductSummary = " + orderProductSummary)); }; } private void createOrders(ProductRepository productRepository, OrderRepository orderRepository) { - Random random = new Random(System.nanoTime()); - Address address = new Address("it", "doesn't", "matter"); + var random = new Random(System.nanoTime()); + var address = new Address("it", "doesn't", "matter"); LongStream.rangeClosed(1, 10).forEach((orderId) -> LongStream.rangeClosed(1, 300).forEach((customerId) -> { - Order order = new Order(orderId, customerId, address); + var order = new Order(orderId, customerId, address); IntStream.rangeClosed(0, random.nextInt(3) + 1).forEach((lineItemCount) -> { - int quantity = random.nextInt(3) + 1; + var quantity = random.nextInt(3) + 1; long productId = random.nextInt(3) + 1; order.add(new LineItem(productRepository.findById(productId).get(), quantity)); }); @@ -79,7 +77,7 @@ public class EventServer { private void createProducts(ProductRepository productRepository) { productRepository.save(new Product(1L, "Apple iPod", new BigDecimal("99.99"), "An Apple portable music player")); productRepository.save(new Product(2L, "Apple iPad", new BigDecimal("499.99"), "An Apple tablet device")); - Product macbook = new Product(3L, "Apple macBook", new BigDecimal("899.99"), "An Apple notebook computer"); + var macbook = new Product(3L, "Apple macBook", new BigDecimal("899.99"), "An Apple notebook computer"); macbook.addAttribute("warranty", "included"); productRepository.save(macbook); } diff --git a/geode/events/src/main/java/example/springdata/geode/server/events/EventServerConfig.java b/geode/events/src/main/java/example/springdata/geode/server/events/EventServerConfig.java index 70678a1f..5d936c5b 100755 --- a/geode/events/src/main/java/example/springdata/geode/server/events/EventServerConfig.java +++ b/geode/events/src/main/java/example/springdata/geode/server/events/EventServerConfig.java @@ -47,7 +47,7 @@ public class EventServerConfig { @Bean AsyncEventQueueFactoryBean orderAsyncEventQueue(GemFireCache gemFireCache, AsyncEventListener orderAsyncEventListener) { - AsyncEventQueueFactoryBean asyncEventQueueFactoryBean = new AsyncEventQueueFactoryBean((Cache) gemFireCache); + var asyncEventQueueFactoryBean = new AsyncEventQueueFactoryBean((Cache) gemFireCache); asyncEventQueueFactoryBean.setBatchTimeInterval(1000); asyncEventQueueFactoryBean.setBatchSize(5); asyncEventQueueFactoryBean.setAsyncEventListener(orderAsyncEventListener); diff --git a/geode/events/src/main/java/example/springdata/geode/server/events/LoggingCacheListener.java b/geode/events/src/main/java/example/springdata/geode/server/events/LoggingCacheListener.java index be8b3e5a..1d23e296 100644 --- a/geode/events/src/main/java/example/springdata/geode/server/events/LoggingCacheListener.java +++ b/geode/events/src/main/java/example/springdata/geode/server/events/LoggingCacheListener.java @@ -16,8 +16,6 @@ package example.springdata.geode.server.events; import lombok.extern.apachecommons.CommonsLog; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.geode.cache.EntryEvent; import org.apache.geode.cache.util.CacheListenerAdapter; import org.springframework.stereotype.Component; diff --git a/geode/events/src/main/java/example/springdata/geode/server/events/OrderAsyncQueueListener.java b/geode/events/src/main/java/example/springdata/geode/server/events/OrderAsyncQueueListener.java index bd9b68e4..1f0e7212 100755 --- a/geode/events/src/main/java/example/springdata/geode/server/events/OrderAsyncQueueListener.java +++ b/geode/events/src/main/java/example/springdata/geode/server/events/OrderAsyncQueueListener.java @@ -39,10 +39,10 @@ public class OrderAsyncQueueListener implements AsyncEventListener { public boolean processEvents(List list) { Map summaryMap = new HashMap<>(); list.forEach(asyncEvent -> { - Order order = (Order) asyncEvent.getDeserializedValue(); + var order = (Order) asyncEvent.getDeserializedValue(); if (order != null) { order.getLineItems().forEach(lineItem -> { - OrderProductSummary orderProductSummary = summaryMap.get(lineItem.getProductId()); + var orderProductSummary = summaryMap.get(lineItem.getProductId()); if (orderProductSummary == null) { orderProductSummary = new OrderProductSummary(lineItem.getProductId(), new BigDecimal("0.00")); } diff --git a/geode/events/src/test/java/example/springdata/geode/server/events/EventServerTests.java b/geode/events/src/test/java/example/springdata/geode/server/events/EventServerTests.java index 609e65e1..82190d09 100755 --- a/geode/events/src/test/java/example/springdata/geode/server/events/EventServerTests.java +++ b/geode/events/src/test/java/example/springdata/geode/server/events/EventServerTests.java @@ -46,7 +46,7 @@ public class EventServerTests { @Test public void productCacheLoaderWorks() { - long size = productRepository.count(); + var size = productRepository.count(); assertThat(this.productRepository.findById(777L)).isNotNull(); assertThat(productRepository.count()).isEqualTo(size + 1); diff --git a/geode/expiration-eviction/pom.xml b/geode/expiration-eviction/pom.xml index 7d15c469..2df41222 100755 --- a/geode/expiration-eviction/pom.xml +++ b/geode/expiration-eviction/pom.xml @@ -10,7 +10,8 @@ 2.0.0.BUILD-SNAPSHOT - expiration-eviction + spring-data-geode-expiration-eviction-example + Spring Data Geode - Expiration diff --git a/geode/expiration-eviction/src/test/java/example/springdata/geode/server/expiration/eviction/ExpirationEvictionServerTests.java b/geode/expiration-eviction/src/test/java/example/springdata/geode/server/expiration/eviction/ExpirationEvictionServerTests.java index 20cf4750..2b7194b1 100755 --- a/geode/expiration-eviction/src/test/java/example/springdata/geode/server/expiration/eviction/ExpirationEvictionServerTests.java +++ b/geode/expiration-eviction/src/test/java/example/springdata/geode/server/expiration/eviction/ExpirationEvictionServerTests.java @@ -123,7 +123,7 @@ public class ExpirationEvictionServerTests { @Test public void evictionIsConfiguredCorrectly() { - final int evictionThreshold = 10; + final var evictionThreshold = 10; for (long i = 0; i < evictionThreshold + 1; i++) { orderRepository.save(new Order(i, i, new Address(faker.address().streetName(), faker.address().city(), faker.address().country()))); diff --git a/geode/function-invocation/pom.xml b/geode/function-invocation/pom.xml index 7f4dc59d..57971708 100755 --- a/geode/function-invocation/pom.xml +++ b/geode/function-invocation/pom.xml @@ -10,6 +10,7 @@ 2.0.0.BUILD-SNAPSHOT - function-invocation + spring-data-geode-function-invocation-example + Spring Data Geode - Functions diff --git a/geode/function-invocation/src/main/java/example/springdata/geode/client/function/server/CustomerFunctions.java b/geode/function-invocation/src/main/java/example/springdata/geode/client/function/server/CustomerFunctions.java index 68a0f51d..6a017fe5 100755 --- a/geode/function-invocation/src/main/java/example/springdata/geode/client/function/server/CustomerFunctions.java +++ b/geode/function-invocation/src/main/java/example/springdata/geode/client/function/server/CustomerFunctions.java @@ -36,8 +36,8 @@ public class CustomerFunctions { hasResult = true) public List listAllCustomersForEmailAddress(@RegionData Map customerData, String... emailAddresses) { - List emailAddressesAsList = Arrays.asList(emailAddresses); - List collect = customerData.values().parallelStream() + var emailAddressesAsList = Arrays.asList(emailAddresses); + var collect = customerData.values().parallelStream() .filter((customer) -> emailAddressesAsList.contains(customer.getEmailAddress().getValue())) .collect(Collectors.toList()); return collect; diff --git a/geode/function-invocation/src/test/java/example/springdata/geode/client/function/client/FunctionInvocationClientTests.java b/geode/function-invocation/src/test/java/example/springdata/geode/client/function/client/FunctionInvocationClientTests.java index dde3577e..93a7df96 100755 --- a/geode/function-invocation/src/test/java/example/springdata/geode/client/function/client/FunctionInvocationClientTests.java +++ b/geode/function-invocation/src/test/java/example/springdata/geode/client/function/client/FunctionInvocationClientTests.java @@ -80,12 +80,12 @@ public class FunctionInvocationClientTests extends ForkingClientServerIntegratio public void functionsExecuteCorrectly() { createCustomerData(); - List cust = customerFunctionExecutions.listAllCustomersForEmailAddress("2@2.com", "3@3.com").get(0); + var cust = customerFunctionExecutions.listAllCustomersForEmailAddress("2@2.com", "3@3.com").get(0); assertThat(cust.size()).isEqualTo(2); log.info("All customers for emailAddresses:3@3.com,2@2.com using function invocation: \n\t " + cust); createProducts(); - BigDecimal sum = productFunctionExecutions.sumPricesForAllProducts().get(0); + var sum = productFunctionExecutions.sumPricesForAllProducts().get(0); assertThat(sum).isEqualTo(BigDecimal.valueOf(1499.97)); log.info("Running function to sum up all product prices: \n\t" + sum); @@ -94,7 +94,7 @@ public class FunctionInvocationClientTests extends ForkingClientServerIntegratio sum = orderFunctionExecutions.sumPricesForAllProductsForOrder(1L).get(0); assertThat(sum).isGreaterThanOrEqualTo(BigDecimal.valueOf(99.99)); log.info("Running function to sum up all order lineItems prices for order 1: \n\t" + sum); - Order order = orderRepository.findById(1L).get(); + var order = orderRepository.findById(1L).get(); log.info("For order: \n\t " + order); } @@ -113,7 +113,7 @@ public class FunctionInvocationClientTests extends ForkingClientServerIntegratio productRepository.save(new Product(1L, "Apple iPod", new BigDecimal("99.99"), "An Apple portable music player")); productRepository.save(new Product(2L, "Apple iPad", new BigDecimal("499.99"), "An Apple tablet device")); - Product macbook = new Product(3L, "Apple macBook", new BigDecimal("899.99"), "An Apple notebook computer"); + var macbook = new Product(3L, "Apple macBook", new BigDecimal("899.99"), "An Apple notebook computer"); macbook.addAttribute("warranty", "included"); productRepository.save(macbook); @@ -123,13 +123,13 @@ public class FunctionInvocationClientTests extends ForkingClientServerIntegratio public void createOrders() { - Random random = new Random(); - Address address = new Address("it", "doesn't", "matter"); + var random = new Random(); + var address = new Address("it", "doesn't", "matter"); LongStream.rangeClosed(1, 100).forEach((orderId) -> LongStream.rangeClosed(1, 3).forEach((customerId) -> { - Order order = new Order(orderId, customerId, address); + var order = new Order(orderId, customerId, address); IntStream.rangeClosed(0, random.nextInt(3) + 1).forEach((lineItemCount) -> { - int quantity = random.nextInt(3) + 1; + var quantity = random.nextInt(3) + 1; long productId = random.nextInt(3) + 1; order.add(new LineItem(productRepository.findById(productId).get(), quantity)); }); diff --git a/geode/queries/pom.xml b/geode/queries/pom.xml index 753a969d..6e1e9e23 100755 --- a/geode/queries/pom.xml +++ b/geode/queries/pom.xml @@ -10,7 +10,8 @@ 2.0.0.BUILD-SNAPSHOT - queries + spring-data-geode-queries-example + Spring Data Geode - Queries diff --git a/geode/queries/src/test/java/example/springdata/geode/client/queries/QueryTests.java b/geode/queries/src/test/java/example/springdata/geode/client/queries/QueryTests.java index ad1d4b85..fe94d551 100755 --- a/geode/queries/src/test/java/example/springdata/geode/client/queries/QueryTests.java +++ b/geode/queries/src/test/java/example/springdata/geode/client/queries/QueryTests.java @@ -92,15 +92,15 @@ public class QueryTests extends ForkingClientServerIntegrationTestsSupport { public void oqlQueriesConfiguredCorrectly() { log.info("Inserting 3 entries for keys: 1, 2, 3"); - Customer john = new Customer(1L, new EmailAddress("2@2.com"), "John", "Smith"); - Customer frank = new Customer(2L, new EmailAddress("3@3.com"), "Frank", "Lamport"); - Customer jude = new Customer(3L, new EmailAddress("5@5.com"), "Jude", "Simmons"); + var john = new Customer(1L, new EmailAddress("2@2.com"), "John", "Smith"); + var frank = new Customer(2L, new EmailAddress("3@3.com"), "Frank", "Lamport"); + var jude = new Customer(3L, new EmailAddress("5@5.com"), "Jude", "Simmons"); customerRepository.save(john); customerRepository.save(frank); customerRepository.save(jude); assertThat(customers.keySetOnServer().size()).isEqualTo(3); - Customer customer = customerRepository.findById(2L).get(); + var customer = customerRepository.findById(2L).get(); assertThat(customer).isEqualTo(frank); log.info("Find customer with key=2 using GemFireRepository: " + customer); List customerList = customerTemplate.find("select * from /Customers where id=$1", 2L).asList(); diff --git a/geode/security/pom.xml b/geode/security/pom.xml index f2f7b51b..3e761b2b 100755 --- a/geode/security/pom.xml +++ b/geode/security/pom.xml @@ -10,7 +10,8 @@ 2.0.0.BUILD-SNAPSHOT - security + spring-data-geode-security-example + Spring Data Geode - Security diff --git a/geode/security/src/main/java/example/springdata/geode/client/security/User.java b/geode/security/src/main/java/example/springdata/geode/client/security/User.java index 202e626b..449301f5 100755 --- a/geode/security/src/main/java/example/springdata/geode/client/security/User.java +++ b/geode/security/src/main/java/example/springdata/geode/client/security/User.java @@ -84,7 +84,7 @@ public class User implements Comparable, Cloneable, Principal, Serializabl * @see ResourcePermission */ public boolean hasPermission(ResourcePermission permission) { - for (Role role : roles) { + for (var role : roles) { if (role.hasPermission(permission)) { return true; } diff --git a/geode/security/src/main/java/example/springdata/geode/client/security/server/CachingSecurityRepository.java b/geode/security/src/main/java/example/springdata/geode/client/security/server/CachingSecurityRepository.java index d469c6d5..70db0df2 100755 --- a/geode/security/src/main/java/example/springdata/geode/client/security/server/CachingSecurityRepository.java +++ b/geode/security/src/main/java/example/springdata/geode/client/security/server/CachingSecurityRepository.java @@ -48,7 +48,7 @@ public abstract class CachingSecurityRepository implements SecurityRepository { @Override public User save(User user) { - User putUser = users.put(user.getName(), user); + var putUser = users.put(user.getName(), user); return putUser != null ? putUser : user; } } diff --git a/geode/security/src/main/java/example/springdata/geode/client/security/server/JdbcSecurityRepository.java b/geode/security/src/main/java/example/springdata/geode/client/security/server/JdbcSecurityRepository.java index 075ff2f0..83a397c6 100644 --- a/geode/security/src/main/java/example/springdata/geode/client/security/server/JdbcSecurityRepository.java +++ b/geode/security/src/main/java/example/springdata/geode/client/security/server/JdbcSecurityRepository.java @@ -54,8 +54,8 @@ public class JdbcSecurityRepository extends CachingSecurityRepository implements public void afterPropertiesSet() { - List roles = this.jdbcTemplate.query(ROLES_QUERY, (resultSet, i) -> Role.newRole(resultSet.getString(1))); - HashMap roleMapping = new HashMap<>(roles.size()); + var roles = this.jdbcTemplate.query(ROLES_QUERY, (resultSet, i) -> Role.newRole(resultSet.getString(1))); + var roleMapping = new HashMap(roles.size()); roles.forEach((role) -> { this.jdbcTemplate.query(ROLE_PERMISSIONS_QUERY, Collections.singleton(role.getName()).toArray(), @@ -65,7 +65,7 @@ public class JdbcSecurityRepository extends CachingSecurityRepository implements roleMapping.put(role.getName(), role); }); - List users = this.jdbcTemplate.query(USERS_QUERY, + var users = this.jdbcTemplate.query(USERS_QUERY, (resultSet, i) -> createUser(resultSet.getString(1)).withCredentials(resultSet.getString(2))); users.forEach((role) -> { diff --git a/geode/security/src/main/java/example/springdata/geode/client/security/server/SecurityRepository.java b/geode/security/src/main/java/example/springdata/geode/client/security/server/SecurityRepository.java index 86595606..086fe7e7 100755 --- a/geode/security/src/main/java/example/springdata/geode/client/security/server/SecurityRepository.java +++ b/geode/security/src/main/java/example/springdata/geode/client/security/server/SecurityRepository.java @@ -64,9 +64,9 @@ public interface SecurityRepository { /* (non-Javadoc) */ default int count() { - int count = 0; - Iterable users = findAll(); - for (User user : users) { + var count = 0; + var users = findAll(); + for (var user : users) { count++; } return count; @@ -79,7 +79,7 @@ public interface SecurityRepository { /* (non-Javadoc) */ default boolean delete(String username) { - User user = findBy(username); + var user = findBy(username); if (user != null) { return delete(user); } @@ -98,7 +98,7 @@ public interface SecurityRepository { /* (non-Javadoc) */ default boolean deleteAll(Iterable users) { - for (User user : users) { + for (var user : users) { if (!delete(user)) { return false; } @@ -134,7 +134,7 @@ public interface SecurityRepository { /* (non-Javadoc) */ default User findBy(String username) { - for (User user : findAll()) { + for (var user : findAll()) { if (user.getName().equals(username)) { return user; } diff --git a/geode/security/src/main/java/example/springdata/geode/client/security/server/SimpleSecurityManager.java b/geode/security/src/main/java/example/springdata/geode/client/security/server/SimpleSecurityManager.java index 29ac8e1c..4f572788 100644 --- a/geode/security/src/main/java/example/springdata/geode/client/security/server/SimpleSecurityManager.java +++ b/geode/security/src/main/java/example/springdata/geode/client/security/server/SimpleSecurityManager.java @@ -53,12 +53,12 @@ public class SimpleSecurityManager extends SecurityManagerSupport { */ @Override public Object authenticate(Properties securityProperties) { - String username = getUsername(securityProperties); - String password = getPassword(securityProperties); + var username = getUsername(securityProperties); + var password = getPassword(securityProperties); logDebug("User with name [{}] is attempting to login with password [{}]", username, password); - User user = securityRepository.findBy(username); + var user = securityRepository.findBy(username); if (isNotAuthentic(user, password)) { throw new AuthenticationFailedException(String.format("Failed to authenticate user [%s]", username)); @@ -90,7 +90,7 @@ public class SimpleSecurityManager extends SecurityManagerSupport { /* (non-Javadoc) */ protected boolean isAuthorized(Object principal, ResourcePermission permission) { - User user = resolveUser(principal); + var user = resolveUser(principal); return user != null && isAuthorized(user, permission); } diff --git a/geode/security/src/test/java/example/springdata/geode/client/security/client/SecurityEnabledClientShiroTests.java b/geode/security/src/test/java/example/springdata/geode/client/security/client/SecurityEnabledClientShiroTests.java index 9323e3d2..b5faf5b2 100755 --- a/geode/security/src/test/java/example/springdata/geode/client/security/client/SecurityEnabledClientShiroTests.java +++ b/geode/security/src/test/java/example/springdata/geode/client/security/client/SecurityEnabledClientShiroTests.java @@ -61,9 +61,9 @@ public class SecurityEnabledClientShiroTests extends ForkingClientServerIntegrat log.info("Inserting 3 entries for keys: 1, 2, 3"); - Customer john = new Customer(1L, new EmailAddress("2@2.com"), "John", "Smith"); - Customer frank = new Customer(2L, new EmailAddress("3@3.com"), "Frank", "Lamport"); - Customer jude = new Customer(3L, new EmailAddress("5@5.com"), "Jude", "Simmons"); + var john = new Customer(1L, new EmailAddress("2@2.com"), "John", "Smith"); + var frank = new Customer(2L, new EmailAddress("3@3.com"), "Frank", "Lamport"); + var jude = new Customer(3L, new EmailAddress("5@5.com"), "Jude", "Simmons"); customerRepository.save(john); customerRepository.save(frank); @@ -72,7 +72,7 @@ public class SecurityEnabledClientShiroTests extends ForkingClientServerIntegrat assertThat(customers.keySetOnServer().size()).isEqualTo(3); log.info("Customers saved on server:"); - List customerList = customerRepository.findAll(); + var customerList = customerRepository.findAll(); assertThat(customerList.size()).isEqualTo(3); assertThat(customerList.contains(john)).isTrue(); diff --git a/geode/security/src/test/java/example/springdata/geode/client/security/client/SecurityEnabledClientTests.java b/geode/security/src/test/java/example/springdata/geode/client/security/client/SecurityEnabledClientTests.java index e5ea4d09..01c91920 100755 --- a/geode/security/src/test/java/example/springdata/geode/client/security/client/SecurityEnabledClientTests.java +++ b/geode/security/src/test/java/example/springdata/geode/client/security/client/SecurityEnabledClientTests.java @@ -61,9 +61,9 @@ public class SecurityEnabledClientTests extends ForkingClientServerIntegrationTe log.info("Inserting 3 entries for keys: 1, 2, 3"); - Customer john = new Customer(1L, new EmailAddress("2@2.com"), "John", "Smith"); - Customer frank = new Customer(2L, new EmailAddress("3@3.com"), "Frank", "Lamport"); - Customer jude = new Customer(3L, new EmailAddress("5@5.com"), "Jude", "Simmons"); + var john = new Customer(1L, new EmailAddress("2@2.com"), "John", "Smith"); + var frank = new Customer(2L, new EmailAddress("3@3.com"), "Frank", "Lamport"); + var jude = new Customer(3L, new EmailAddress("5@5.com"), "Jude", "Simmons"); customerRepository.save(john); customerRepository.save(frank); @@ -73,7 +73,7 @@ public class SecurityEnabledClientTests extends ForkingClientServerIntegrationTe log.info("Customers saved on server:"); - List customerList = customerRepository.findAll(); + var customerList = customerRepository.findAll(); assertThat(customerList.size()).isEqualTo(3); assertThat(customerList.contains(john)).isTrue(); diff --git a/geode/storage/pom.xml b/geode/storage/pom.xml index 8f9c24e7..525c71df 100644 --- a/geode/storage/pom.xml +++ b/geode/storage/pom.xml @@ -10,7 +10,8 @@ 2.0.0.BUILD-SNAPSHOT - storage + spring-data-geode-storage-example + Spring Data Geode - Storage diff --git a/geode/storage/src/main/java/example/springdata/geode/server/storage/StorageServer.java b/geode/storage/src/main/java/example/springdata/geode/server/storage/StorageServer.java index 59ba371c..a563f122 100755 --- a/geode/storage/src/main/java/example/springdata/geode/server/storage/StorageServer.java +++ b/geode/storage/src/main/java/example/springdata/geode/server/storage/StorageServer.java @@ -57,12 +57,12 @@ public class StorageServer { } private void createOrders(ProductRepository productRepository, OrderRepository orderRepository) { - Random random = new Random(System.nanoTime()); - Address address = new Address("it", "doesn't", "matter"); + var random = new Random(System.nanoTime()); + var address = new Address("it", "doesn't", "matter"); LongStream.rangeClosed(1, 10).forEach((orderId) -> LongStream.rangeClosed(1, 300).forEach((customerId) -> { - Order order = new Order(orderId, customerId, address); + var order = new Order(orderId, customerId, address); IntStream.rangeClosed(0, random.nextInt(3) + 1).forEach((lineItemCount) -> { - int quantity = random.nextInt(3) + 1; + var quantity = random.nextInt(3) + 1; long productId = random.nextInt(3) + 1; order.add(new LineItem(productRepository.findById(productId).get(), quantity)); }); @@ -73,7 +73,7 @@ public class StorageServer { private void createProducts(ProductRepository productRepository) { productRepository.save(new Product(1L, "Apple iPod", new BigDecimal("99.99"), "An Apple portable music player")); productRepository.save(new Product(2L, "Apple iPad", new BigDecimal("499.99"), "An Apple tablet device")); - Product macbook = new Product(3L, "Apple macBook", new BigDecimal("899.99"), "An Apple notebook computer"); + var macbook = new Product(3L, "Apple macBook", new BigDecimal("899.99"), "An Apple notebook computer"); macbook.addAttribute("warranty", "included"); productRepository.save(macbook); } diff --git a/geode/storage/src/test/java/example/springdata/geode/server/storage/StorageServerTests.java b/geode/storage/src/test/java/example/springdata/geode/server/storage/StorageServerTests.java index db8b37bf..275b9bc0 100755 --- a/geode/storage/src/test/java/example/springdata/geode/server/storage/StorageServerTests.java +++ b/geode/storage/src/test/java/example/springdata/geode/server/storage/StorageServerTests.java @@ -56,7 +56,7 @@ public class StorageServerTests { assertThat(customers.getAttributes().getCompressor()).isInstanceOf(SnappyCompressor.class); - GemFireCacheImpl impl = (GemFireCacheImpl) cache; + var impl = (GemFireCacheImpl) cache; assertThat(impl.getCachePerfStats().getTotalPostCompressedBytes()) .isLessThan(impl.getCachePerfStats().getTotalPreCompressedBytes()); diff --git a/geode/transactions/pom.xml b/geode/transactions/pom.xml index 1bd9d9c5..50e15f10 100755 --- a/geode/transactions/pom.xml +++ b/geode/transactions/pom.xml @@ -10,6 +10,7 @@ 2.0.0.BUILD-SNAPSHOT - transactions + spring-data-geode-transactions-example + Spring Data Geode - Transactions diff --git a/geode/transactions/src/main/java/example/springdata/geode/client/transactions/server/CustomerTransactionWriter.java b/geode/transactions/src/main/java/example/springdata/geode/client/transactions/server/CustomerTransactionWriter.java index 2d932664..ceffe414 100644 --- a/geode/transactions/src/main/java/example/springdata/geode/client/transactions/server/CustomerTransactionWriter.java +++ b/geode/transactions/src/main/java/example/springdata/geode/client/transactions/server/CustomerTransactionWriter.java @@ -33,7 +33,7 @@ public class CustomerTransactionWriter implements TransactionWriter { @Override public void beforeCommit(TransactionEvent transactionEvent) throws TransactionWriterException { - AtomicBoolean six_found = new AtomicBoolean(false); + var six_found = new AtomicBoolean(false); transactionEvent.getEvents().forEach(event -> { if (event instanceof EntryEvent diff --git a/geode/transactions/src/test/java/example/springdata/geode/client/transactions/client/TransactionalClientTests.java b/geode/transactions/src/test/java/example/springdata/geode/client/transactions/client/TransactionalClientTests.java index 0d58e401..25f9e806 100755 --- a/geode/transactions/src/test/java/example/springdata/geode/client/transactions/client/TransactionalClientTests.java +++ b/geode/transactions/src/test/java/example/springdata/geode/client/transactions/client/TransactionalClientTests.java @@ -64,7 +64,7 @@ public class TransactionalClientTests extends ForkingClientServerIntegrationTest log.info("Customer for ID before (transaction commit success) = " + customerService.findById(2L).get()); customerService.updateCustomersSuccess(); assertThat(customerService.numberEntriesStoredOnServer()).isEqualTo(5); - Customer customer = customerService.findById(2L).get(); + var customer = customerService.findById(2L).get(); assertThat(customer.getFirstName()).isEqualTo("Humpty"); log.info("Customer for ID after (transaction commit success) = " + customer); @@ -74,8 +74,8 @@ public class TransactionalClientTests extends ForkingClientServerIntegrationTest assertThat(customer.getFirstName()).isEqualTo("Humpty"); log.info("Customer for ID after (transaction commit failure) = " + customerService.findById(2L).get()); - Customer numpty = new Customer(2L, new EmailAddress("2@2.com"), "Numpty", "Hamilton"); - Customer frumpy = new Customer(2L, new EmailAddress("2@2.com"), "Frumpy", "Hamilton"); + var numpty = new Customer(2L, new EmailAddress("2@2.com"), "Numpty", "Hamilton"); + var frumpy = new Customer(2L, new EmailAddress("2@2.com"), "Frumpy", "Hamilton"); customerService.updateCustomersWithDelay(1000, numpty); customerService.updateCustomersWithDelay(10, frumpy); customer = customerService.findById(2L).get(); diff --git a/pom.xml b/pom.xml index 11dcdefa..a88746ab 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ cassandra elasticsearch + jdbc jpa ldap