1 18 19 package sync4j.framework.engine; 20 21 import sync4j.framework.engine.SyncOperation; 22 import sync4j.framework.engine.source.SyncSource; 23 24 import org.apache.commons.lang.builder.ToStringBuilder; 25 26 34 public class SyncOperationStatus { 35 36 38 41 private SyncOperation operation; 42 43 47 public SyncOperation getOperation() { 48 return operation; 49 } 50 51 54 private SyncSource syncSource; 55 56 60 public SyncSource getSyncSource() { 61 return syncSource; 62 } 63 64 67 private int statusCode; 68 69 74 public int getStatusCode() { 75 return statusCode; 76 } 77 78 79 81 90 public SyncOperationStatus( SyncOperation operation , 91 SyncSource syncSource , 92 int statusCode ) { 93 if (operation == null) { 94 throw new IllegalArgumentException ("operation cannnot be null"); 95 } 96 if (syncSource == null) { 97 throw new IllegalArgumentException ("syncSource cannnot be null"); 98 } 99 100 this.operation = operation ; 101 this.syncSource = syncSource; 102 this.statusCode = statusCode; 103 } 104 105 113 public SyncOperationStatus( SyncOperation operation , 114 SyncSource syncSource ) { 115 this(operation, syncSource, -1); 116 } 117 118 120 public String toString() { 121 return new ToStringBuilder(this). 122 append("operation", operation.toString() ). 123 append("syncSource", syncSource.toString()). 124 append("statusCode", statusCode). 125 toString(); 126 } 127 128 } | Popular Tags |