diff --git a/spring-vault-core/src/main/java/org/springframework/vault/annotation/VaultPropertySource.java b/spring-vault-core/src/main/java/org/springframework/vault/annotation/VaultPropertySource.java
index 9cfbd2b7..9cca5179 100644
--- a/spring-vault-core/src/main/java/org/springframework/vault/annotation/VaultPropertySource.java
+++ b/spring-vault-core/src/main/java/org/springframework/vault/annotation/VaultPropertySource.java
@@ -27,9 +27,9 @@ import org.springframework.context.annotation.Import;
/**
* Annotation providing a convenient and declarative mechanism for adding a
- * {@link VaultPropertySource} to Spring's {@link org.springframework.core.env.Environment
- * Environment}. To be used in conjunction with @{@link Configuration} classes.
- *
Example usage
+ * {@link VaultPropertySource} to Spring's
+ * {@link org.springframework.core.env.Environment Environment}. To be used in conjunction
+ * with @{@link Configuration} classes. Example usage
*
* Given a Vault path {@code secret/my-application} containing the configuration data pair
* {@code database.password=mysecretpassword}, the following {@code @Configuration} class
@@ -65,8 +65,9 @@ import org.springframework.context.annotation.Import;
* ordering is difficult to predict. In such cases - and if overriding is important - it
* is recommended that the user fall back to using the programmatic PropertySource API.
* See {@link org.springframework.core.env.ConfigurableEnvironment
- * ConfigurableEnvironment} and {@link org.springframework.core.env.MutablePropertySources
- * MutablePropertySources} javadocs for details.
+ * ConfigurableEnvironment} and
+ * {@link org.springframework.core.env.MutablePropertySources MutablePropertySources}
+ * javadocs for details.
*
* @author Mark Paluch
*/
diff --git a/spring-vault-core/src/main/java/org/springframework/vault/annotation/VaultPropertySourceRegistrar.java b/spring-vault-core/src/main/java/org/springframework/vault/annotation/VaultPropertySourceRegistrar.java
index 4a714d33..824cb908 100644
--- a/spring-vault-core/src/main/java/org/springframework/vault/annotation/VaultPropertySourceRegistrar.java
+++ b/spring-vault-core/src/main/java/org/springframework/vault/annotation/VaultPropertySourceRegistrar.java
@@ -53,8 +53,8 @@ import org.springframework.vault.core.util.PropertyTransformers;
*
* @author Mark Paluch
*/
-class VaultPropertySourceRegistrar
- implements ImportBeanDefinitionRegistrar, BeanFactoryPostProcessor {
+class VaultPropertySourceRegistrar implements ImportBeanDefinitionRegistrar,
+ BeanFactoryPostProcessor {
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
@@ -63,15 +63,16 @@ class VaultPropertySourceRegistrar
ConfigurableEnvironment env = beanFactory.getBean(ConfigurableEnvironment.class);
MutablePropertySources propertySources = env.getPropertySources();
- registerPropertySources(beanFactory
- .getBeansOfType(
+ registerPropertySources(
+ beanFactory.getBeansOfType(
org.springframework.vault.core.env.VaultPropertySource.class)
- .values(), propertySources);
+ .values(), propertySources);
- registerPropertySources(beanFactory
- .getBeansOfType(
- org.springframework.vault.core.env.LeaseAwareVaultPropertySource.class)
- .values(), propertySources);
+ registerPropertySources(
+ beanFactory
+ .getBeansOfType(
+ org.springframework.vault.core.env.LeaseAwareVaultPropertySource.class)
+ .values(), propertySources);
}
private void registerPropertySources(
@@ -121,9 +122,8 @@ class VaultPropertySourceRegistrar
"'vaultTemplateRef' in @EnableVaultPropertySource must not be empty");
PropertyTransformer propertyTransformer = StringUtils
- .hasText(propertyNamePrefix)
- ? PropertyTransformers.propertyNamePrefix(propertyNamePrefix)
- : PropertyTransformers.noop();
+ .hasText(propertyNamePrefix) ? PropertyTransformers
+ .propertyNamePrefix(propertyNamePrefix) : PropertyTransformers.noop();
for (String propertyPath : paths) {
@@ -131,8 +131,8 @@ class VaultPropertySourceRegistrar
continue;
}
- AbstractBeanDefinition beanDefinition = createBeanDefinition(ref, renewal,
- propertyTransformer, propertyPath);
+ AbstractBeanDefinition beanDefinition = createBeanDefinition(ref,
+ renewal, propertyTransformer, propertyPath);
registry.registerBeanDefinition("vaultPropertySource#" + counter,
beanDefinition);
@@ -148,20 +148,19 @@ class VaultPropertySourceRegistrar
BeanDefinitionBuilder builder;
if (isRenewable(renewal)) {
- builder = BeanDefinitionBuilder.rootBeanDefinition(
- org.springframework.vault.core.env.LeaseAwareVaultPropertySource.class);
+ builder = BeanDefinitionBuilder
+ .rootBeanDefinition(org.springframework.vault.core.env.LeaseAwareVaultPropertySource.class);
- RequestedSecret requestedSecret = renewal == Renewal.ROTATE
- ? RequestedSecret.rotating(propertyPath)
- : RequestedSecret.renewable(propertyPath);
+ RequestedSecret requestedSecret = renewal == Renewal.ROTATE ? RequestedSecret
+ .rotating(propertyPath) : RequestedSecret.renewable(propertyPath);
builder.addConstructorArgValue(propertyPath);
builder.addConstructorArgReference("secretLeaseContainer");
builder.addConstructorArgValue(requestedSecret);
}
else {
- builder = BeanDefinitionBuilder.rootBeanDefinition(
- org.springframework.vault.core.env.VaultPropertySource.class);
+ builder = BeanDefinitionBuilder
+ .rootBeanDefinition(org.springframework.vault.core.env.VaultPropertySource.class);
builder.addConstructorArgValue(propertyPath);
builder.addConstructorArgReference(ref);
@@ -186,8 +185,8 @@ class VaultPropertySourceRegistrar
addAttributesIfNotNull(result,
metadata.getAnnotationAttributes(annotationClassName, false));
- Map container = metadata
- .getAnnotationAttributes(containerClassName, false);
+ Map container = metadata.getAnnotationAttributes(
+ containerClassName, false);
if (container != null && container.containsKey("value")) {
for (Map containedAttributes : (Map[]) container
.get("value")) {
diff --git a/spring-vault-core/src/main/java/org/springframework/vault/config/AbstractVaultConfiguration.java b/spring-vault-core/src/main/java/org/springframework/vault/config/AbstractVaultConfiguration.java
index 455c8ea4..20ee52c9 100644
--- a/spring-vault-core/src/main/java/org/springframework/vault/config/AbstractVaultConfiguration.java
+++ b/spring-vault-core/src/main/java/org/springframework/vault/config/AbstractVaultConfiguration.java
@@ -73,9 +73,8 @@ public abstract class AbstractVaultConfiguration implements ApplicationContextAw
*/
@Bean
public VaultTemplate vaultTemplate() {
- return new VaultTemplate(vaultEndpoint(),
- clientHttpRequestFactoryWrapper().getClientHttpRequestFactory(),
- sessionManager());
+ return new VaultTemplate(vaultEndpoint(), clientHttpRequestFactoryWrapper()
+ .getClientHttpRequestFactory(), sessionManager());
}
/**
@@ -170,8 +169,8 @@ public abstract class AbstractVaultConfiguration implements ApplicationContextAw
*/
@Bean
public ClientFactoryWrapper clientHttpRequestFactoryWrapper() {
- return new ClientFactoryWrapper(ClientHttpRequestFactoryFactory
- .create(clientOptions(), sslConfiguration()));
+ return new ClientFactoryWrapper(ClientHttpRequestFactoryFactory.create(
+ clientOptions(), sslConfiguration()));
}
/**
diff --git a/spring-vault-core/src/main/java/org/springframework/vault/config/EnvironmentVaultConfiguration.java b/spring-vault-core/src/main/java/org/springframework/vault/config/EnvironmentVaultConfiguration.java
index a21c70b6..3d19f193 100644
--- a/spring-vault-core/src/main/java/org/springframework/vault/config/EnvironmentVaultConfiguration.java
+++ b/spring-vault-core/src/main/java/org/springframework/vault/config/EnvironmentVaultConfiguration.java
@@ -31,7 +31,6 @@ import org.springframework.vault.authentication.AppRoleAuthentication;
import org.springframework.vault.authentication.AppRoleAuthenticationOptions;
import org.springframework.vault.authentication.AwsEc2Authentication;
import org.springframework.vault.authentication.AwsEc2AuthenticationOptions;
-import org.springframework.vault.authentication.AwsEc2AuthenticationOptions.AwsEc2AuthenticationOptionsBuilder;
import org.springframework.vault.authentication.ClientAuthentication;
import org.springframework.vault.authentication.ClientCertificateAuthentication;
import org.springframework.vault.authentication.CubbyholeAuthentication;
@@ -40,6 +39,7 @@ import org.springframework.vault.authentication.IpAddressUserId;
import org.springframework.vault.authentication.MacAddressUserId;
import org.springframework.vault.authentication.StaticUserId;
import org.springframework.vault.authentication.TokenAuthentication;
+import org.springframework.vault.authentication.AwsEc2AuthenticationOptions.AwsEc2AuthenticationOptionsBuilder;
import org.springframework.vault.client.VaultEndpoint;
import org.springframework.vault.support.SslConfiguration;
import org.springframework.vault.support.VaultToken;
@@ -133,8 +133,8 @@ import org.springframework.web.client.RestOperations;
* @see CubbyholeAuthentication
*/
@Configuration
-public class EnvironmentVaultConfiguration extends AbstractVaultConfiguration
- implements ApplicationContextAware {
+public class EnvironmentVaultConfiguration extends AbstractVaultConfiguration implements
+ ApplicationContextAware {
private RestOperations cachedRestOperations;
private ApplicationContext applicationContext;
@@ -281,8 +281,8 @@ public class EnvironmentVaultConfiguration extends AbstractVaultConfiguration
Assert.hasText(roleId,
"Vault AWS EC2 authentication: RoleId (vault.aws-ec2.role-id) must not be empty");
- AwsEc2AuthenticationOptionsBuilder builder = AwsEc2AuthenticationOptions.builder()
- .role(roleId);
+ AwsEc2AuthenticationOptionsBuilder builder = AwsEc2AuthenticationOptions
+ .builder().role(roleId);
if (StringUtils.hasText(identityDocument)) {
builder.identityDocumentUri(URI.create(identityDocument));
diff --git a/spring-vault-core/src/main/java/org/springframework/vault/core/VaultSysTemplate.java b/spring-vault-core/src/main/java/org/springframework/vault/core/VaultSysTemplate.java
index f1abaa8e..045291cf 100644
--- a/spring-vault-core/src/main/java/org/springframework/vault/core/VaultSysTemplate.java
+++ b/spring-vault-core/src/main/java/org/springframework/vault/core/VaultSysTemplate.java
@@ -245,7 +245,7 @@ public class VaultSysTemplate implements VaultSysOperations {
ResponseEntity exchange = restOperations.exchange(path,
HttpMethod.GET, null, MOUNT_TYPE_REF,
- Collections. emptyMap());
+ Collections.emptyMap());
VaultMountsResponse body = exchange.getBody();
diff --git a/spring-vault-core/src/main/java/org/springframework/vault/core/env/LeaseAwareVaultPropertySource.java b/spring-vault-core/src/main/java/org/springframework/vault/core/env/LeaseAwareVaultPropertySource.java
index 8d8da2e6..ff185e3f 100644
--- a/spring-vault-core/src/main/java/org/springframework/vault/core/env/LeaseAwareVaultPropertySource.java
+++ b/spring-vault-core/src/main/java/org/springframework/vault/core/env/LeaseAwareVaultPropertySource.java
@@ -50,8 +50,8 @@ import org.springframework.vault.support.JsonMapFlattener;
* @see PropertyTransformer
* @see PropertyTransformers
*/
-public class LeaseAwareVaultPropertySource
- extends EnumerablePropertySource {
+public class LeaseAwareVaultPropertySource extends
+ EnumerablePropertySource {
private final static Log logger = LogFactory
.getLog(LeaseAwareVaultPropertySource.class);
diff --git a/spring-vault-core/src/main/java/org/springframework/vault/core/lease/SecretLeaseContainer.java b/spring-vault-core/src/main/java/org/springframework/vault/core/lease/SecretLeaseContainer.java
index ab3d6abe..2a4941d1 100644
--- a/spring-vault-core/src/main/java/org/springframework/vault/core/lease/SecretLeaseContainer.java
+++ b/spring-vault-core/src/main/java/org/springframework/vault/core/lease/SecretLeaseContainer.java
@@ -20,8 +20,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.Set;
+import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ScheduledFuture;
@@ -65,30 +65,30 @@ import org.springframework.web.client.RestOperations;
*
*
*
-SecretLeaseContainer container = new SecretLeaseContainer(vaultOperations,
- taskScheduler);
-
-final RequestedSecret requestedSecret = container
- .requestRotatingSecret("mysql/creds/my-role");
-container.addLeaseListener(new LeaseListenerAdapter() {
- @Override
- public void onLeaseEvent(LeaseEvent leaseEvent) {
-
- if (requestedSecret == leaseEvent.getSource()) {
-
- if (leaseEvent instanceof LeaseCreatedEvent) {
-
- }
-
- if (leaseEvent instanceof LeaseExpiredEvent) {
-
- }
- }
- }
-});
-
-container.afterPropertiesSet();
-container.start(); // events are triggered after starting the container
+ * SecretLeaseContainer container = new SecretLeaseContainer(vaultOperations,
+ * taskScheduler);
+ *
+ * final RequestedSecret requestedSecret = container
+ * .requestRotatingSecret("mysql/creds/my-role");
+ * container.addLeaseListener(new LeaseListenerAdapter() {
+ * @Override
+ * public void onLeaseEvent(LeaseEvent leaseEvent) {
+ *
+ * if (requestedSecret == leaseEvent.getSource()) {
+ *
+ * if (leaseEvent instanceof LeaseCreatedEvent) {
+ *
+ * }
+ *
+ * if (leaseEvent instanceof LeaseExpiredEvent) {
+ *
+ * }
+ * }
+ * }
+ * });
+ *
+ * container.afterPropertiesSet();
+ * container.start(); // events are triggered after starting the container
*
*
*
@@ -115,8 +115,8 @@ container.start(); // events are triggered after starting the container
* @see Lease
*/
@CommonsLog
-public class SecretLeaseContainer extends SecretLeaseEventPublisher
- implements InitializingBean, DisposableBean {
+public class SecretLeaseContainer extends SecretLeaseEventPublisher implements
+ InitializingBean, DisposableBean {
private final static AtomicIntegerFieldUpdater UPDATER = AtomicIntegerFieldUpdater
.newUpdater(SecretLeaseContainer.class, "status");
@@ -337,8 +337,8 @@ public class SecretLeaseContainer extends SecretLeaseEventPublisher
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setDaemon(true);
- scheduler.setThreadNamePrefix(String.format("%s-%d-",
- getClass().getSimpleName(), poolId.incrementAndGet()));
+ scheduler.setThreadNamePrefix(String.format("%s-%d-", getClass()
+ .getSimpleName(), poolId.incrementAndGet()));
scheduler.afterPropertiesSet();
this.taskScheduler = scheduler;
@@ -346,8 +346,8 @@ public class SecretLeaseContainer extends SecretLeaseEventPublisher
}
for (RequestedSecret requestedSecret : requestedSecrets) {
- this.renewals.put(requestedSecret,
- new LeaseRenewalScheduler(this.taskScheduler));
+ this.renewals.put(requestedSecret, new LeaseRenewalScheduler(
+ this.taskScheduler));
}
}
}
@@ -457,8 +457,8 @@ public class SecretLeaseContainer extends SecretLeaseEventPublisher
protected Lease doRenewLease(RequestedSecret requestedSecret, final Lease lease) {
try {
- ResponseEntity