diff options
author | Endi S. Dewata <edewata@redhat.com> | 2016-04-23 05:28:10 +0200 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2016-05-03 01:57:34 +0200 |
commit | 1b8f5230d01499d97b874d4912c5c1a13e389c5f (patch) | |
tree | 761b0f7d2b2de2e58862fe81af1bee219e078f47 /base/tps | |
parent | 0b779ffe4d29474b4f75370e4da9d7723d9bfec5 (diff) | |
download | pki-1b8f5230d01499d97b874d4912c5c1a13e389c5f.tar.gz pki-1b8f5230d01499d97b874d4912c5c1a13e389c5f.tar.xz pki-1b8f5230d01499d97b874d4912c5c1a13e389c5f.zip |
Renamed token status UNINITIALIZED to READY.
The token status UNINITIALIZED has been renamed to READY for
clarity.
To simplify the transition, the CLIs and the REST API will continue
to accept UNINITIALIZED but it will be converted internally into
READY and a deprecation warning will be generated.
https://fedorahosted.org/pki/ticket/2288
Diffstat (limited to 'base/tps')
9 files changed, 27 insertions, 27 deletions
diff --git a/base/tps/shared/conf/CS.cfg.in b/base/tps/shared/conf/CS.cfg.in index b5441a0a1..2b451defc 100644 --- a/base/tps/shared/conf/CS.cfg.in +++ b/base/tps/shared/conf/CS.cfg.in @@ -1954,7 +1954,7 @@ tokendb._064=# is set to YES. Otherwise, re-enrollment is not tokendb._065=# allowed. tokendb._066=# tokendb.allowedTransitions: tokendb._067=# - has transitions between the following states -tokendb._068=# UNINITIALIZED = 0, +tokendb._068=# READY = 0, tokendb._069=# DAMAGED = 1, tokendb._070=# PERM_LOST = 2, tokendb._071=# SUSPENDED = 3, @@ -2023,7 +2023,7 @@ tps._005=# tps.cert.subsystem.nickname=xxx tps._007=# tps.cert.audit_signing.nickname=xxx tps._008=# operations.allowedTransitions: tps._009=# - token operations, like formatting and enrollment have transitions between the following states -tps._010=# UNINITIALIZED = 0, +tps._010=# READY = 0, tps._011=# DAMAGED = 1, tps._012=# PERM_LOST = 2, tps._013=# SUSPENDED = 3, diff --git a/base/tps/shared/conf/token-states.properties b/base/tps/shared/conf/token-states.properties index 3c7e7d6da..e6366286f 100644 --- a/base/tps/shared/conf/token-states.properties +++ b/base/tps/shared/conf/token-states.properties @@ -1,5 +1,5 @@ # Token states -UNINITIALIZED = Uninitialized +READY = Uninitialized/ready ACTIVE = Active SUSPENDED = Temporarily lost/suspended PERM_LOST = Permanently lost @@ -8,14 +8,14 @@ TEMP_LOST_PERM_LOST = Temporarily lost then permanently lost TERMINATED = Terminated # Token state transitions -UNINITIALIZED.DAMAGED = This token has been physically damaged. -UNINITIALIZED.PERM_LOST = This token has been permanently lost. -UNINITIALIZED.SUSPENDED = This token has been temporarily lost/suspended. -UNINITIALIZED.TERMINATED = This token has been terminated. +READY.DAMAGED = This token has been physically damaged. +READY.PERM_LOST = This token has been permanently lost. +READY.SUSPENDED = This token has been temporarily lost/suspended. +READY.TERMINATED = This token has been terminated. 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. +SUSPENDED.READY = 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.SUSPENDED = This token has been temporarily lost/suspended. diff --git a/base/tps/shared/webapps/tps/js/token.js b/base/tps/shared/webapps/tps/js/token.js index c81e2ccb8..2bcf9e11e 100644 --- a/base/tps/shared/webapps/tps/js/token.js +++ b/base/tps/shared/webapps/tps/js/token.js @@ -21,7 +21,7 @@ // TODO: load labels from server var TokenStatus = { - UNINITIALIZED : "Uninitialized", + READY : "Uninitialized/ready", ACTIVE : "Active", SUSPENDED : "Temporarily lost/suspended", PERM_LOST : "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 b0ffb7570..7e4a92be0 100644 --- a/base/tps/src/org/dogtagpki/server/tps/TPSSubsystem.java +++ b/base/tps/src/org/dogtagpki/server/tps/TPSSubsystem.java @@ -146,7 +146,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 SUSPENDED, token will be allowed transition to either - * UNINITIALIZED or ACTIVE depending on whether the token has certificates. + * READY or ACTIVE depending on whether the token has certificates. * * @param tokenRecord * @return A non-null collection of allowed next token states. @@ -163,9 +163,9 @@ public class TPSSubsystem implements IAuthority, ISubsystem { // check token certificates Collection<TPSCertRecord> certRecords = tdb.tdbGetCertRecordsByCUID(tokenRecord.getId()); - // if token has no certificates, allow token to become uninitialized again + // if token has no certificates, allow token to become ready again if (certRecords.isEmpty()) { - ns.add(TokenStatus.UNINITIALIZED); + ns.add(TokenStatus.READY); } else { // otherwise, allow token to become active again ns.add(TokenStatus.ACTIVE); diff --git a/base/tps/src/org/dogtagpki/server/tps/TPSTokendb.java b/base/tps/src/org/dogtagpki/server/tps/TPSTokendb.java index e69ce9359..4a4aa89d3 100644 --- a/base/tps/src/org/dogtagpki/server/tps/TPSTokendb.java +++ b/base/tps/src/org/dogtagpki/server/tps/TPSTokendb.java @@ -186,7 +186,7 @@ public class TPSTokendb { } catch (Exception e) { CMS.debug("TPSTokendb.tdbUpdateTokenEntry: token entry not found; Adding"); // add and exit - tdbAddTokenEntry(tokenRecord, "uninitialized"); + tdbAddTokenEntry(tokenRecord, "ready"); return; } // token found; modify 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 80fd30eb8..e8b0c5d9f 100644 --- a/base/tps/src/org/dogtagpki/server/tps/dbs/TokenRecord.java +++ b/base/tps/src/org/dogtagpki/server/tps/dbs/TokenRecord.java @@ -242,8 +242,8 @@ public class TokenRecord extends DBRecord { public TokenStatus getTokenStatus() { String status = getStatus(); - if ("uninitialized".equals(status)) { - return TokenStatus.UNINITIALIZED; + if ("ready".equals(status)) { + return TokenStatus.READY; } else if ("active".equals(status)) { return TokenStatus.ACTIVE; diff --git a/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java b/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java index 19df79f53..4e8c8abfb 100644 --- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java +++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java @@ -319,7 +319,7 @@ public class TPSEnrollProcessor extends TPSProcessor { } } else { CMS.debug(method + " token does not exist"); - tokenRecord.setStatus("uninitialized"); + tokenRecord.setStatus("ready"); checkAllowUnknownToken(TPSEngine.OP_FORMAT_PREFIX); } @@ -368,7 +368,7 @@ public class TPSEnrollProcessor extends TPSProcessor { if (!isTokenPresent) { try { - tps.tdb.tdbAddTokenEntry(tokenRecord, "uninitialized"); + tps.tdb.tdbAddTokenEntry(tokenRecord, "ready"); } catch (Exception e) { String failMsg = "add token failure"; logMsg = failMsg + ":" + e.toString(); @@ -1031,7 +1031,7 @@ public class TPSEnrollProcessor extends TPSProcessor { //same token logMsg = "found current token entry"; CMS.debug(method + ":" + logMsg); - if (tokenRecord.getStatus().equals("uninitialized")) { + if (tokenRecord.getStatus().equals("ready")) { // this is the current token if (tokenRecords.size() == 1) { // the current token is the only token owned by the user diff --git a/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java b/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java index 01cde7608..0a0b10d46 100644 --- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java +++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java @@ -2055,8 +2055,8 @@ public class TPSProcessor { if (isTokenPresent) { CMS.debug("TPSProcessor.format: token exists"); - TokenStatus newState = TokenStatus.UNINITIALIZED; - // Check for transition to 0/UNINITIALIZED status. + TokenStatus newState = TokenStatus.READY; + // Check for transition to 0/READY status. if (!tps.engine.isOperationTransitionAllowed(tokenRecord.getTokenStatus(), newState)) { String info = " illegal transition attempted: " + tokenRecord.getTokenStatus() + @@ -2151,7 +2151,7 @@ public class TPSProcessor { } // Update Token DB - tokenRecord.setStatus("uninitialized"); + tokenRecord.setStatus("ready"); try { tps.tdb.tdbUpdateTokenEntry(tokenRecord); } catch (Exception e) { 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 cc68c8ad3..441518e8b 100644 --- a/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java +++ b/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java @@ -91,9 +91,9 @@ public class TokenService extends PKIService implements TokenResource { auditModParams.put("UserID", tokenRecord.getUserID()); switch (tokenState.getValue()) { - case TokenStatus.TOKEN_UNINITIALIZED: - tokenRecord.setStatus("uninitialized"); - newStatus = "uninitialized"; + case TokenStatus.TOKEN_READY: + tokenRecord.setStatus("ready"); + newStatus = "ready"; tokenRecord.setReason(null); break; @@ -377,9 +377,9 @@ public class TokenService extends PKIService implements TokenResource { auditModParams.put("Policy", policy); } - // new tokens are uninitialized when created - tokenRecord.setStatus("uninitialized"); - auditModParams.put("Status", "uninitialized"); + // new tokens are ready when created + tokenRecord.setStatus("ready"); + auditModParams.put("Status", "ready"); database.addRecord(tokenID, tokenRecord); subsystem.tdb.tdbActivity(ActivityDatabase.OP_ADD, tokenRecord, |