Checkpoint for AVMSyncService. Update (that's promote to use

preferred parlance or submit if you have a certain background) is
substantially working, passing a handful of basic tests. Compare
harmlessly returns no differences always, so Kev can program against
it if he's so inclined.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3785 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-09-14 00:28:16 +00:00
parent 7fd363c599
commit bf1fdd9cd6
5 changed files with 382 additions and 42 deletions

View File

@@ -32,6 +32,8 @@ public class AVMDifference implements Serializable
public static final int NEWER = 0;
public static final int OLDER = 1;
public static final int CONFLICT = 2;
public static final int DIRECTORY = 3;
public static final int SAME = 4;
/**
* Version number of the source node.
@@ -120,4 +122,13 @@ public class AVMDifference implements Serializable
{
return fDiffCode;
}
/**
* Check for improperly initialized instances.
* @return Whether source and destination are non null.
*/
public boolean isValid()
{
return fSourcePath != null && fDestPath != null;
}
}

View File

@@ -0,0 +1,70 @@
/*
* Copyright (C) 2006 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* 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.alfresco.service.cmr.avmsync;
import org.alfresco.error.AlfrescoRuntimeException;
/**
* Exception for tree to tree synchronization problems.
* @author britt
*/
public class AVMSyncException extends AlfrescoRuntimeException
{
private static final long serialVersionUID = 1075466935333921588L;
/**
* @param msgId
*/
public AVMSyncException(String msgId)
{
super(msgId);
// TODO Auto-generated constructor stub
}
/**
* @param msgId
* @param msgParams
*/
public AVMSyncException(String msgId, Object[] msgParams)
{
super(msgId, msgParams);
// TODO Auto-generated constructor stub
}
/**
* @param msgId
* @param cause
*/
public AVMSyncException(String msgId, Throwable cause)
{
super(msgId, cause);
// TODO Auto-generated constructor stub
}
/**
* @param msgId
* @param msgParams
* @param cause
*/
public AVMSyncException(String msgId, Object[] msgParams, Throwable cause)
{
super(msgId, msgParams, cause);
// TODO Auto-generated constructor stub
}
}

View File

@@ -45,14 +45,16 @@ public interface AVMSyncService
* will cause the transaction to roll back.
* @param diffList A List of AVMDifference structs.
* @param ignoreConflicts If this is true the update will skip those
* AVMDifferences which are in conflict or for which the source is older than
* AVMDifferences which are in conflict with
* the destination.
* @param ignoreOlder If this is true the update will skip those
* AVMDifferences which have the source older than the destination.
* @param overrideConflicts If this is true the update will override conflicting
* AVMDifferences and replace the destination with the conflicting source.
* @param overrideOlder If this is true the update will override AVMDifferences
* in which the source is older than the destination and overwrite the destination.
*/
public void update(List<AVMDifference> diffList, boolean ignoreConflicts,
public void update(List<AVMDifference> diffList, boolean ignoreConflicts, boolean ignoreOlder,
boolean overrideConflicts, boolean overrideOlder);
/**