01: /*
02: *
03: * Copyright (c) 2004 SourceTap - www.sourcetap.com
04: *
05: * The contents of this file are subject to the SourceTap Public License
06: * ("License"); You may not use this file except in compliance with the
07: * License. You may obtain a copy of the License at http://www.sourcetap.com/license.htm
08: * Software distributed under the License is distributed on an "AS IS" basis,
09: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
10: * the specific language governing rights and limitations under the License.
11: *
12: * The above copyright notice and this permission notice shall be included
13: * in all copies or substantial portions of the Software.
14: *
15: */
16:
17: package com.sourcetap.sfa.replication;
18:
19: import org.ofbiz.entity.GenericValue;
20:
21: /**
22: * This class is used for replication of the FileAttachment entity. <P>
23: *
24: * @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
25: */
26: public class FileAttachmentReplicator extends EntityReplicator {
27: public static final String module = FileAttachmentReplicator.class
28: .getName();
29:
30: /**
31: * This method replicates all instances for all related entities. <P>
32: *
33: * When completed, this method will override the ancestor to copy the
34: * file for the passed-in FileAttachment record from the master server
35: * to the local server.
36: *
37: * @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
38: *
39: * @param mainInstance Main entity instance for which related entities will be replicated
40: *
41: * @return Status. Possible values: STATUS_CONTINUE, STATUS_ERROR, STATUS_CANCELED
42: */
43: public int replicateAllRelated(GenericValue mainInstance) {
44:
45: // Need to insert code here to copy the file that goes with this
46: // FileAttachment record.
47: return STATUS_CONTINUE;
48: }
49:
50: /**
51: * This method removes all instances for all related entities. <P>
52: *
53: * When completed, this method will override the ancestor to remove the
54: * file for the passed-in FileAttachment record from the local server.
55: *
56: * @author <a href='mailto:jnutting@sourcetap.com'>John Nutting</a>
57: *
58: * @param localInstance Local entity from which related entity instances are to be removed
59: *
60: * @return Status. Possible values: STATUS_CONTINUE, STATUS_ERROR, STATUS_CANCELED
61: */
62: public int removeAllRelated(GenericValue localInstance) {
63:
64: // Need to insert code here to remove the file that goes with this
65: // FileAttachment record.
66: return STATUS_CONTINUE;
67: }
68: }
|