001: package org.drools.scm.log;
002:
003: import java.util.ArrayList;
004: import java.util.Date;
005: import java.util.List;
006:
007: public class ScmLogEntry {
008: private String author;
009: private Date date;
010: private String message;
011: private List list;
012:
013: public ScmLogEntry(String author, Date date, String message) {
014: super ();
015: this .author = author;
016: this .date = date;
017: this .message = message;
018: this .list = new ArrayList();
019: }
020:
021: public String getAuthor() {
022: return author;
023: }
024:
025: public Date getDate() {
026: return date;
027: }
028:
029: public String getMessage() {
030: return message;
031: }
032:
033: public void addAction(ScmLogEntryItem item) {
034: this .list.add(item);
035: }
036:
037: public List getAction() {
038: return this .list;
039: }
040:
041: public static class Add implements ScmLogEntryItem {
042: private char actionType = 'A';
043: private char pathType;
044: private String path;
045: private long revision;
046:
047: public Add(char type, String path, long revision) {
048: super ();
049: this .pathType = type;
050: this .path = path;
051: this .revision = revision;
052: }
053:
054: public String getPath() {
055: return path;
056: }
057:
058: public long getRevision() {
059: return revision;
060: }
061:
062: public char getPathType() {
063: return pathType;
064: }
065:
066: public char getActionType() {
067: return this .actionType;
068: }
069: }
070:
071: public static class Delete implements ScmLogEntryItem {
072: private char actionType = 'D';
073: private char pathType;
074: private String path;
075: private long revision;
076:
077: public Delete(char type, String path, long revision) {
078: super ();
079: this .pathType = type;
080: this .path = path;
081: this .revision = revision;
082: }
083:
084: public String getPath() {
085: return path;
086: }
087:
088: public long getRevision() {
089: return revision;
090: }
091:
092: public char getPathType() {
093: return pathType;
094: }
095:
096: public char getActionType() {
097: return this .actionType;
098: }
099: }
100:
101: public static class Copy implements ScmLogEntryItem {
102: private char actionType = 'C';
103: private char pathType;
104: private String fromPath;
105: private long fromRevision;
106: private String toPath;
107: private long toRevision;
108:
109: public Copy(char type, String fromPath, long fromRevision,
110: String toPath, long toRevision) {
111: super ();
112: this .pathType = type;
113: this .fromPath = fromPath;
114: this .fromRevision = fromRevision;
115: this .toPath = toPath;
116: this .toRevision = toRevision;
117: }
118:
119: public String getFromPath() {
120: return fromPath;
121: }
122:
123: public long getFromRevision() {
124: return fromRevision;
125: }
126:
127: public String getToPath() {
128: return toPath;
129: }
130:
131: public long gettoRevision() {
132: return toRevision;
133: }
134:
135: public char getPathType() {
136: return pathType;
137: }
138:
139: public char getActionType() {
140: return this .actionType;
141: }
142:
143: }
144:
145: /**
146: *
147: * @author mproctor
148: *
149: */
150: public static class Update implements ScmLogEntryItem {
151: private char actionType = 'U';
152: private char pathType;
153: private String path;
154: private long revision;
155:
156: public Update(char type, String path, long revision) {
157: super ();
158: this .pathType = type;
159: this .path = path;
160: this .revision = revision;
161: }
162:
163: public String getPath() {
164: return path;
165: }
166:
167: public long getRevision() {
168: return revision;
169: }
170:
171: public char getPathType() {
172: return pathType;
173: }
174:
175: public char getActionType() {
176: return this .actionType;
177: }
178: }
179:
180: /**
181: * The Entry has been deleted and another of the same path added in the same transaction.
182: * @author mproctor
183: *
184: */
185: public static class Replaced implements ScmLogEntryItem {
186: private char actionType = 'R';
187: private char pathType;
188: private String path;
189: private long revision;
190:
191: public Replaced(char type, String path, long revision) {
192: super ();
193: this .pathType = type;
194: this .path = path;
195: this .revision = revision;
196: }
197:
198: public String getPath() {
199: return path;
200: }
201:
202: public long getRevision() {
203: return revision;
204: }
205:
206: public char getPathType() {
207: return pathType;
208: }
209:
210: public char getActionType() {
211: return this.actionType;
212: }
213: }
214:
215: }
|