directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smckin...@apache.org
Subject directory-fortress-core git commit: FC-109 - move to tutils
Date Tue, 02 Jun 2015 19:31:34 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/1.0-RC41 4e66ed1b3 -> 5b8951c48


FC-109 - move to tutils


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/5b8951c4
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/5b8951c4
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/5b8951c4

Branch: refs/heads/1.0-RC41
Commit: 5b8951c48717d6f4de776ac15f502c44a5db7674
Parents: 4e66ed1
Author: Shawn McKinney <smckinney@apache.org>
Authored: Tue Jun 2 14:31:42 2015 -0500
Committer: Shawn McKinney <smckinney@apache.org>
Committed: Tue Jun 2 14:31:42 2015 -0500

----------------------------------------------------------------------
 .../directory/fortress/core/impl/AuditDAO.java  | 17 +++++-----
 .../fortress/core/util/attr/AttrHelper.java     | 33 ------------------
 .../fortress/core/util/time/TUtil.java          | 35 +++++++++++++++++++-
 .../fortress/core/AuditMgrConsole.java          |  7 ++--
 4 files changed, 47 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/5b8951c4/src/main/java/org/apache/directory/fortress/core/impl/AuditDAO.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/AuditDAO.java b/src/main/java/org/apache/directory/fortress/core/impl/AuditDAO.java
index e5c2aea..e6233c7 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/AuditDAO.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/AuditDAO.java
@@ -36,6 +36,7 @@ import org.apache.directory.fortress.core.model.Bind;
 import org.apache.directory.fortress.core.model.Mod;
 import org.apache.directory.fortress.core.model.UserAudit;
 import org.apache.directory.fortress.core.util.attr.AttrHelper;
+import org.apache.directory.fortress.core.util.time.TUtil;
 import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.fortress.core.FinderException;
 import org.apache.directory.fortress.core.GlobalErrIds;
@@ -261,7 +262,7 @@ final class AuditDAO extends ApacheDsDataProvider
 
             if ( audit.getBeginDate() != null )
             {
-                String szTime = AttrHelper.encodeGeneralizedTime( audit.getBeginDate() );
+                String szTime = TUtil.encodeGeneralizedTime( audit.getBeginDate() );
                 filter += "(" + REQEND + ">=" + szTime + ")";
             }
 
@@ -332,7 +333,7 @@ final class AuditDAO extends ApacheDsDataProvider
 
             if ( audit.getBeginDate() != null )
             {
-                String szTime = AttrHelper.encodeGeneralizedTime( audit.getBeginDate() );
+                String szTime = TUtil.encodeGeneralizedTime( audit.getBeginDate() );
                 filter += "(" + REQEND + ">=" + szTime + ")";
             }
 
@@ -422,7 +423,7 @@ final class AuditDAO extends ApacheDsDataProvider
 
             if ( audit.getBeginDate() != null )
             {
-                String szTime = AttrHelper.encodeGeneralizedTime( audit.getBeginDate() );
+                String szTime = TUtil.encodeGeneralizedTime( audit.getBeginDate() );
                 filter += "(" + REQEND + ">=" + szTime + ")";
             }
 
@@ -487,7 +488,7 @@ final class AuditDAO extends ApacheDsDataProvider
 
                 if ( audit.getBeginDate() != null )
                 {
-                    String szTime = AttrHelper.encodeGeneralizedTime( audit.getBeginDate()
);
+                    String szTime = TUtil.encodeGeneralizedTime( audit.getBeginDate() );
                     filter += "(" + REQEND + ">=" + szTime + ")";
                 }
 
@@ -504,7 +505,7 @@ final class AuditDAO extends ApacheDsDataProvider
 
                 if ( audit.getBeginDate() != null )
                 {
-                    String szTime = AttrHelper.encodeGeneralizedTime( audit.getBeginDate()
);
+                    String szTime = TUtil.encodeGeneralizedTime( audit.getBeginDate() );
                     filter += "(" + REQEND + ">=" + szTime + ")";
                 }
 
@@ -562,7 +563,7 @@ final class AuditDAO extends ApacheDsDataProvider
 
             if ( audit.getBeginDate() != null )
             {
-                String szTime = AttrHelper.encodeGeneralizedTime( audit.getBeginDate() );
+                String szTime = TUtil.encodeGeneralizedTime( audit.getBeginDate() );
                 filter += "(" + REQEND + ">=" + szTime + ")";
             }
 
@@ -646,13 +647,13 @@ final class AuditDAO extends ApacheDsDataProvider
 
             if ( audit.getBeginDate() != null )
             {
-                String szTime = AttrHelper.encodeGeneralizedTime( audit.getBeginDate() );
+                String szTime = TUtil.encodeGeneralizedTime( audit.getBeginDate() );
                 filter += "(" + REQEND + ">=" + szTime + ")";
             }
 
             if ( audit.getEndDate() != null )
             {
-                String szTime = AttrHelper.encodeGeneralizedTime( audit.getEndDate() );
+                String szTime = TUtil.encodeGeneralizedTime( audit.getEndDate() );
                 filter += "(" + REQEND + "<=" + szTime + ")";
             }
 

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/5b8951c4/src/main/java/org/apache/directory/fortress/core/util/attr/AttrHelper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/util/attr/AttrHelper.java b/src/main/java/org/apache/directory/fortress/core/util/attr/AttrHelper.java
index e306f92..1fe6024 100755
--- a/src/main/java/org/apache/directory/fortress/core/util/attr/AttrHelper.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/attr/AttrHelper.java
@@ -22,15 +22,12 @@ package org.apache.directory.fortress.core.util.attr;
 import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.name.Rdn;
