jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpfis...@apache.org
Subject svn commit: r964794 - in /jackrabbit/sandbox/jackrabbit-journalwalker: pom.xml src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java
Date Fri, 16 Jul 2010 13:17:21 GMT
Author: dpfister
Date: Fri Jul 16 13:17:21 2010
New Revision: 964794

URL: http://svn.apache.org/viewvc?rev=964794&view=rev
Log:
Update to JCR API 2.0

Modified:
    jackrabbit/sandbox/jackrabbit-journalwalker/pom.xml
    jackrabbit/sandbox/jackrabbit-journalwalker/src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java

Modified: jackrabbit/sandbox/jackrabbit-journalwalker/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-journalwalker/pom.xml?rev=964794&r1=964793&r2=964794&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-journalwalker/pom.xml (original)
+++ jackrabbit/sandbox/jackrabbit-journalwalker/pom.xml Fri Jul 16 13:17:21 2010
@@ -26,11 +26,11 @@
   <groupId>org.apache.jackrabbit</groupId>
   <parent>
     <groupId>org.apache.jackrabbit</groupId>
-    <artifactId>jackrabbit</artifactId>
-    <version>2.0-SNAPSHOT</version>
+    <artifactId>jackrabbit-parent</artifactId>
+    <version>2.0.0</version>
   </parent>
   <artifactId>jackrabbit-journalwalker</artifactId>
-  <version>2.0-SNAPSHOT</version>
+  <version>2.0.0</version>
   <packaging>jar</packaging>
   <name>Jackrabbit Journal Walker</name>
   <description>Jackrabbit Journal Walker</description>
@@ -38,7 +38,7 @@
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>
       <artifactId>jackrabbit-core</artifactId>
-      <version>2.0-SNAPSHOT</version>
+      <version>2.0.0</version>
     </dependency>
     <dependency>
       <groupId>javax.jcr</groupId>
@@ -62,43 +62,5 @@
   </dependencies>
   <build>
     <defaultGoal>package</defaultGoal>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <configuration>
-          <archive>
-            <index>true</index>
-            <manifest>
-              <addClasspath>true</addClasspath>
-              <classpathPrefix>lib</classpathPrefix>
-            </manifest>
-            <manifestEntries>
-              <Main-Class>
-                org.apache.jackrabbit.journalwalker.JournalWalker
-              </Main-Class>
-            </manifestEntries>
-          </archive>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-dependency-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>copy-dependencies</id>
-            <phase>compile</phase>
-            <goals>
-              <goal>copy-dependencies</goal>
-            </goals>
-          </execution>
-        </executions>
-        <configuration>
-          <outputDirectory>
-            ${project.build.directory}/classes/lib
-          </outputDirectory>
-        </configuration>
-      </plugin>
-    </plugins>
   </build>
 </project>

Modified: jackrabbit/sandbox/jackrabbit-journalwalker/src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-journalwalker/src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java?rev=964794&r1=964793&r2=964794&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-journalwalker/src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java
(original)
+++ jackrabbit/sandbox/jackrabbit-journalwalker/src/main/java/org/apache/jackrabbit/journalwalker/JournalWalker.java
Fri Jul 16 13:17:21 2010
@@ -39,7 +39,6 @@ import org.apache.jackrabbit.core.journa
 import org.apache.jackrabbit.core.journal.JournalException;
 import org.apache.jackrabbit.core.journal.Record;
 import org.apache.jackrabbit.core.journal.RecordConsumer;
-import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
 import org.apache.jackrabbit.core.observation.EventState;
 import org.apache.jackrabbit.core.state.ChangeLog;
 import org.apache.jackrabbit.core.state.ItemState;
@@ -48,12 +47,11 @@ import org.apache.jackrabbit.core.id.Nod
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.QNodeTypeDefinition;
 import org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
 import org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Walks over file journal records, showing their contents in a human readable
@@ -68,11 +66,6 @@ public class JournalWalker implements Re
     private static final String DEFAULT_PRODUCER = "JR";
 
     /**
-     * Logger.
-     */
-    private static Logger log = LoggerFactory.getLogger(JournalWalker.class);
-
-    /**
      * Record deserializer.
      */
     private ClusterRecordDeserializer deserializer = new ClusterRecordDeserializer();
@@ -105,7 +98,7 @@ public class JournalWalker implements Re
     /**
      * Id to Path translations.
      */
-    private Map pathMap = new HashMap();
+    private Map<NodeId,String> pathMap = new HashMap<NodeId,String>();
 
     /**
      * Create a new instance of this class.
@@ -191,7 +184,8 @@ public class JournalWalker implements Re
             deserializer.deserialize(record).process(this);
         } catch (JournalException e) {
             String msg = "Unable to read revision '" + record.getRevision() + "'.";
-            log.error(msg, e);
+            System.err.println(msg);
+            e.printStackTrace(System.err);
 	    return;
         }
 
@@ -221,7 +215,7 @@ public class JournalWalker implements Re
     public void process(ChangeLogRecord record) {
         String userId = null;
 
-        Iterator iter = record.getEvents().iterator();
+        Iterator<EventState> iter = record.getEvents().iterator();
         while (iter.hasNext()) {
             EventState event = (EventState) iter.next();
             eventGenerated(event.getType(), event.getParentId(),
@@ -249,7 +243,7 @@ public class JournalWalker implements Re
      * {@inheritDoc}
      */
     public void process(LockRecord record) {
-        log(record.isLock() ? 'L' : 'l', record.getUserId(),
+        log(record.isLock() ? 'L' : 'l', record.getOwner(),
                 record.getWorkspace(), record.getNodeId());
     }
 
@@ -279,6 +273,7 @@ public class JournalWalker implements Re
     /**
      * {@inheritDoc}
      */
+    @SuppressWarnings({"rawtypes"})
     public void process(NodeTypeRecord record) {
         Iterator iter;
 
@@ -287,7 +282,7 @@ public class JournalWalker implements Re
         case NodeTypeRecord.REREGISTER:
             iter = record.getCollection().iterator();
             while (iter.hasNext()) {
-                NodeTypeDef ntd = (NodeTypeDef) iter.next();
+                QNodeTypeDefinition ntd = (QNodeTypeDefinition) iter.next();
                 StringBuffer buf = new StringBuffer();
                 buf.append("R    ");
                 buf.append(nameToString(ntd.getName()));
@@ -342,7 +337,7 @@ public class JournalWalker implements Re
      */
     private void eventGenerated(int type, NodeId parentId, Path parentPath,
                                 NodeId childId, Path.Element childRelPath,
-                                Name ntName, Set mixins, String userId) {
+                                Name ntName, Set<Name> mixins, String userId) {
 
         if (!pathMap.containsKey(parentId)) {
             pathMap.put(parentId, pathToString(parentPath));



Mime
View raw message