directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1227677 - in /directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn: ReadOnlyTxn.java ReadWriteTxn.java
Date Thu, 05 Jan 2012 16:21:27 GMT
Author: elecharny
Date: Thu Jan  5 16:21:26 2012
New Revision: 1227677

URL: http://svn.apache.org/viewvc?rev=1227677&view=rev
Log:
Added toString() methods

Modified:
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ReadOnlyTxn.java
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ReadWriteTxn.java

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ReadOnlyTxn.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ReadOnlyTxn.java?rev=1227677&r1=1227676&r2=1227677&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ReadOnlyTxn.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ReadOnlyTxn.java
Thu Jan  5 16:21:26 2012
@@ -46,4 +46,31 @@ class ReadOnlyTxn extends AbstractTransa
     {
         return nbRef > 1;
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "ROTxn[" );
+
+        // The state
+        sb.append( "state:" ).append( getState() );
+
+        // The ref count
+        sb.append( ", ref:" ).append( nbRef );
+
+        // The start time
+        sb.append( ", start:" ).append( getStartTime() );
+
+        // The commit time
+        sb.append( ", commit:" ).append( getCommitTime() );
+
+        sb.append( "]\n" );
+
+        return sb.toString();
+    }
 }

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ReadWriteTxn.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ReadWriteTxn.java?rev=1227677&r1=1227676&r2=1227677&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ReadWriteTxn.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ReadWriteTxn.java
Thu Jan  5 16:21:26 2012
@@ -670,4 +670,44 @@ class ReadWriteTxn extends AbstractTrans
             }
         }
     }
+
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append( "RWTxn[" );
+
+        // The state
+        sb.append( "state:" ).append( getState() );
+
+        // The ref count
+        sb.append( ", nbRef:" ).append( getRefCount() );
+
+        // The start time
+        sb.append( ", start:" ).append( getStartTime() );
+
+        // The commit time
+        sb.append( ", commit:" ).append( getCommitTime() );
+
+        sb.append( "]\n" );
+        List<LogEdit> edits = getEdits();
+
+        if ( ( edits != null ) && ( edits.size() > 0 ) )
+        {
+            sb.append( "{\n" );
+
+            for ( LogEdit logEdit : edits )
+            {
+                sb.append( logEdit ).append( "\n" );
+            }
+
+            sb.append( "\n}" );
+        }
+
+        return sb.toString();
+    }
 }



Mime
View raw message