>From 3cefee221c859be90d39f9a4c16024cb02fe9a8d Mon Sep 17 00:00:00 2001
From: Ade Lee <alee@redhat.com>
Date: Tue, 28 Jan 2014 12:02:38 -0500
Subject: [PATCH 186/187] Rename KeyDataInfos and KeyrequestInfos

---
 base/common/src/com/netscape/certsrv/key/KeyClient.java    |  4 ++--
 .../key/{KeyDataInfos.java => KeyDataInfoCollection.java}  |  2 +-
 ...{KeyRequestInfos.java => KeyRequestInfoCollection.java} | 14 +++++++-------
 .../src/com/netscape/certsrv/key/KeyRequestResource.java   |  2 +-
 base/common/src/com/netscape/certsrv/key/KeyResource.java  |  2 +-
 base/common/src/com/netscape/certsrv/kra/KRAClient.java    |  8 ++++----
 .../src/com/netscape/cmstools/key/KeyFindCLI.java          |  4 ++--
 .../src/com/netscape/cmstools/key/KeyRequestFindCLI.java   |  4 ++--
 .../src/com/netscape/cms/servlet/key/KeyRequestDAO.java    |  6 +++---
 .../cms/src/com/netscape/cms/servlet/key/KeyService.java   |  6 +++---
 .../netscape/cms/servlet/request/KeyRequestService.java    |  6 +++---
 11 files changed, 29 insertions(+), 29 deletions(-)
 rename base/common/src/com/netscape/certsrv/key/{KeyDataInfos.java => KeyDataInfoCollection.java} (94%)
 rename base/common/src/com/netscape/certsrv/key/{KeyRequestInfos.java => KeyRequestInfoCollection.java} (85%)

diff --git a/base/common/src/com/netscape/certsrv/key/KeyClient.java b/base/common/src/com/netscape/certsrv/key/KeyClient.java
index 272f8ca04f3c2c39854bc2b577534f6cef049763..81519509e3b66dbbca21a720d4e34a2a2a71235c 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyClient.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyClient.java
@@ -41,7 +41,7 @@ public class KeyClient extends Client {
         keyRequestClient = createProxy(KeyRequestResource.class);
     }
 
