summaryrefslogtreecommitdiffstats
path: root/base/java-tools/src/com
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2016-02-03 19:20:31 +0100
committerEndi S. Dewata <edewata@redhat.com>2016-02-05 22:40:44 +0100
commit9bd94a0a54793a0720b803846ce2291e5064c2ae (patch)
tree0e0d5731923844454c23fc89e7a10b5abb708a58 /base/java-tools/src/com
parent987dda15acdd6e6f4c7c477fed122a76ad40260c (diff)
downloadpki-9bd94a0a54793a0720b803846ce2291e5064c2ae.tar.gz
pki-9bd94a0a54793a0720b803846ce2291e5064c2ae.tar.xz
pki-9bd94a0a54793a0720b803846ce2291e5064c2ae.zip
Added resource bundle for token state labels.
The labels for token states and the transitions are now stored in token-states.properties. The default file will be stored in the /usr/share/pki/tps/conf, but it can be overriden by copying and customizing the file into <instance>/tps/conf. When the UI retrieves the token data the labels for the current state and the valid transitions will be loaded from the file and returned to the UI. The UI will show the transition labels in the dropdown list for changing token status. https://fedorahosted.org/pki/ticket/1289 https://fedorahosted.org/pki/ticket/1291
Diffstat (limited to 'base/java-tools/src/com')
-rw-r--r--base/java-tools/src/com/netscape/cmstools/tps/token/TokenCLI.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenCLI.java
index 328490a49..77ca40bd1 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/token/TokenCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/token/TokenCLI.java
@@ -18,11 +18,16 @@
package com.netscape.cmstools.tps.token;
+import java.util.ArrayList;
+import java.util.Collection;
+
import org.apache.commons.lang.StringUtils;
import org.jboss.resteasy.plugins.providers.atom.Link;
import com.netscape.certsrv.tps.token.TokenClient;
import com.netscape.certsrv.tps.token.TokenData;
+import com.netscape.certsrv.tps.token.TokenData.TokenStatusData;
+import com.netscape.certsrv.tps.token.TokenStatus;
import com.netscape.cmstools.cli.CLI;
/**
@@ -54,8 +59,19 @@ public class TokenCLI extends CLI {
System.out.println(" Token ID: " + token.getID());
if (token.getUserID() != null) System.out.println(" User ID: " + token.getUserID());
if (token.getType() != null) System.out.println(" Type: " + token.getType());
- if (token.getStatus() != null) System.out.println(" Status: " + token.getStatus());
- if (token.getNextStates() != null) System.out.println(" Next States: " + StringUtils.join(token.getNextStates(), ", "));
+
+ TokenStatusData status = token.getStatus();
+ if (status != null) System.out.println(" Status: " + status.name);
+
+ Collection<TokenStatusData> nextStates = token.getNextStates();
+ if (nextStates != null) {
+ Collection<TokenStatus> names = new ArrayList<TokenStatus>();
+ for (TokenStatusData nextState : nextStates) {
+ names.add(nextState.name);
+ }
+ System.out.println(" Next States: " + StringUtils.join(names, ", "));
+ }
+
if (token.getAppletID() != null) System.out.println(" Applet ID: " + token.getAppletID());
if (token.getKeyInfo() != null) System.out.println(" Key Info: " + token.getKeyInfo());
if (token.getPolicy() != null) System.out.println(" Policy: " + token.getPolicy());