3
* ====================================================================
4
* Licensed to the Apache Software Foundation (ASF) under one
5
* or more contributor license agreements. See the NOTICE file
6
* distributed with this work for additional information
7
* regarding copyright ownership. The ASF licenses this file
8
* to you under the Apache License, Version 2.0 (the
9
* "License"); you may not use this file except in compliance
10
* with the License. You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* Unless required by applicable law or agreed to in writing,
15
* software distributed under the License is distributed on an
16
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17
* KIND, either express or implied. See the License for the
18
* specific language governing permissions and limitations
20
* ====================================================================
24
package org.apache.subversion.javahl;
27
import java.util.EventObject;
28
import org.apache.subversion.javahl.callback.ClientNotifyCallback;
29
import org.apache.subversion.javahl.types.*;
32
* The event passed to the {@link ClientNotifyCallback#onNotify}
33
* API to notify {@link ISVNClient} of relevant events.
35
public class ClientNotifyInformation extends EventObject
37
// Update the serialVersionUID when there is a incompatible change
38
// made to this class. See any of the following, depending upon
40
// http://java.sun.com/j2se/1.3/docs/guide/serialization/spec/version.doc7.html
41
// http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf
42
// http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/version.html#6678
43
// http://java.sun.com/javase/6/docs/platform/serialization/spec/version.html#6678
44
private static final long serialVersionUID = 1L;
47
* The {@link Action} which triggered this event.
49
private Action action;
52
* The {@link NodeKind} of the item.
54
private NodeKind kind;
57
* The MIME type of the item.
59
private String mimeType;
62
* Any lock for the item.
67
* Any error message for the item.
69
private String errMsg;
72
* The {@link Status} of the content of the item.
74
private Status contentState;
77
* The {@link Status} of the properties of the item.
79
private Status propState;
82
* The {@link LockStatus} of the lock of the item.
84
private LockStatus lockState;
87
* The revision of the item.
89
private long revision;
92
* The name of the changelist.
94
private String changelistName;
97
* The range of the merge just beginning to occur.
99
private RevisionRange mergeRange;
102
* A common absolute path prefix that can be subtracted from .path.
104
private String pathPrefix;
106
private String propName;
108
private Map<String, String> revProps;
112
long hunkOriginalStart;
114
long hunkOriginalLength;
116
long hunkModifiedStart;
118
long hunkModifiedLength;
120
long hunkMatchedLine;
125
* This constructor is to be used by the native code.
127
* @param path The path of the item, which is the source of the event.
128
* @param action The {@link Action} which triggered this event.
129
* @param kind The {@link NodeKind} of the item.
130
* @param mimeType The MIME type of the item.
131
* @param lock Any lock for the item.
132
* @param errMsg Any error message for the item.
133
* @param contentState The {@link Status} of the content of
135
* @param propState The {@link Status} of the properties of
137
* @param lockState The {@link LockStatus} of the lock of the item.
138
* @param revision The revision of the item.
139
* @param changelistName The name of the changelist.
140
* @param mergeRange The range of the merge just beginning to occur.
141
* @param pathPrefix A common path prefix.
143
public ClientNotifyInformation(String path, Action action, NodeKind kind,
144
String mimeType, Lock lock, String errMsg,
145
Status contentState, Status propState,
146
LockStatus lockState, long revision,
147
String changelistName, RevisionRange mergeRange,
148
String pathPrefix, String propName,
149
Map<String, String> revProps, long oldRevision,
150
long hunkOriginalStart, long hunkOriginalLength,
151
long hunkModifiedStart, long hunkModifiedLength,
152
long hunkMatchedLine, int hunkFuzz)
154
super(path == null ? "" : path);
155
this.action = action;
157
this.mimeType = mimeType;
159
this.errMsg = errMsg;
160
this.contentState = contentState;
161
this.propState = propState;
162
this.lockState = lockState;
163
this.revision = revision;
164
this.changelistName = changelistName;
165
this.mergeRange = mergeRange;
166
this.pathPrefix = pathPrefix;
167
this.propName = propName;
168
this.revProps = revProps;
169
this.oldRevision = oldRevision;
170
this.hunkOriginalStart = hunkOriginalStart;
171
this.hunkOriginalLength = hunkOriginalLength;
172
this.hunkModifiedStart = hunkModifiedStart;
173
this.hunkModifiedLength = hunkModifiedLength;
174
this.hunkMatchedLine = hunkMatchedLine;
175
this.hunkFuzz = hunkFuzz;
179
* @return The path of the item, which is the source of the event.
181
public String getPath()
183
return (String) super.source;
187
* @return The {@link Action} which triggered this event.
189
public Action getAction()
195
* @return The {@link NodeKind} of the item.
197
public NodeKind getKind()
203
* @return The MIME type of the item.
205
public String getMimeType()
211
* @return Any lock for the item.
213
public Lock getLock()
219
* @return Any error message for the item.
221
public String getErrMsg()
227
* @return The {@link Status} of the content of the item.
229
public Status getContentState()
235
* @return The {@link Status} of the properties of the item.
237
public Status getPropState()
243
* @return The {@link LockStatus} of the lock of the item.
245
public LockStatus getLockState()
251
* @return The revision of the item.
253
public long getRevision()
259
* @return The name of the changelist.
261
public String getChangelistName()
263
return changelistName;
267
* @return The range of the merge just beginning to occur.
269
public RevisionRange getMergeRange()
275
* @return The common absolute path prefix.
277
public String getPathPrefix()
282
public String getPropName()
287
public Map<String, String> getRevProps()
292
public long getOldRevision()
297
public long getHunkOriginalStart()
299
return hunkOriginalStart;
302
public long getHunkOriginalLength()
304
return hunkOriginalLength;
307
public long getHunkModifiedStart()
309
return hunkModifiedStart;
312
public long getHunkModifiedLength()
314
return hunkModifiedLength;
317
public long getHunkMatchedLine()
319
return hunkMatchedLine;
322
public int getHunkFuzz()
328
* The type of action triggering the notification
332
/** Adding a path to revision control. */
335
/** Copying a versioned path. */
338
/** Deleting a versioned path. */
341
/** Restoring a missing path from the pristine text-base. */
344
/** Reverting a modified path. */
347
/** A revert operation has failed. */
348
failed_revert ("failed revert"),
350
/** Resolving a conflict. */
351
resolved ("resolved"),
353
/** Skipping a path. */
356
/* The update actions are also used for checkouts, switches, and
359
/** Got a delete in an update. */
360
update_delete ("update delete"),
362
/** Got an add in an update. */
363
update_add ("update add"),
365
/** Got any other action in an update. */
366
update_update ("update modified"),
368
/** The last notification in an update */
369
update_completed ("update completed"),
371
/** About to update an external module, use for checkouts and switches
372
* too, end with @c svn_wc_update_completed.
374
update_external ("update external"),
376
/** The last notification in a status (including status on externals).
378
status_completed ("status completed"),
380
/** Running status on an external module. */
381
status_external ("status external"),
383
/** Committing a modification. */
384
commit_modified ("sending modified"),
386
/** Committing an addition. */
387
commit_added ("sending added"),
389
/** Committing a deletion. */
390
commit_deleted ("sending deleted"),
392
/** Committing a replacement. */
393
commit_replaced ("sending replaced"),
395
/** Transmitting post-fix text-delta data for a file. */
396
commit_postfix_txdelta ("transfer"),
398
/** Processed a single revision's blame. */
399
blame_revision ("blame revision processed"),
401
/** Locking a path */
404
/** Unlocking a path */
405
unlocked ("unlocked"),
407
/** Failed to lock a path */
408
failed_lock ("locking failed"),
410
/** Failed to unlock a path */
411
failed_unlock ("unlocking failed"),
413
/** Tried adding a path that already exists. */
414
exists ("path exists"),
416
/** Set the changelist for a path. */
417
changelist_set ("changelist set"),
419
/** Clear the changelist for a path. */
420
changelist_clear ("changelist cleared"),
422
/** A path has moved to another changelist. */
423
changelist_moved ("changelist moved"),
425
/** A merge operation has begun. */
426
merge_begin ("merge begin"),
428
/** A merge operation from a foreign repository has begun. */
429
foreign_merge_begin ("foreign merge begin"),
431
/** Got a replaced in an update. */
432
update_replaced ("replaced"),
434
/** Property added. */
435
property_added ("property added"),
437
/** Property modified. */
438
property_modified ("property modified"),
440
/** Property deleted. */
441
property_deleted ("property deleted"),
443
/** Property delete nonexistent. */
444
property_deleted_nonexistent ("nonexistent property deleted"),
446
/** Revision property set. */
447
revprop_set ("revprop set"),
449
/** Revision property deleted. */
450
revprop_deleted ("revprop deleted"),
452
/** The last notification in a merge. */
453
merge_completed ("merge completed"),
455
/** The path is a tree-conflict victim of the intended action */
456
tree_conflict ("tree conflict"),
458
/** The path is a subdirectory referenced in an externals definition
459
* which is unable to be operated on. */
460
failed_external ("failed external"),
462
/** Starting an update operation */
463
update_started ("update started"),
465
/** Skipping an obstruction working copy */
466
update_skip_obstruction ("update skip obstruction"),
468
/** Skipping a working only node */
469
update_skip_working_only ("update skip working only"),
471
/** Skipped a file or directory to which access couldn't be obtained */
472
update_skip_access_denied ("update skip access denied"),
474
/** An update operation removed an external working copy. */
475
update_external_removed ("update external removed"),
477
/** Applying a shadowed add */
478
update_shadowed_add ("update shadowed add"),
480
/** Applying a shadowed update */
481
update_shadowed_update ("update shadowed update"),
483
/** Applying a shadowed delete */
484
update_shadowed_delete ("update shadowed delete"),
486
/** The mergeinfo on path was updated. */
487
merge_record_info ("merge record info"),
489
/** An working copy directory was upgraded to the latest format. */
490
upgraded_path ("upgraded path"),
492
/** Mergeinfo describing a merge was recorded. */
493
merge_record_info_begin ("merge record info begin"),
495
/** Mergeinfo was removed due to elision. */
496
merge_elide_info ("Merge elide info"),
498
/** A file in the working copy was patched. */
501
/** A hunk from a patch was applied. */
502
patch_applied_hunk ("patch applied hunk"),
504
/** A hunk from a patch was rejected. */
505
patch_rejected_hunk ("patch rejected hunk"),
507
/** A hunk from a patch was found to be already applied. */
508
patch_hunk_already_applied ("patch hunk already applied"),
510
/** Committing a non-overwriting copy (path is the target of the
511
* copy, not the source). */
512
commit_copied ("commit copied"),
514
/** Committing an overwriting (replace) copy (path is the target of
515
* the copy, not the source). */
516
commit_copied_replaced ("commit copied replaced"),
518
/** The server has instructed the client to follow a URL
520
url_redirect ("url redirect"),
522
/** The operation was attempted on a path which doesn't exist. */
523
path_nonexistent ("path nonexistent"),
525
/** Removing a path by excluding it. */
528
/** Operation failed because the node remains in conflict */
529
failed_conflict ("failed conflict"),
531
/** Operation failed because an added node is missing */
532
failed_missing ("failed missing"),
534
/** Operation failed because a node is out of date */
535
failed_out_of_date ("failed out of date"),
537
/** Operation failed because an added parent is not selected */
538
failed_no_parent ("failed no parent"),
540
/** Operation failed because a node is locked */
541
failed_locked ("failed by lock"),
543
/** Operation failed because the operation was forbidden */
544
failed_forbidden_by_server ("failed forbidden by server"),
546
/** Operation skipped the path because it was conflicted */
547
skip_conflicted ("skipped conflicted path");
550
* The description of the action.
552
private String description;
554
Action(String description)
556
this.description = description;
559
public String toString()
567
/** It not applicable*/
568
inapplicable ("inapplicable"),
570
/** Notifier doesn't know or isn't saying. */
573
/** The state did not change. */
574
unchanged ("unchanged"),
576
/** The item wasn't present. */
579
/** An unversioned item obstructed work. */
580
obstructed ("obstructed"),
582
/** Pristine state was modified. */
585
/** Modified state had mods merged in. */
588
/** Modified state got conflicting mods. */
589
conflicted ("conflicted");
592
* The description of the action.
594
private String description;
596
Status(String description)
598
this.description = description;
601
public String toString()
607
public enum LockStatus
609
/** does not make sense for this operation */
610
inapplicable ("inapplicable"),
612
/** unknown lock state */
615
/** the lock change did not change */
616
unchanged ("unchanged"),
618
/** the item was locked */
621
/** the item was unlocked */
622
unlocked ("unlocked");
625
* The description of the action.
627
private String description;
629
LockStatus(String description)
631
this.description = description;
634
public String toString()