summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-04-23 00:50:08 +0200
committerEndi S. Dewata <edewata@redhat.com>2016-05-03 01:56:54 +0200
commit0b779ffe4d29474b4f75370e4da9d7723d9bfec5 (patch)
treeb56ed632a5b8063eccbfc4df889433b7033d6bdb
parent2b5f9e1630bae2e755093447b08c2236ce8db158 (diff)
downloadpki-0b779ffe4d29474b4f75370e4da9d7723d9bfec5.zip
pki-0b779ffe4d29474b4f75370e4da9d7723d9bfec5.tar.gz
pki-0b779ffe4d29474b4f75370e4da9d7723d9bfec5.tar.xz
Renamed token status TEMP_LOST to SUSPENDED.
The token status TEMP_LOST has been renamed to SUSPENDED such that it can be used more general contexts. To simplify the transition, the CLIs and the REST API will continue to accept TEMP_LOST but it will be converted internally into SUSPENDED and a deprecation warning will be generated. https://fedorahosted.org/pki/ticket/2286
-rw-r--r--base/common/src/com/netscape/certsrv/tps/token/TokenStatus.java9
-rw-r--r--base/tps-client/doc/CS.cfg.in4
-rw-r--r--base/tps/shared/conf/CS.cfg.in4
-rw-r--r--base/tps/shared/conf/token-states.properties14
-rw-r--r--base/tps/shared/webapps/tps/js/token.js2
-rw-r--r--base/tps/src/org/dogtagpki/server/tps/TPSSubsystem.java4
-rw-r--r--base/tps/src/org/dogtagpki/server/tps/dbs/TokenRecord.java2
-rw-r--r--base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java4
8 files changed, 24 insertions, 19 deletions
diff --git a/base/common/src/com/netscape/certsrv/tps/token/TokenStatus.java b/base/common/src/com/netscape/certsrv/tps/token/TokenStatus.java
index b2f23dd..f3dd73e 100644
--- a/base/common/src/com/netscape/certsrv/tps/token/TokenStatus.java
+++ b/base/common/src/com/netscape/certsrv/tps/token/TokenStatus.java
@@ -51,7 +51,7 @@ public class TokenStatus {
public final static int TOKEN_UNINITIALIZED = 0;
public final static int TOKEN_DAMAGED = 1;
public final static int TOKEN_PERM_LOST = 2;
- public final static int TOKEN_TEMP_LOST = 3;
+ public final static int TOKEN_SUSPENDED = 3;
public final static int TOKEN_ACTIVE = 4;
public final static int TOKEN_TEMP_LOST_PERM_LOST = 5;
public final static int TOKEN_TERMINATED = 6;
@@ -59,7 +59,7 @@ public class TokenStatus {
public final static TokenStatus UNINITIALIZED = new TokenStatus("UNINITIALIZED", TOKEN_UNINITIALIZED);
public final static TokenStatus DAMAGED = new TokenStatus("DAMAGED", TOKEN_DAMAGED);
public final static TokenStatus PERM_LOST = new TokenStatus("PERM_LOST", TOKEN_PERM_LOST);
- public final static TokenStatus TEMP_LOST = new TokenStatus("TEMP_LOST", TOKEN_TEMP_LOST);
+ public final static TokenStatus SUSPENDED = new TokenStatus("SUSPENDED", TOKEN_SUSPENDED);
public final static TokenStatus ACTIVE = new TokenStatus("ACTIVE", TOKEN_ACTIVE);
public final static TokenStatus TEMP_LOST_PERM_LOST = new TokenStatus("TEMP_LOST_PERM_LOST", TOKEN_TEMP_LOST_PERM_LOST);
public final static TokenStatus TERMINATED = new TokenStatus("TERMINATED", TOKEN_TERMINATED);
@@ -136,6 +136,11 @@ public class TokenStatus {
public static TokenStatus valueOf(String name) {
+ if ("TEMP_LOST".equals(name)) {
+ System.err.println("WARNING: The token status " + name + " has been deprecated. Please use SUSPENDED instead.");
+ return SUSPENDED;
+ }
+
TokenStatus status = instancesByName.get(name);
if (status == null) {
diff --git a/base/tps-client/doc/CS.cfg.in b/base/tps-client/doc/CS.cfg.in
index f1a7903..bf32630 100644
--- a/base/tps-client/doc/CS.cfg.in
+++ b/base/tps-client/doc/CS.cfg.in
@@ -1485,7 +1485,7 @@ tokendb._067=# - has transitions between the following states
tokendb._068=# UNINITIALIZED = 0,
tokendb._069=# DAMAGED = 1,
tokendb._070=# PERM_LOST = 2,
-tokendb._071=# TEMP_LOST = 3,
+tokendb._071=# SUSPENDED = 3,
tokendb._072=# ACTIVE = 4,
tokendb._073=# TEMP_LOST_PERM_LOST = 5,
tokendb._074=# TERMINATED = 6
@@ -1595,7 +1595,7 @@ tps._009=# - token operations, like formatting and enrollment have transitions
tps._010=# UNINITIALIZED = 0,
tps._011=# DAMAGED = 1,
tps._012=# PERM_LOST = 2,
-tps._013=# TEMP_LOST =3 ,
+tps._013=# SUSPENDED = 3,
tps._014=# ACTIVE = 4,
tps._015=# TEMP_LOST_PERM_LOST = 5,
tps._016=# TERMINATED = 6
diff --git a/base/tps/shared/conf/CS.cfg.in b/base/tps/shared/conf/CS.cfg.in
index 39e5049..b5441a0 100644
--- a/base/tps/shared/conf/CS.cfg.in
+++ b/base/tps/shared/conf/CS.cfg.in
@@ -1957,7 +1957,7 @@ tokendb._067=# - has transitions between the following states
tokendb._068=# UNINITIALIZED = 0,
tokendb._069=# DAMAGED = 1,
tokendb._070=# PERM_LOST = 2,
-tokendb._071=# TEMP_LOST = 3,
+tokendb._071=# SUSPENDED = 3,
tokendb._072=# ACTIVE = 4,
tokendb._073=# TEMP_LOST_PERM_LOST = 5,
tokendb._074=# TERMINATED = 6
@@ -2026,7 +2026,7 @@ tps._009=# - token operations, like formatting and enrollment have transitions
tps._010=# UNINITIALIZED = 0,
tps._011=# DAMAGED = 1,
tps._012=# PERM_LOST = 2,
-tps._013=# TEMP_LOST = 3,
+tps._013=# SUSPENDED = 3,
tps._014=# ACTIVE = 4,
tps._015=# TEMP_LOST_PERM_LOST = 5,
tps._016=# TERMINATED = 6
diff --git a/base/tps/shared/conf/token-states.properties b/base/tps/shared/conf/token-states.properties
index a64d940..3c7e7d6 100644
--- a/base/tps/shared/conf/token-states.properties
+++ b/base/tps/shared/conf/token-states.properties
@@ -1,7 +1,7 @@
# Token states
UNINITIALIZED = Uninitialized
ACTIVE = Active
-TEMP_LOST = Temporarily lost
+SUSPENDED = Temporarily lost/suspended
PERM_LOST = Permanently lost
DAMAGED = Physically damaged
TEMP_LOST_PERM_LOST = Temporarily lost then permanently lost
@@ -10,13 +10,13 @@ TERMINATED = Terminated
# Token state transitions
UNINITIALIZED.DAMAGED = This token has been physically damaged.
UNINITIALIZED.PERM_LOST = This token has been permanently lost.
-UNINITIALIZED.TEMP_LOST = This token has been temporarily lost.
+UNINITIALIZED.SUSPENDED = This token has been temporarily lost/suspended.
UNINITIALIZED.TERMINATED = This token has been terminated.
-TEMP_LOST.ACTIVE = This temporarily lost token has been found.
-TEMP_LOST.PERM_LOST = This temporarily lost token has become permanently lost.
-TEMP_LOST.TERMINATED = This temporarily lost token has been terminated.
-TEMP_LOST.UNINITIALIZED = This temporarily lost token has been found.
+SUSPENDED.ACTIVE = This temporarily lost/suspended token has been found.
+SUSPENDED.PERM_LOST = This temporarily lost/suspended token has become permanently lost.
+SUSPENDED.TERMINATED = This temporarily lost/suspended token has been terminated.
+SUSPENDED.UNINITIALIZED = This temporarily lost/suspended token has been found.
ACTIVE.DAMAGED = This token has been physically damaged.
ACTIVE.PERM_LOST = This token has been permanently lost.
-ACTIVE.TEMP_LOST = This token has been temporarily lost.
+ACTIVE.SUSPENDED = This token has been temporarily lost/suspended.
ACTIVE.TERMINATED = This token has been terminated.
diff --git a/base/tps/shared/webapps/tps/js/token.js b/base/tps/shared/webapps/tps/js/token.js
index e09fa5f..c81e2cc 100644
--- a/base/tps/shared/webapps/tps/js/token.js
+++ b/base/tps/shared/webapps/tps/js/token.js
@@ -23,7 +23,7 @@
var TokenStatus = {
UNINITIALIZED : "Uninitialized",
ACTIVE : "Active",
- TEMP_LOST : "Temporarily lost",
+ SUSPENDED : "Temporarily lost/suspended",
PERM_LOST : "Permanently lost",
DAMAGED : "Physically damaged",
TEMP_LOST_PERM_LOST : "Temporarily lost then permanently lost",
diff --git a/base/tps/src/org/dogtagpki/server/tps/TPSSubsystem.java b/base/tps/src/org/dogtagpki/server/tps/TPSSubsystem.java
index 008f613..b0ffb75 100644
--- a/base/tps/src/org/dogtagpki/server/tps/TPSSubsystem.java
+++ b/base/tps/src/org/dogtagpki/server/tps/TPSSubsystem.java
@@ -145,7 +145,7 @@ public class TPSSubsystem implements IAuthority, ISubsystem {
/**
* Return the allowed next states for a given token based on TPS configuration.
*
- * If the current state is TEMP_LOST, token will be allowed transition to either
+ * If the current state is SUSPENDED, token will be allowed transition to either
* UNINITIALIZED or ACTIVE depending on whether the token has certificates.
*
* @param tokenRecord
@@ -156,7 +156,7 @@ public class TPSSubsystem implements IAuthority, ISubsystem {
TokenStatus currentState = tokenRecord.getTokenStatus();
Collection<TokenStatus> nextStates = allowedTransitions.get(currentState);
- if (currentState == TokenStatus.TEMP_LOST) {
+ if (currentState == TokenStatus.SUSPENDED) {
Collection<TokenStatus> ns = new LinkedHashSet<TokenStatus>();
diff --git a/base/tps/src/org/dogtagpki/server/tps/dbs/TokenRecord.java b/base/tps/src/org/dogtagpki/server/tps/dbs/TokenRecord.java
index a1aef57..80fd30e 100644
--- a/base/tps/src/org/dogtagpki/server/tps/dbs/TokenRecord.java
+++ b/base/tps/src/org/dogtagpki/server/tps/dbs/TokenRecord.java
@@ -258,7 +258,7 @@ public class TokenRecord extends DBRecord {
return TokenStatus.DAMAGED;
} else if ("onHold".equals(reason)) {
- return TokenStatus.TEMP_LOST;
+ return TokenStatus.SUSPENDED;
}
} else if ("terminated".equals(status)) {
diff --git a/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java b/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
index 46a3c12..cc68c8a 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
@@ -98,7 +98,7 @@ public class TokenService extends PKIService implements TokenResource {
break;
case TokenStatus.TOKEN_ACTIVE:
- if (tokenRecord.getTokenStatus() == TokenStatus.TEMP_LOST) {
+ if (tokenRecord.getTokenStatus() == TokenStatus.SUSPENDED) {
// unrevoke certs
tps.tdb.unRevokeCertsByCUID(tokenRecord.getId(), ipAddress, remoteUser);
}
@@ -129,7 +129,7 @@ public class TokenService extends PKIService implements TokenResource {
tps.tdb.revokeCertsByCUID(tokenRecord.getId(), "destroyed", ipAddress, remoteUser);
break;
- case TokenStatus.TOKEN_TEMP_LOST:
+ case TokenStatus.TOKEN_SUSPENDED:
tokenRecord.setStatus("lost");
newStatus = "lost";
tokenRecord.setReason("onHold");