|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2012-2016 the original author or authors. |
|
|
|
* Copyright 2012-2017 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -18,6 +18,7 @@ package org.springframework.boot.autoconfigure.cache; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
|
|
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; |
|
|
|
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; |
|
|
|
@ -146,7 +147,8 @@ public class CacheProperties { |
|
|
|
public static class Couchbase { |
|
|
|
public static class Couchbase { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Entry expiration in milliseconds. By default the entries never expire. |
|
|
|
* Entry expiration in milliseconds. By default the entries never expire. Note |
|
|
|
|
|
|
|
* that this value is ultimately converted to seconds. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private int expiration; |
|
|
|
private int expiration; |
|
|
|
|
|
|
|
|
|
|
|
@ -154,6 +156,14 @@ public class CacheProperties { |
|
|
|
return this.expiration; |
|
|
|
return this.expiration; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Return the expiration in seconds. |
|
|
|
|
|
|
|
* @return the expiration in seconds |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public int getExpirationSeconds() { |
|
|
|
|
|
|
|
return (int) TimeUnit.MILLISECONDS.toSeconds(this.expiration); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setExpiration(int expiration) { |
|
|
|
public void setExpiration(int expiration) { |
|
|
|
this.expiration = expiration; |
|
|
|
this.expiration = expiration; |
|
|
|
} |
|
|
|
} |
|
|
|
|