Skip to content

Commit cbeeb5a

Browse files
authored
Preparing for version 1.3.4 (#22)
1 parent ffe363d commit cbeeb5a

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

pom.xml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77
<artifactId>untis4j</artifactId>
88
<groupId>org.bytedream</groupId>
9-
<version>1.3.5</version>
9+
<version>1.3.4</version>
1010

1111
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1213
<maven.compiler.target>11</maven.compiler.target>
1314
<maven.compiler.source>11</maven.compiler.source>
1415
</properties>
@@ -22,7 +23,7 @@
2223
<dependency>
2324
<groupId>com.github.ben-manes.caffeine</groupId>
2425
<artifactId>caffeine</artifactId>
25-
<version>3.1.5</version>
26+
<version>3.1.6</version>
2627
</dependency>
2728
</dependencies>
2829

@@ -36,10 +37,15 @@
3637

3738
<build>
3839
<plugins>
40+
<plugin>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<artifactId>maven-resources-plugin</artifactId>
43+
<version>3.3.1</version>
44+
</plugin>
3945
<plugin>
4046
<groupId>org.apache.maven.plugins</groupId>
4147
<artifactId>maven-compiler-plugin</artifactId>
42-
<version>3.10.1</version>
48+
<version>3.11.0</version>
4349
<configuration>
4450
<encoding>UTF-8</encoding>
4551
<target>${maven.compiler.target}</target>
@@ -49,7 +55,7 @@
4955
<plugin>
5056
<groupId>org.apache.maven.plugins</groupId>
5157
<artifactId>maven-source-plugin</artifactId>
52-
<version>3.2.1</version>
58+
<version>3.3.0</version>
5359
<executions>
5460
<execution>
5561
<id>attach-sources</id>
@@ -62,7 +68,7 @@
6268
<plugin>
6369
<groupId>org.apache.maven.plugins</groupId>
6470
<artifactId>maven-javadoc-plugin</artifactId>
65-
<version>3.4.1</version>
71+
<version>3.5.0</version>
6672
<executions>
6773
<execution>
6874
<id>attach-javadocs</id>

src/main/java/org/bytedream/untis4j/CacheManager.java

100755100644
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
import org.bytedream.untis4j.responseObjects.baseObjects.BaseResponse;
44
import org.bytedream.untis4j.responseObjects.baseObjects.BaseResponseLists.ResponseList;
55

6+
67
import java.io.IOException;
78
import java.util.Arrays;
89
import java.util.HashMap;
910
import java.util.Map;
10-
import java.util.function.Function;
1111

1212
/**
1313
* Class to manage cache and minimize server requests and speed up the API
1414
*
1515
* @version 1.0
1616
* @since 1.1
1717
*/
18+
@Deprecated(since = "1.3.4")
1819
public class CacheManager {
1920

2021
private final HashMap<Integer, BaseResponse> cachedInformation = new HashMap<>();
@@ -25,7 +26,9 @@ public class CacheManager {
2526
* @param method method of the cached object you want to check
2627
* @return if the cache contains the given method
2728
* @since 1.1
29+
* @deprecated Use the RequestManager cache
2830
*/
31+
@Deprecated(since = "1.3.4")
2932
public boolean contains(UntisUtils.Method method) {
3033
return cachedInformation.containsKey(mapCode(method, new HashMap<>()));
3134
}
@@ -40,7 +43,9 @@ public boolean contains(UntisUtils.Method method) {
4043
* @return returns the cached object
4144
* @see CacheManager#getOrRequest(UntisUtils.Method, RequestManager, Map, ResponseConsumer)
4245
* @since 1.1
46+
* @deprecated Use the RequestManager cache
4347
*/
48+
@Deprecated(since = "1.3.4")
4449
public <T extends BaseResponse> T getOrRequest(UntisUtils.Method method, RequestManager requestManager, ResponseConsumer<? extends T> action) {
4550
return getOrRequest(method, requestManager, new HashMap<>(), action);
4651
}
@@ -55,7 +60,9 @@ public <T extends BaseResponse> T getOrRequest(UntisUtils.Method method, Request
5560
* @param <T> an object which extends {@link BaseResponse}
5661
* @return the response in a {@link ResponseList}
5762
* @since 1.1
63+
* @deprecated Use the RequestManager cache
5864
*/
65+
@Deprecated(since = "1.3.4")
5966
public <T extends BaseResponse> T getOrRequest(UntisUtils.Method method, RequestManager requestManager, Map<String, ?> params, ResponseConsumer<T> action) {
6067
int keyHashCode = mapCode(method, params);
6168

@@ -79,7 +86,9 @@ public <T extends BaseResponse> T getOrRequest(UntisUtils.Method method, Request
7986
* @param action lambda expression that gets returns the new content
8087
* @throws IOException if an IO Exception occurs
8188
* @since 1.1
89+
* @deprecated Use the RequestManager cache
8290
*/
91+
@Deprecated(since = "1.3.4")
8392
public void update(UntisUtils.Method method, RequestManager requestManager, Map<String, ?> params, ResponseConsumer<? extends BaseResponse> action) throws IOException {
8493
cachedInformation.replace(mapCode(method, params), action.getResponse(requestManager.POST(method.getMethod(), params)));
8594
}

src/main/java/org/bytedream/untis4j/Session.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
package org.bytedream.untis4j;
77

8-
import com.github.benmanes.caffeine.cache.LoadingCache;
98
import org.bytedream.untis4j.responseObjects.*;
109
import org.bytedream.untis4j.responseObjects.baseObjects.BaseResponse;
1110
import org.bytedream.untis4j.responseObjects.baseObjects.BaseResponseLists;
@@ -127,7 +126,7 @@ public void reconnect() throws IOException {
127126
}
128127

129128
/**
130-
* Checks if the cache should be used and depending on the result it calls {@link CacheManager#getOrRequest(UntisUtils.Method, RequestManager, Map, ResponseConsumer)} or request the given method manually
129+
* Checks if the same request is still in the {@link com.github.benmanes.caffeine.cache.LoadingCache} and if not, the request is sent to the server.
131130
*
132131
* @see Session#requestSender(UntisUtils.Method, Map, ResponseConsumer)
133132
* @since 1.1
@@ -137,8 +136,9 @@ private <T extends BaseResponse> T requestSender(UntisUtils.Method method, Respo
137136
}
138137

139138
/**
140-
* Checks if the cache should be used and depending on the result it calls {@link CacheManager#getOrRequest(UntisUtils.Method, RequestManager, Map, ResponseConsumer)} or request the given method manually
141-
*
139+
* Checks if the same request is still in the {@link com.github.benmanes.caffeine.cache.LoadingCache} and if not, the request is sent to the server.
140+
*
141+
*
142142
* @param method the POST method
143143
* @param params params you want to send with the request
144144
* @param action lambda expression that gets called if the {@code method} is not in the cache manager

0 commit comments

Comments
 (0)