jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r454433 [2/2] - in /jackrabbit/trunk/contrib/sanitycheck: ./ src/ src/java/ src/java/org/ src/java/org/apache/ src/java/org/apache/jackrabbit/ src/java/org/apache/jackrabbit/sanitycheck/ src/java/org/apache/jackrabbit/sanitycheck/check/ src...
Date Mon, 09 Oct 2006 17:25:53 GMT
Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/PropertyEntryInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/PropertyEntryInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/PropertyEntryInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/PropertyEntryInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency;
+
+import org.apache.jackrabbit.core.QName;
+
+/**
+ * Inconsistency in a property entry  
+ */
+public interface PropertyEntryInconsistency extends NodeInconsistency
+{
+    QName getPropertyEntry() ;
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/PropertyEntryInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/PropertyInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/PropertyInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/PropertyInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/PropertyInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency;
+
+import org.apache.jackrabbit.core.state.PropertyState;
+
+
+/**
+ * Inconsistency in a Property
+ */
+public interface PropertyInconsistency extends NodeInconsistency
+{
+    public PropertyState getProperty() ;
+
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/PropertyInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/ValueInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/ValueInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/ValueInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/ValueInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency;
+
+/**
+ * Inconsistency in a Value
+ */
+public interface ValueInconsistency extends PropertyInconsistency
+{
+    public int getIndex() ;
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/ValueInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractChildNodeInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractChildNodeInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractChildNodeInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractChildNodeInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.jackrabbit.sanitycheck.inconsistency.ChildNodeEntryInconsistency;
+
+/**
+ * Inconsistency in the child node
+ */
+public abstract class AbstractChildNodeInconsistency extends AbstractNodeInconsistency
+        implements ChildNodeEntryInconsistency
+{
+    /** Unexistent child */
+    private String child;
+
+    public String getChild()
+    {
+        return child;
+    }
+    public void setChild(String child)
+    {
+        this.child = child;
+    }
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractChildNodeInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractChildPropertyInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractChildPropertyInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractChildPropertyInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractChildPropertyInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.jackrabbit.core.QName;
+import org.apache.jackrabbit.sanitycheck.inconsistency.PropertyEntryInconsistency;
+
+/**
+ * Property entry pointing to a non existent property
+ */
+public abstract class AbstractChildPropertyInconsistency extends AbstractNodeInconsistency
+        implements PropertyEntryInconsistency
+{
+
+    /** Property name */
+    private QName propertyEntry;
+
+    public QName getPropertyEntry()
+    {
+        return propertyEntry;
+    }
+
+    public void setPropertyEntry(QName propertyEntry)
+    {
+        this.propertyEntry = propertyEntry;
+    }
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractChildPropertyInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractNodeInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractNodeInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractNodeInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractNodeInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.jackrabbit.core.state.NodeState;
+import org.apache.jackrabbit.core.state.PersistenceManager;
+import org.apache.jackrabbit.sanitycheck.inconsistency.NodeInconsistency;
+
+/**
+ * Superclass for all Inconsistency implementors.
+ */
+public abstract class AbstractNodeInconsistency implements NodeInconsistency
+{
+    /** Node */
+    protected NodeState node;
+
+    /** Persistence Manager */
+    protected PersistenceManager persistenceManager;
+
+    /** Persistence Manager name */
+    protected String persistenceManagerName;
+
+    public PersistenceManager getPersistenceManager()
+    {
+        return persistenceManager;
+    }
+
+    public void setPersistenceManager(PersistenceManager persistenceManager)
+    {
+        this.persistenceManager = persistenceManager;
+    }
+
+    public NodeState getNode()
+    {
+        return node;
+    }
+
+    public void setNode(NodeState target)
+    {
+        this.node = target;
+    }
+
+    public String getPersistenceManagerName()
+    {
+        return persistenceManagerName;
+    }
+
+    public void setPersistenceManagerName(String persistenceManagerName)
+    {
+        this.persistenceManagerName = persistenceManagerName;
+    }
+    
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractNodeInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractPropertyInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractPropertyInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractPropertyInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractPropertyInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.jackrabbit.core.QName;
+import org.apache.jackrabbit.core.state.PropertyState;
+import org.apache.jackrabbit.sanitycheck.inconsistency.PropertyEntryInconsistency;
+import org.apache.jackrabbit.sanitycheck.inconsistency.PropertyInconsistency;
+
+/**
+ * Inconsistency in a PropertyState
+ */
+public abstract class AbstractPropertyInconsistency extends
+        AbstractNodeInconsistency implements PropertyInconsistency , PropertyEntryInconsistency
+{
+
+    /**
+     * property
+     */
+    private PropertyState property;
+
+    public PropertyState getProperty()
+    {
+        return property;
+    }
+
+    public void setProperty(PropertyState property)
+    {
+        this.property = property;
+    }
+
+    public QName getPropertyEntry()
+    {
+        return getProperty().getName() ;
+    }
+    
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractPropertyInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractValueInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractValueInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractValueInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractValueInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.jackrabbit.sanitycheck.inconsistency.ValueInconsistency;
+
+
+/**
+ * Inconsistency in a Property value. 
+ */
+public abstract class AbstractValueInconsistency extends
+        AbstractPropertyInconsistency implements ValueInconsistency
+{
+
+    private int index = 0;
+
+    public int getIndex()
+    {
+        return index;
+    }
+
+    public void setIndex(int index)
+    {
+        this.index = index;
+    }
+ 
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/AbstractValueInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchChildInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchChildInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchChildInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchChildInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.jackrabbit.core.state.NodeState;
+
+/**
+ * <p>
+ * No such child inconsistency.
+ * </p>
+ */
+public class NoSuchChildInconsistency extends AbstractChildNodeInconsistency
+{
+    /**
+     * @inheritDoc
+     */
+    public String getDescription()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append("The node ");
+        sb.append(((NodeState) node).getUUID());
+        sb.append(" contains a non-existent child (");
+        sb.append(this.getChild());
+        sb.append(").");
+        return sb.toString();
+    }
+
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchChildInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchParentInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchParentInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchParentInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchParentInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.core.state.NodeState;
+import org.apache.jackrabbit.sanitycheck.inconsistency.ParentEntryInconsistency;
+
+/**
+ * <p>
+ * No such parent inconsistency.
+ * </p>
+ */
+public class NoSuchParentInconsistency extends AbstractNodeInconsistency
+        implements ParentEntryInconsistency
+{
+    private Log log = LogFactory.getLog(NoSuchParentInconsistency.class);
+
+    private String parentUUID;
+
+    /**
+     * @inheritDoc
+     */
+    public String getDescription()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append("The node ");
+        sb.append(((NodeState) node).getUUID());
+        sb.append(" contains a non-existent parent (");
+        sb.append(this.parentUUID);
+        sb.append(").");
+        return sb.toString();
+    }
+
+    public String getParentUUID()
+    {
+        return parentUUID;
+    }
+
+    public void setParentUUID(String parentUUID)
+    {
+        this.parentUUID = parentUUID;
+    }
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchParentInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchPropertyInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchPropertyInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchPropertyInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchPropertyInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.jackrabbit.core.state.NodeState;
+
+/**
+ * Property entry pointing to a non existent property
+ */
+public class NoSuchPropertyInconsistency extends AbstractChildPropertyInconsistency
+{
+
+    public String getDescription()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append("The node ");
+        sb.append(((NodeState) node).getUUID());
+        sb.append(" contains an non existent property: ");
+        sb.append(this.getPropertyEntry().toString());
+        sb.append(".");
+        return sb.toString();
+    }
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchPropertyInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchReferencedNodeInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchReferencedNodeInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchReferencedNodeInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchReferencedNodeInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.jackrabbit.core.util.uuid.UUID;
+
+/**
+ * Reference property pointing to a node 
+ * which doesn't exist in the workspace
+ */
+public class NoSuchReferencedNodeInconsistency extends
+        AbstractValueInconsistency 
+{
+
+    /**
+     * @inheritDoc
+     */
+    public String getDescription()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append("The node ");
+        sb.append(getProperty().getParentUUID());
+        sb.append(" contains a property of type REFERENCE that points to a non existent node
(");
+        UUID uuid = (UUID) getProperty().getValues()[getIndex()].internalValue();
+        sb.append(uuid.toString());
+        sb.append("): ");
+        sb.append(getProperty().getName().toString());
+        sb.append("[");
+        sb.append(getIndex());
+        sb.append("].");
+        return sb.toString();
+    }
+
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NoSuchReferencedNodeInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NotReferenceableInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NotReferenceableInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NotReferenceableInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NotReferenceableInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.jackrabbit.core.state.NodeState;
+import org.apache.jackrabbit.core.util.uuid.UUID;
+
+/**
+ * Reference to a node which is not referenceable
+ */
+public class NotReferenceableInconsistency extends
+        AbstractValueInconsistency 
+{
+    private NodeState referencedNode;
+
+    /**
+     * @inheritDoc
+     */
+    public String getDescription()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append("The node ");
+        sb.append(getProperty().getParentUUID());
+        sb.append(" contains a property of type REFERENCE that points to non referenceable
node (");
+        UUID uuid = (UUID) getProperty().getValues()[getIndex()].internalValue();
+        sb.append(uuid.toString());
+        sb.append("): ");
+        sb.append(getProperty().getName().toString());
+        sb.append("[");
+        sb.append(getIndex());
+        sb.append("].");
+        return sb.toString();
+    }
+
+    public NodeState getReferencedNode()
+    {
+        return referencedNode;
+    }
+
+    public void setReferencedNode(NodeState referencedNode)
+    {
+        this.referencedNode = referencedNode;
+    }
+
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/NotReferenceableInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/UnableToReadNodeInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/UnableToReadNodeInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/UnableToReadNodeInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/UnableToReadNodeInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+
+/**
+ * Unable to read a node.
+ */
+public class UnableToReadNodeInconsistency extends AbstractChildNodeInconsistency
+{
+
+    /**
+     * @inheritDoc
+     */
+    public String getDescription()
+    {
+        StringBuffer sb = new StringBuffer() ;
+        sb.append("Unable to read node ");
+        sb.append(this.getChild());
+        sb.append(", child of ") ;
+        sb.append(this.node.getUUID()) ;
+        return sb.toString();
+    }
+
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/UnableToReadNodeInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/UnableToReadPropertyInconsistency.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/UnableToReadPropertyInconsistency.java?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/UnableToReadPropertyInconsistency.java
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/UnableToReadPropertyInconsistency.java
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.sanitycheck.inconsistency.impl;
+
+import org.apache.jackrabbit.core.state.NodeState;
+
+/**
+ * Unable to read a child property
+ */
+public class UnableToReadPropertyInconsistency extends AbstractChildPropertyInconsistency
+{
+
+    public String getDescription()
+    {
+        StringBuffer sb = new StringBuffer();
+        sb.append("The node ");
+        sb.append(((NodeState) node).getUUID());
+        sb.append(" contains a property (");
+        sb.append(this.getPropertyEntry().toString());
+        sb.append(") which can not be read .");
+        return sb.toString();
+    }
+}

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/UnableToReadPropertyInconsistency.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/package.html
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/package.html?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/package.html
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/package.html
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,3 @@
+<body>
+	This package contains Inconsistency implementors.
+</body>
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/impl/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/package.html
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/package.html?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/package.html
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/package.html
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,3 @@
+<body>
+	This package contains Inconsistency interfaces.
+</body>
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/inconsistency/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/package.html
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/package.html?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/package.html
(added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/package.html
Mon Oct  9 10:25:51 2006
@@ -0,0 +1,36 @@
+<!--
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */	
+-->
+<body>
+	<p>
+	This package provides:
+	<ul>
+		<li>Consistency checks</li>
+		<li>Inconsistency repair</li>
+	</ul>
+	Custom checks and fixes can be added trough 
+	a simple commons-chain configuration file
+	(see sanity-check-chain.xml).
+	</p>
+	<p> 
+		In order to be sure that all the check were performed against every 
+		node in the repository keep running the tool until no inconsistency is 
+		found. Some inconsistencies prevent the tool of checking the entire 
+		repository. 
+	</p>
+</body>
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/org/apache/jackrabbit/sanitycheck/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: jackrabbit/trunk/contrib/sanitycheck/src/java/sanity-check-chain.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/sanitycheck/src/java/sanity-check-chain.xml?view=auto&rev=454433
==============================================================================
--- jackrabbit/trunk/contrib/sanitycheck/src/java/sanity-check-chain.xml (added)
+++ jackrabbit/trunk/contrib/sanitycheck/src/java/sanity-check-chain.xml Mon Oct  9 10:25:51
2006
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chains>
+  <!-- Checks -->
+  <catalog name="sanitycheck">
+	  <!-- Chain of checks to run against the versioning PM -->
+	  <chain name="versioning">
+		  <command 
+			name="CheckTree"
+			className="org.apache.jackrabbit.sanitycheck.check.CheckTree"/>
+		  <command 
+			name="CheckParentsExist"
+			className="org.apache.jackrabbit.sanitycheck.check.CheckParentsExist"/>
+	  </chain>
+	  
+	  <!-- Chain of checks to run against every workspace PM -->
+	  <chain name="workspace">
+		  <command 
+			name="CheckTree"
+			className="org.apache.jackrabbit.sanitycheck.check.CheckTree"/>
+		  <command 
+			name="CheckReferenceProperty"
+			className="org.apache.jackrabbit.sanitycheck.check.CheckReferenceProperty"/>
+		  <command 
+			name="CheckParentsExist"
+			className="org.apache.jackrabbit.sanitycheck.check.CheckParentsExist"/>
+	  </chain>
+	  
+  </catalog>  
+  
+  <!-- 
+	/ Fixes
+	/ name=Class name of the Inconsistency
+	/ className= Fix implementor
+	-->  
+  <catalog name="fixes">
+	
+	  <command 
+		name="org.apache.jackrabbit.sanitycheck.inconsistency.impl.NoSuchChildInconsistency"
+		className="org.apache.jackrabbit.sanitycheck.fix.RemoveChildNodeEntry"/>
+
+	  <command 
+		name="org.apache.jackrabbit.sanitycheck.inconsistency.impl.UnableToReadNodeInconsistency"
+		className="org.apache.jackrabbit.sanitycheck.fix.RemoveChildNodeEntry"/>
+
+	  <command 
+		name="org.apache.jackrabbit.sanitycheck.inconsistency.impl.NoSuchPropertyInconsistency"
+		className="org.apache.jackrabbit.sanitycheck.fix.RemovePropertyEntry"/>
+
+	  <command 
+		name="org.apache.jackrabbit.sanitycheck.inconsistency.impl.UnableToReadPropertyInconsistency"
+		className="org.apache.jackrabbit.sanitycheck.fix.RemovePropertyEntry"/>
+
+	  <chain name="org.apache.jackrabbit.sanitycheck.inconsistency.impl.NoSuchReferencedNodeInconsistency">
+		<!-- Remove the value (only single value property) -->
+		  <command 
+			name="removeValueIfSingleProperty"
+			className="org.apache.jackrabbit.sanitycheck.fix.RemoveValue"/>
+		<!-- Remove the property (multivalued property) -->
+		  <chain name="removePropertyEntryAndProperty">
+			  <!-- 
+				the completed attribute tells the Fix 
+				that it must delegate the process to 
+				the next command in the chain
+				-->
+			  <command 
+				name="removePropertyEntry"
+				className="org.apache.jackrabbit.sanitycheck.fix.RemovePropertyEntry"
+				completed="false" />
+			  <command 
+				name="removeProperty"
+				className="org.apache.jackrabbit.sanitycheck.fix.RemoveProperty"/>
+		  </chain>
+	  </chain>	
+
+	  <chain name="org.apache.jackrabbit.sanitycheck.inconsistency.impl.NotReferenceableInconsistency">
+		<!-- Remove the value (only single value property) -->
+		  <command 
+			name="removeValueIfSingleProperty"
+			className="org.apache.jackrabbit.sanitycheck.fix.RemoveValue"/>
+		<!-- Remove the property (multivalued property) -->
+		  <chain name="removePropertyEntryAndProperty">
+			  <command 
+				name="removePropertyEntry"
+				className="org.apache.jackrabbit.sanitycheck.fix.RemovePropertyEntry"
+				completed="false" />
+			  <command 
+				name="removeProperty"
+				className="org.apache.jackrabbit.sanitycheck.fix.RemoveProperty"/>
+		  </chain>
+	  </chain>	
+
+	  <command 
+		name="org.apache.jackrabbit.sanitycheck.inconsistency.impl.NoSuchParentInconsistency"
+		className="org.apache.jackrabbit.sanitycheck.fix.RemoveParentEntry"/>
+
+  </catalog>    
+  
+</chains>
\ No newline at end of file

Propchange: jackrabbit/trunk/contrib/sanitycheck/src/java/sanity-check-chain.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message