-import org.apache.directory.api.util.DateUtils;
 import org.apache.directory.fortress.core.GlobalIds;
 import org.apache.directory.fortress.core.model.Administrator;
 import org.apache.directory.fortress.core.model.AuthZ;
 import org.apache.directory.fortress.core.model.Permission;
 import org.apache.directory.fortress.core.util.ObjUtil;
 
-import java.text.ParseException;
-import java.util.Date;
 import java.util.List;
 import java.util.StringTokenizer;
 import java.util.Properties;
@@ -231,34 +228,4 @@ public final class AttrHelper
         }
         return pOp;
     }
-
-
-    /**
-     * Convert from raw ldap generalized time format to {@link java.util.Date}.
-     * to decode the string.
-     *
-     * @param inputString containing raw ldap generalized time formatted string.
-     * @return converted to {@link java.util.Date}.
-     */
-    public static Date decodeGeneralizedTime(String inputString) throws ParseException
-    {
-        Date aDate = null;
-        aDate = DateUtils.getDate( inputString );
-        return aDate;
-    }
-
-
-    /**
-     * Convert from java date {@link java.util.Date} format to raw ldap generalized time
format.
-     * to encode the string.
-     *
-     * @param date reference to standard java date.
-     * @return converted to standardized ldap generalized time format.
-     */
-    public static String encodeGeneralizedTime(Date date)
-    {
-        String szTime = null;
-        szTime = DateUtils.getGeneralizedTime( date );
-        return szTime;
-    }
 }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/5b8951c4/src/main/java/org/apache/directory/fortress/core/util/time/TUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/util/time/TUtil.java b/src/main/java/org/apache/directory/fortress/core/util/time/TUtil.java
index ee631d4..9565ae4 100755
--- a/src/main/java/org/apache/directory/fortress/core/util/time/TUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/util/time/TUtil.java
@@ -20,7 +20,10 @@
 package org.apache.directory.fortress.core.util.time;
 
 
-import java.util.GregorianCalendar;
+import org.apache.directory.api.util.DateUtils;
+
+import java.text.ParseException;
+import java.util.*;
 
 
 /**
@@ -83,4 +86,34 @@ public final class TUtil
         time.date = szYear + szMonth + szDay;
         return time;
     }
+
+
+    /**
+     * Convert from raw ldap generalized time format to {@link java.util.Date}.
+     * to decode the string.
+     *
+     * @param inputString containing raw ldap generalized time formatted string.
+     * @return converted to {@link java.util.Date}.
+     */
+    public static java.util.Date decodeGeneralizedTime(String inputString) throws ParseException
+    {
+        java.util.Date aDate = null;
+        aDate = DateUtils.getDate( inputString );
+        return aDate;
+    }
+
+
+    /**
+     * Convert from java date {@link java.util.Date} format to raw ldap generalized time
format.
+     * to encode the string.
+     *
+     * @param date reference to standard java date.
+     * @return converted to standardized ldap generalized time format.
+     */
+    public static String encodeGeneralizedTime(java.util.Date date)
+    {
+        String szTime = null;
+        szTime = DateUtils.getGeneralizedTime( date );
+        return szTime;
+    }
 }

http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/5b8951c4/src/test/java/org/apache/directory/fortress/core/AuditMgrConsole.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/directory/fortress/core/AuditMgrConsole.java b/src/test/java/org/apache/directory/fortress/core/AuditMgrConsole.java
index 57665b3..dad2473 100755
--- a/src/test/java/org/apache/directory/fortress/core/AuditMgrConsole.java
+++ b/src/test/java/org/apache/directory/fortress/core/AuditMgrConsole.java
@@ -28,6 +28,7 @@ import org.apache.directory.fortress.core.impl.TestUtils;
 import org.apache.directory.fortress.core.model.UserAudit;
 import org.apache.directory.fortress.core.model.Permission;
 import org.apache.directory.fortress.core.util.attr.AttrHelper;
+import org.apache.directory.fortress.core.util.time.TUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import java.text.ParseException;
@@ -159,7 +160,7 @@ class AuditMgrConsole
                 Date aDate = null;
                 try
                 {
-                    aDate = AttrHelper.decodeGeneralizedTime(aBind.getReqEnd());
+                    aDate = TUtil.decodeGeneralizedTime( aBind.getReqEnd() );
                 }
                 catch (ParseException pe)
                 {
@@ -436,7 +437,7 @@ class AuditMgrConsole
                 Date aDate = null;
                 try
                 {
-                    aDate = AttrHelper.decodeGeneralizedTime(authZ.getReqEnd());
+                    aDate = TUtil.decodeGeneralizedTime(authZ.getReqEnd());
                 }
                 catch (ParseException pe)
                 {
@@ -528,7 +529,7 @@ class AuditMgrConsole
                 Date aDate = null;
                 try
                 {
-                    aDate = AttrHelper.decodeGeneralizedTime(authZ.getReqEnd());
+                    aDate = TUtil.decodeGeneralizedTime(authZ.getReqEnd());
                 }
                 catch (ParseException pe)
                 {


Mime
View raw message