Some constants in RollingLogFile have been replaced with their equivalents in Constants class.

Pushed to master under trivial rule.

--
Endi S. Dewata
>From 8d60caa44803915c153e1919ccaf08b166d38190 Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edew...@redhat.com>
Date: Wed, 29 Mar 2017 03:36:39 +0200
Subject: [PATCH] Removed duplicate PROP_ROLLOVER_INTERVAL constant.

Change-Id: I66b369ec33f97dab96f6d832e2eb9ab0c6cdbe98
---
 .../src/com/netscape/cms/logging/RollingLogFile.java   | 18 +++++++++---------
 .../netscape/cms/servlet/admin/LogAdminServlet.java    |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java b/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java
index 32568dac053b6ff2bc2e5d11983fc6ba55db552e..d84c441702592884f774f721b1a18a3f1c0390fe 100644
--- a/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java
+++ b/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java
@@ -32,6 +32,7 @@ import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.base.IConfigStore;
 import com.netscape.certsrv.base.IExtendedPluginInfo;
+import com.netscape.certsrv.common.Constants;
 import com.netscape.certsrv.common.NameValuePairs;
 import com.netscape.certsrv.logging.ConsoleError;
 import com.netscape.certsrv.logging.ELogException;
@@ -49,7 +50,6 @@ import com.netscape.cmsutil.util.Utils;
  */
 public class RollingLogFile extends LogFile {
     public static final String PROP_MAX_FILE_SIZE = "maxFileSize";
-    public static final String PROP_ROLLOVER_INTERVAL = "rolloverInterval";
     public static final String PROP_EXPIRATION_TIME = "expirationTime";
 
     /**
@@ -116,7 +116,7 @@ public class RollingLogFile extends LogFile {
         super.init(config);
 
         rl_init(config.getInteger(PROP_MAX_FILE_SIZE, MAX_FILE_SIZE),
-                config.getString(PROP_ROLLOVER_INTERVAL, ROLLOVER_INTERVAL),
+                config.getString(Constants.PR_LOG_ROLLEROVER_INTERVAL, ROLLOVER_INTERVAL),
                 config.getString(PROP_EXPIRATION_TIME, EXPIRATION_TIME));
     }
 
@@ -585,7 +585,7 @@ public class RollingLogFile extends LogFile {
         Vector<String> v = super.getDefaultParams();
 
         v.addElement(PROP_MAX_FILE_SIZE + "=");
-        v.addElement(PROP_ROLLOVER_INTERVAL + "=");
+        v.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL + "=");
         //v.addElement(PROP_EXPIRATION_TIME + "=");
         return v;
     }
@@ -596,15 +596,15 @@ public class RollingLogFile extends LogFile {
         try {
             v.addElement(PROP_MAX_FILE_SIZE + "=" + mMaxFileSize / 1024);
             if (mRolloverInterval / 1000 <= 60 * 60)
-                v.addElement(PROP_ROLLOVER_INTERVAL + "=" + "Hourly");
+                v.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL + "=" + "Hourly");
             else if (mRolloverInterval / 1000 <= 60 * 60 * 24)
-                v.addElement(PROP_ROLLOVER_INTERVAL + "=" + "Daily");
+                v.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL + "=" + "Daily");
             else if (mRolloverInterval / 1000 <= 60 * 60 * 24 * 7)
-                v.addElement(PROP_ROLLOVER_INTERVAL + "=" + "Weekly");
+                v.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL + "=" + "Weekly");
             else if (mRolloverInterval / 1000 <= 60 * 60 * 24 * 30)
-                v.addElement(PROP_ROLLOVER_INTERVAL + "=" + "Monthly");
+                v.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL + "=" + "Monthly");
             else if (mRolloverInterval / 1000 <= 60 * 60 * 24 * 366)
-                v.addElement(PROP_ROLLOVER_INTERVAL + "=" + "Yearly");
+                v.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL + "=" + "Yearly");
 
             //v.addElement(PROP_EXPIRATION_TIME + "=" + mExpirationTime / 1000);
         } catch (Exception e) {
@@ -622,7 +622,7 @@ public class RollingLogFile extends LogFile {
         }
         info.addElement(PROP_MAX_FILE_SIZE
                 + ";integer;If the current log file size if bigger than this parameter in kilobytes(KB), the file will be rotated.");
-        info.addElement(PROP_ROLLOVER_INTERVAL
+        info.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL
                 + ";choice(Hourly,Daily,Weekly,Monthly,Yearly);The frequency of the log being rotated.");
         info.addElement(PROP_EXPIRATION_TIME
                 + ";integer;The amount of time before a backed up log is removed in seconds");
diff --git a/base/server/cms/src/com/netscape/cms/servlet/admin/LogAdminServlet.java b/base/server/cms/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
index d665224212b1a9eb0f1f9689dad8154d99d350e4..08c329356b4e2a5b740c41ec29d98c7fb05535e1 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
@@ -1645,7 +1645,7 @@ public class LogAdminServlet extends AdminServlet {
 
                     }
 
-                    if (key.equals("rolloverInterval")) {
+                    if (key.equals(Constants.PR_LOG_ROLLEROVER_INTERVAL)) {
                         if (val.equals("Hourly"))
                             val = Integer.toString(60 * 60);
                         else if (val.equals("Daily"))
-- 
2.9.3

>From 939896c06013065a7566002a2708d4598d3d7b96 Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edew...@redhat.com>
Date: Thu, 30 Mar 2017 07:08:52 +0200
Subject: [PATCH] Removed duplicate PROP_MAX_FILE_SIZE constant.

Change-Id: Ic2aa92985e8aee9b5405ad542c640ca67a0047c6
---
 base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java b/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java
index d84c441702592884f774f721b1a18a3f1c0390fe..4d2971502a59c40eae7aaf50cc25b6321ca0396e 100644
--- a/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java
+++ b/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java
@@ -49,7 +49,6 @@ import com.netscape.cmsutil.util.Utils;
  * @version $Revision$, $Date$
  */
 public class RollingLogFile extends LogFile {
-    public static final String PROP_MAX_FILE_SIZE = "maxFileSize";
     public static final String PROP_EXPIRATION_TIME = "expirationTime";
 
     /**
@@ -115,7 +114,7 @@ public class RollingLogFile extends LogFile {
             EBaseException {
         super.init(config);
 
-        rl_init(config.getInteger(PROP_MAX_FILE_SIZE, MAX_FILE_SIZE),
+        rl_init(config.getInteger(Constants.PR_LOG_MAXFILESIZE, MAX_FILE_SIZE),
                 config.getString(Constants.PR_LOG_ROLLEROVER_INTERVAL, ROLLOVER_INTERVAL),
                 config.getString(PROP_EXPIRATION_TIME, EXPIRATION_TIME));
     }
@@ -584,7 +583,7 @@ public class RollingLogFile extends LogFile {
     public Vector<String> getDefaultParams() {
         Vector<String> v = super.getDefaultParams();
 
-        v.addElement(PROP_MAX_FILE_SIZE + "=");
+        v.addElement(Constants.PR_LOG_MAXFILESIZE + "=");
         v.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL + "=");
         //v.addElement(PROP_EXPIRATION_TIME + "=");
         return v;
@@ -594,7 +593,7 @@ public class RollingLogFile extends LogFile {
         Vector<String> v = super.getInstanceParams();
 
         try {
-            v.addElement(PROP_MAX_FILE_SIZE + "=" + mMaxFileSize / 1024);
+            v.addElement(Constants.PR_LOG_MAXFILESIZE + "=" + mMaxFileSize / 1024);
             if (mRolloverInterval / 1000 <= 60 * 60)
                 v.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL + "=" + "Hourly");
             else if (mRolloverInterval / 1000 <= 60 * 60 * 24)
@@ -620,7 +619,7 @@ public class RollingLogFile extends LogFile {
             if (!p[i].startsWith(IExtendedPluginInfo.HELP_TOKEN) && !p[i].startsWith(IExtendedPluginInfo.HELP_TEXT))
                 info.addElement(p[i]);
         }
-        info.addElement(PROP_MAX_FILE_SIZE
+        info.addElement(Constants.PR_LOG_MAXFILESIZE
                 + ";integer;If the current log file size if bigger than this parameter in kilobytes(KB), the file will be rotated.");
         info.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL
                 + ";choice(Hourly,Daily,Weekly,Monthly,Yearly);The frequency of the log being rotated.");
-- 
2.9.3

>From 01b510f51992e04ffc84aefdd2d3e1f09b09b480 Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edew...@redhat.com>
Date: Thu, 30 Mar 2017 22:57:19 +0200
Subject: [PATCH] Removed duplicate PROP_EXPIRATION_TIME constant.

Change-Id: Ife9108019994b385fc452da0f29dee64d0ccc5d3
---
 base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java   | 7 +++----
 .../cms/src/com/netscape/cms/servlet/admin/LogAdminServlet.java    | 6 +++---
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java b/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java
index 4d2971502a59c40eae7aaf50cc25b6321ca0396e..fb70f46c1b337187c70715017cb9aa9fb94ec63f 100644
--- a/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java
+++ b/base/server/cms/src/com/netscape/cms/logging/RollingLogFile.java
@@ -49,7 +49,6 @@ import com.netscape.cmsutil.util.Utils;
  * @version $Revision$, $Date$
  */
 public class RollingLogFile extends LogFile {
-    public static final String PROP_EXPIRATION_TIME = "expirationTime";
 
     /**
      * The default max file size in bytes
@@ -116,7 +115,7 @@ public class RollingLogFile extends LogFile {
 
         rl_init(config.getInteger(Constants.PR_LOG_MAXFILESIZE, MAX_FILE_SIZE),
                 config.getString(Constants.PR_LOG_ROLLEROVER_INTERVAL, ROLLOVER_INTERVAL),
-                config.getString(PROP_EXPIRATION_TIME, EXPIRATION_TIME));
+                config.getString(Constants.PR_LOG_EXPIRED_TIME, EXPIRATION_TIME));
     }
 
     /**
@@ -585,7 +584,7 @@ public class RollingLogFile extends LogFile {
 
         v.addElement(Constants.PR_LOG_MAXFILESIZE + "=");
         v.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL + "=");
-        //v.addElement(PROP_EXPIRATION_TIME + "=");
+        //v.addElement(Constants.PR_LOG_EXPIRED_TIME + "=");
         return v;
     }
 
@@ -623,7 +622,7 @@ public class RollingLogFile extends LogFile {
                 + ";integer;If the current log file size if bigger than this parameter in kilobytes(KB), the file will be rotated.");
         info.addElement(Constants.PR_LOG_ROLLEROVER_INTERVAL
                 + ";choice(Hourly,Daily,Weekly,Monthly,Yearly);The frequency of the log being rotated.");
-        info.addElement(PROP_EXPIRATION_TIME
+        info.addElement(Constants.PR_LOG_EXPIRED_TIME
                 + ";integer;The amount of time before a backed up log is removed in seconds");
         info.addElement(IExtendedPluginInfo.HELP_TOKEN +
                 //";configuration-logrules-rollinglogfile");
diff --git a/base/server/cms/src/com/netscape/cms/servlet/admin/LogAdminServlet.java b/base/server/cms/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
index 08c329356b4e2a5b740c41ec29d98c7fb05535e1..13ba52c15ecf4ece453eec6f029e35125f640875 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
@@ -834,7 +834,7 @@ public class LogAdminServlet extends AdminServlet {
             // files is no longer supported, it is still a required parameter
             // that must be present during the creation and modification of
             // custom log plugins.
-            substore.put("expirationTime", "0");
+            substore.put(Constants.PR_LOG_EXPIRED_TIME, "0");
 
             // Instantiate an object for this implementation
             String className = plugin.getClassPath();
@@ -1591,7 +1591,7 @@ public class LogAdminServlet extends AdminServlet {
             // files is no longer supported, it is still a required parameter
             // that must be present during the creation and modification of
             // custom log plugins.
-            substore.put("expirationTime", "0");
+            substore.put(Constants.PR_LOG_EXPIRED_TIME, "0");
 
             // IMPORTANT:  save a copy of the original log file path
             origLogPath = substore.getString(Constants.PR_LOG_FILENAME);
@@ -1702,7 +1702,7 @@ public class LogAdminServlet extends AdminServlet {
                             }
                         }
                         /*
-                                                if (key.equals("expirationTime")) {
+                                                if (key.equals(Constants.PR_LOG_EXPIRED_TIME)) {
                                                     String origVal = substore.getString(key);
 
                                                     val = val.trim();
-- 
2.9.3

_______________________________________________
Pki-devel mailing list
Pki-devel@redhat.com
https://www.redhat.com/mailman/listinfo/pki-devel

Reply via email to