diff options
author | Anton Tananaev <anton@traccar.org> | 2022-10-02 08:39:06 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-10-02 08:39:06 -0700 |
commit | ae3eddba7e0a6688807f71d2c290618d1c49da05 (patch) | |
tree | c0ff0ed14f7ccfcd99973d16e8bcbe52045e8f5b /src/main/java/org/traccar/api/signature | |
parent | 63a8bb747e92cc98d64bad59464922a9f6be5867 (diff) | |
download | trackermap-server-ae3eddba7e0a6688807f71d2c290618d1c49da05.tar.gz trackermap-server-ae3eddba7e0a6688807f71d2c290618d1c49da05.tar.bz2 trackermap-server-ae3eddba7e0a6688807f71d2c290618d1c49da05.zip |
Use singletons where possible
Diffstat (limited to 'src/main/java/org/traccar/api/signature')
-rw-r--r-- | src/main/java/org/traccar/api/signature/CryptoManager.java | 2 | ||||
-rw-r--r-- | src/main/java/org/traccar/api/signature/TokenManager.java | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/api/signature/CryptoManager.java b/src/main/java/org/traccar/api/signature/CryptoManager.java index 8a3e7704c..249d5bd97 100644 --- a/src/main/java/org/traccar/api/signature/CryptoManager.java +++ b/src/main/java/org/traccar/api/signature/CryptoManager.java @@ -21,6 +21,7 @@ import org.traccar.storage.query.Columns; import org.traccar.storage.query.Request; import javax.inject.Inject; +import javax.inject.Singleton; import java.security.GeneralSecurityException; import java.security.KeyFactory; import java.security.KeyPair; @@ -33,6 +34,7 @@ import java.security.spec.ECGenParameterSpec; import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X509EncodedKeySpec; +@Singleton public class CryptoManager { private final Storage storage; diff --git a/src/main/java/org/traccar/api/signature/TokenManager.java b/src/main/java/org/traccar/api/signature/TokenManager.java index a352ecc10..6a0d90b40 100644 --- a/src/main/java/org/traccar/api/signature/TokenManager.java +++ b/src/main/java/org/traccar/api/signature/TokenManager.java @@ -21,11 +21,13 @@ import org.apache.commons.codec.binary.Base64; import org.traccar.storage.StorageException; import javax.inject.Inject; +import javax.inject.Singleton; import java.io.IOException; import java.security.GeneralSecurityException; import java.util.Date; import java.util.concurrent.TimeUnit; +@Singleton public class TokenManager { private static final int DEFAULT_EXPIRATION_DAYS = 7; |