-    public KeyDataInfos findKeys(String clientID, String status, Integer maxSize, Integer maxTime,
+    public KeyDataInfoCollection findKeys(String clientID, String status, Integer maxSize, Integer maxTime,
             Integer start, Integer size) {
         return keyClient.listKeys(clientID, status, maxSize, maxTime, start, size);
     }
@@ -50,7 +50,7 @@ public class KeyClient extends Client {
         return keyClient.retrieveKey(data);
     }
 
-    public KeyRequestInfos findKeyRequests(
+    public KeyRequestInfoCollection findKeyRequests(
             String requestState,
             String requestType,
             String clientID,
diff --git a/base/common/src/com/netscape/certsrv/key/KeyDataInfos.java b/base/common/src/com/netscape/certsrv/key/KeyDataInfoCollection.java
similarity index 94%
rename from base/common/src/com/netscape/certsrv/key/KeyDataInfos.java
rename to base/common/src/com/netscape/certsrv/key/KeyDataInfoCollection.java
index 8f02348a52319ab7b9fe439afe4778286947211f..4e67e2a44a4a0ec139e4779e62c681e7c3df72d6 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyDataInfos.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyDataInfoCollection.java
@@ -25,7 +25,7 @@ import javax.xml.bind.annotation.XmlRootElement;
 import com.netscape.certsrv.base.DataCollection;
 
 @XmlRootElement(name = "KeyDataInfos")
-public class KeyDataInfos extends DataCollection<KeyDataInfo> {
+public class KeyDataInfoCollection extends DataCollection<KeyDataInfo> {
 
     @XmlElementRef
     public Collection<KeyDataInfo> getEntries() {
diff --git a/base/common/src/com/netscape/certsrv/key/KeyRequestInfos.java b/base/common/src/com/netscape/certsrv/key/KeyRequestInfoCollection.java
similarity index 85%
rename from base/common/src/com/netscape/certsrv/key/KeyRequestInfos.java
rename to base/common/src/com/netscape/certsrv/key/KeyRequestInfoCollection.java
index 403dc7d41375535241abf913f5cfc1eabf92633f..5f4d2ab87f1cf8bedc6dc6ecb22cdebccb7946f6 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyRequestInfos.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyRequestInfoCollection.java
@@ -34,7 +34,7 @@ import com.netscape.certsrv.base.DataCollection;
 import com.netscape.certsrv.request.RequestStatus;
 
 @XmlRootElement(name = "KeyRequestInfos")
-public class KeyRequestInfos extends DataCollection<KeyRequestInfo> {
+public class KeyRequestInfoCollection extends DataCollection<KeyRequestInfo> {
 
     @XmlElementRef
     public Collection<KeyRequestInfo> getEntries() {
@@ -63,7 +63,7 @@ public class KeyRequestInfos extends DataCollection<KeyRequestInfo> {
     public String toString() {
         try {
             StringWriter sw = new StringWriter();
-            Marshaller marshaller = JAXBContext.newInstance(KeyRequestInfos.class).createMarshaller();
+            Marshaller marshaller = JAXBContext.newInstance(KeyRequestInfoCollection.class).createMarshaller();
             marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
             marshaller.marshal(this, sw);
             return sw.toString();
@@ -73,10 +73,10 @@ public class KeyRequestInfos extends DataCollection<KeyRequestInfo> {
         }
     }
 
-    public static KeyRequestInfos valueOf(String string) throws Exception {
+    public static KeyRequestInfoCollection valueOf(String string) throws Exception {
         try {
-            Unmarshaller unmarshaller = JAXBContext.newInstance(KeyRequestInfos.class).createUnmarshaller();
-            return (KeyRequestInfos)unmarshaller.unmarshal(new StringReader(string));
+            Unmarshaller unmarshaller = JAXBContext.newInstance(KeyRequestInfoCollection.class).createUnmarshaller();
+            return (KeyRequestInfoCollection)unmarshaller.unmarshal(new StringReader(string));
         } catch (Exception e) {
             return null;
         }
@@ -84,7 +84,7 @@ public class KeyRequestInfos extends DataCollection<KeyRequestInfo> {
 
     public static void main(String args[]) throws Exception {
 
-        KeyRequestInfos before = new KeyRequestInfos();
+        KeyRequestInfoCollection before = new KeyRequestInfoCollection();
 
         KeyRequestInfo request = new KeyRequestInfo();
         request.setRequestType("securityDataEnrollment");
@@ -94,7 +94,7 @@ public class KeyRequestInfos extends DataCollection<KeyRequestInfo> {
         String string = before.toString();
         System.out.println(string);
 
-        KeyRequestInfos after = KeyRequestInfos.valueOf(string);
+        KeyRequestInfoCollection after = KeyRequestInfoCollection.valueOf(string);
         System.out.println(after);
 
         System.out.println(before.equals(after));
diff --git a/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java b/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java
index 17e8a67e59db958864e52f2bf4b1914be1aa236d..3f2536100c43267be0a216d4fe7356d4d8c50dd9 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyRequestResource.java
@@ -37,7 +37,7 @@ public interface KeyRequestResource {
      */
     @GET
     @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-    public KeyRequestInfos listRequests(@QueryParam("requestState") String requestState,
+    public KeyRequestInfoCollection listRequests(@QueryParam("requestState") String requestState,
                                             @QueryParam("requestType") String requestType,
                                             @QueryParam("clientID") String clientID,
                                             @QueryParam("start") RequestId start,
diff --git a/base/common/src/com/netscape/certsrv/key/KeyResource.java b/base/common/src/com/netscape/certsrv/key/KeyResource.java
index c420e0d45087e1bfc08f8914f431278ef516e03b..68efb77703c86ef8dd48cbe8f252411d2f39b560 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyResource.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyResource.java
@@ -20,7 +20,7 @@ public interface KeyResource {
 
     @GET
     @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-    public KeyDataInfos listKeys(@QueryParam("clientID") String clientID,
+    public KeyDataInfoCollection listKeys(@QueryParam("clientID") String clientID,
                                  @QueryParam("status") String status,
                                  @QueryParam("maxResults") Integer maxResults,
                                  @QueryParam("maxTime") Integer maxTime,
diff --git a/base/common/src/com/netscape/certsrv/kra/KRAClient.java b/base/common/src/com/netscape/certsrv/kra/KRAClient.java
index 48e918a581c62eeb57bef48050407f3baf5049ac..6ff7ea23ec2fba1fcd7f204f671103cb8573cca1 100644
--- a/base/common/src/com/netscape/certsrv/kra/KRAClient.java
+++ b/base/common/src/com/netscape/certsrv/kra/KRAClient.java
@@ -14,10 +14,10 @@ import com.netscape.certsrv.group.GroupClient;
 import com.netscape.certsrv.key.KeyArchivalRequest;
 import com.netscape.certsrv.key.KeyData;
 import com.netscape.certsrv.key.KeyDataInfo;
-import com.netscape.certsrv.key.KeyDataInfos;
+import com.netscape.certsrv.key.KeyDataInfoCollection;
 import com.netscape.certsrv.key.KeyRecoveryRequest;
 import com.netscape.certsrv.key.KeyRequestInfo;
-import com.netscape.certsrv.key.KeyRequestInfos;
+import com.netscape.certsrv.key.KeyRequestInfoCollection;
 import com.netscape.certsrv.key.KeyRequestResource;
 import com.netscape.certsrv.key.KeyResource;
 import com.netscape.certsrv.logging.AuditClient;
@@ -60,7 +60,7 @@ public class KRAClient extends SubsystemClient {
     }
 
     public Collection<KeyRequestInfo> listRequests(String requestState, String requestType) {
-        KeyRequestInfos infos = keyRequestClient.listRequests(
+        KeyRequestInfoCollection infos = keyRequestClient.listRequests(
                 requestState, requestType, null, new RequestId(0), 100, 100, 10
                 );
         Collection<KeyRequestInfo> list = infos.getEntries();
@@ -83,7 +83,7 @@ public class KRAClient extends SubsystemClient {
     }
 
     public KeyDataInfo getKeyData(String clientId, String status) {
-        KeyDataInfos infos = keyClient.listKeys(clientId, status, null, null, null, null);
+        KeyDataInfoCollection infos = keyClient.listKeys(clientId, status, null, null, null, null);
         Collection<KeyDataInfo> list = infos.getEntries();
         Iterator<KeyDataInfo> iter = list.iterator();
 
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
index c5c54e7f90005d416142128ae36b11c627ce6ae2..b2eb0ce387c4706fe0ebe294fba8d581e09c2e13 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
@@ -25,7 +25,7 @@ import org.apache.commons.cli.Option;
 import org.apache.commons.cli.ParseException;
 
 import com.netscape.certsrv.key.KeyDataInfo;
-import com.netscape.certsrv.key.KeyDataInfos;
+import com.netscape.certsrv.key.KeyDataInfoCollection;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -97,7 +97,7 @@ public class KeyFindCLI extends CLI {
         s = cmd.getOptionValue("size");
         Integer size = s == null ? null : Integer.valueOf(s);
 
-        KeyDataInfos keys = keyCLI.keyClient.findKeys(clientID, status, maxResults, maxTime, start, size);
+        KeyDataInfoCollection keys = keyCLI.keyClient.findKeys(clientID, status, maxResults, maxTime, start, size);
 
         Collection<KeyDataInfo> entries = keys.getEntries();
 
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
index 5ed2bf72954e2f7ec0f9a6b6c950dbe57103d86c..4714aae31744d5750f7492332f62e911f6e1aee0 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyRequestFindCLI.java
@@ -25,7 +25,7 @@ import org.apache.commons.cli.Option;
 import org.apache.commons.cli.ParseException;
 
 import com.netscape.certsrv.key.KeyRequestInfo;
-import com.netscape.certsrv.key.KeyRequestInfos;
+import com.netscape.certsrv.key.KeyRequestInfoCollection;
 import com.netscape.certsrv.request.RequestId;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -103,7 +103,7 @@ public class KeyRequestFindCLI extends CLI {
         s = cmd.getOptionValue("maxTime");
         Integer maxTime = s == null ? null : Integer.valueOf(s);
 
-        KeyRequestInfos keys = keyCLI.keyClient.findKeyRequests(
+        KeyRequestInfoCollection keys = keyCLI.keyClient.findKeyRequests(
                 status, type, clientID, start, pageSize, maxResults, maxTime);
 
         MainCLI.printMessage(keys.getTotal() + " entries matched");
diff --git a/base/server/cms/src/com/netscape/cms/servlet/key/KeyRequestDAO.java b/base/server/cms/src/com/netscape/cms/servlet/key/KeyRequestDAO.java
index a67bff7546d4c072f62ac799c225eaef9ec7db38..be166c001f8f23db461d045deecb7c811d616965 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/key/KeyRequestDAO.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/key/KeyRequestDAO.java
@@ -38,7 +38,7 @@ import com.netscape.certsrv.dbs.keydb.KeyId;
 import com.netscape.certsrv.key.KeyArchivalRequest;
 import com.netscape.certsrv.key.KeyRecoveryRequest;
 import com.netscape.certsrv.key.KeyRequestInfo;
-import com.netscape.certsrv.key.KeyRequestInfos;
+import com.netscape.certsrv.key.KeyRequestInfoCollection;
 import com.netscape.certsrv.key.KeyRequestResource;
 import com.netscape.certsrv.key.KeyResource;
 import com.netscape.certsrv.key.SymKeyGenerationRequest;
@@ -86,10 +86,10 @@ public class KeyRequestDAO extends CMSRequestDAO {
      * @throws EBaseException
      */
     @SuppressWarnings("unchecked")
-    public KeyRequestInfos listRequests(String filter, RequestId start, int pageSize, int maxResults, int maxTime,
+    public KeyRequestInfoCollection listRequests(String filter, RequestId start, int pageSize, int maxResults, int maxTime,
             UriInfo uriInfo) throws EBaseException {
 
-        KeyRequestInfos ret = new KeyRequestInfos();
+        KeyRequestInfoCollection ret = new KeyRequestInfoCollection();
 
         CMSRequestInfos cmsInfos = listCMSRequests(filter, start, pageSize, maxResults, maxTime, uriInfo);
 
diff --git a/base/server/cms/src/com/netscape/cms/servlet/key/KeyService.java b/base/server/cms/src/com/netscape/cms/servlet/key/KeyService.java
index a2e48b9ec75cdda949449e52e1bd8202ad3d1bb9..fdcd7d7c51b21e004f95326eeb9bf1ec7cca76e9 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/key/KeyService.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/key/KeyService.java
@@ -48,7 +48,7 @@ import com.netscape.certsrv.dbs.keydb.IKeyRepository;
 import com.netscape.certsrv.dbs.keydb.KeyId;
 import com.netscape.certsrv.key.KeyData;
 import com.netscape.certsrv.key.KeyDataInfo;
-import com.netscape.certsrv.key.KeyDataInfos;
+import com.netscape.certsrv.key.KeyDataInfoCollection;
 import com.netscape.certsrv.key.KeyRecoveryRequest;
 import com.netscape.certsrv.key.KeyRequestInfo;
 import com.netscape.certsrv.key.KeyResource;
@@ -312,7 +312,7 @@ public class KeyService extends PKIService implements KeyResource {
      * Used to generate list of key infos based on the search parameters
      */
     @Override
-    public KeyDataInfos listKeys(String clientID, String status, Integer maxResults, Integer maxTime,
+    public KeyDataInfoCollection listKeys(String clientID, String status, Integer maxResults, Integer maxTime,
             Integer start, Integer size) {
 
         start = start == null ? 0 : start;
@@ -325,7 +325,7 @@ public class KeyService extends PKIService implements KeyResource {
         maxResults = maxResults == null ? DEFAULT_MAXRESULTS : maxResults;
         maxTime = maxTime == null ? DEFAULT_MAXTIME : maxTime;
 
-        KeyDataInfos infos = new KeyDataInfos();
+        KeyDataInfoCollection infos = new KeyDataInfoCollection();
         try {
             Enumeration<IKeyRecord> e = repo.searchKeys(filter, maxResults, maxTime);
             if (e == null) {
diff --git a/base/server/cms/src/com/netscape/cms/servlet/request/KeyRequestService.java b/base/server/cms/src/com/netscape/cms/servlet/request/KeyRequestService.java
index a0731d5dc35f44d13cad8db3f27406e201b38b51..6cad363ca1a7c38b51569dd93c08f5947cacb9fa 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/request/KeyRequestService.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/request/KeyRequestService.java
@@ -43,7 +43,7 @@ import com.netscape.certsrv.key.KeyArchivalRequest;
 import com.netscape.certsrv.key.KeyRecoveryRequest;
 import com.netscape.certsrv.key.KeyRequest;
 import com.netscape.certsrv.key.KeyRequestInfo;
-import com.netscape.certsrv.key.KeyRequestInfos;
+import com.netscape.certsrv.key.KeyRequestInfoCollection;
 import com.netscape.certsrv.key.KeyRequestResource;
 import com.netscape.certsrv.key.SymKeyGenerationRequest;
 import com.netscape.certsrv.kra.IKeyRecoveryAuthority;
@@ -278,7 +278,7 @@ public class KeyRequestService extends PKIService implements KeyRequestResource
      * Used to generate list of key requests based on the search parameters
      */
     @Override
-    public KeyRequestInfos listRequests(String requestState, String requestType, String clientID,
+    public KeyRequestInfoCollection listRequests(String requestState, String requestType, String clientID,
             RequestId start, Integer pageSize, Integer maxResults, Integer maxTime) {
         // auth and authz
 
@@ -292,7 +292,7 @@ public class KeyRequestService extends PKIService implements KeyRequestResource
         maxTime = maxTime == null ? DEFAULT_MAXTIME : maxTime;
 
         KeyRequestDAO reqDAO = new KeyRequestDAO();
-        KeyRequestInfos requests;
+        KeyRequestInfoCollection requests;
         try {
             requests = reqDAO.listRequests(filter, start, pageSize, maxResults, maxTime, uriInfo);
         } catch (EBaseException e) {
-- 
1.8.4.2

