~ubuntu-branches/ubuntu/trusty/subversion/trusty-proposed

« back to all changes in this revision

Viewing changes to subversion/bindings/javahl/src/org/apache/subversion/javahl/ClientNotifyInformation.java

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft
  • Date: 2012-06-21 15:36:36 UTC
  • mfrom: (0.4.13 sid)
  • Revision ID: package-import@ubuntu.com-20120621153636-amqqmuidgwgxz1ly
Tags: 1.7.5-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - Create pot file on build.
  - Build a python-subversion-dbg package.
  - Build-depend on python-dbg.
  - Build-depend on default-jre-headless/-jdk.
  - Do not apply java-build patch.
  - debian/rules: Manually create the doxygen output directory, otherwise
    we get weird build failures when running parallel builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @copyright
 
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
 
11
 *
 
12
 *      http://www.apache.org/licenses/LICENSE-2.0
 
13
 *
 
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
 
19
 *    under the License.
 
20
 * ====================================================================
 
21
 * @endcopyright
 
22
 */
 
23
 
 
24
package org.apache.subversion.javahl;
 
25
 
 
26
import java.util.Map;
 
27
import java.util.EventObject;
 
28
import org.apache.subversion.javahl.callback.ClientNotifyCallback;
 
29
import org.apache.subversion.javahl.types.*;
 
30
 
 
31
/**
 
32
 * The event passed to the {@link ClientNotifyCallback#onNotify}
 
33
 * API to notify {@link ISVNClient} of relevant events.
 
34
 */
 
35
public class ClientNotifyInformation extends EventObject
 
36
{
 
37
    // Update the serialVersionUID when there is a incompatible change
 
38
    // made to this class.  See any of the following, depending upon
 
39
    // the Java release.
 
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;
 
45
 
 
46
    /**
 
47
     * The {@link Action} which triggered this event.
 
48
     */
 
49
    private Action action;
 
50
 
 
51
    /**
 
52
     * The {@link NodeKind} of the item.
 
53
     */
 
54
    private NodeKind kind;
 
55
 
 
56
    /**
 
57
     * The MIME type of the item.
 
58
     */
 
59
    private String mimeType;
 
60
 
 
61
    /**
 
62
     * Any lock for the item.
 
63
     */
 
64
    private Lock lock;
 
65
 
 
66
    /**
 
67
     * Any error message for the item.
 
68
     */
 
69
    private String errMsg;
 
70
 
 
71
    /**
 
72
     * The {@link Status} of the content of the item.
 
73
     */
 
74
    private Status contentState;
 
75
 
 
76
    /**
 
77
     * The {@link Status} of the properties of the item.
 
78
     */
 
79
    private Status propState;
 
80
 
 
81
    /**
 
82
     * The {@link LockStatus} of the lock of the item.
 
83
     */
 
84
    private LockStatus lockState;
 
85
 
 
86
    /**
 
87
     * The revision of the item.
 
88
     */
 
89
    private long revision;
 
90
 
 
91
    /**
 
92
     * The name of the changelist.
 
93
     */
 
94
    private String changelistName;
 
95
 
 
96
    /**
 
97
     * The range of the merge just beginning to occur.
 
98
     */
 
99
    private RevisionRange mergeRange;
 
100
 
 
101
    /**
 
102
     * A common absolute path prefix that can be subtracted from .path.
 
103
     */
 
104
    private String pathPrefix;
 
105
 
 
106
    private String propName;
 
107
 
 
108
    private Map<String, String> revProps;
 
109
 
 
110
    long oldRevision;
 
111
 
 
112
    long hunkOriginalStart;
 
113
 
 
114
    long hunkOriginalLength;
 
115
 
 
116
    long hunkModifiedStart;
 
117
 
 
118
    long hunkModifiedLength;
 
119
 
 
120
    long hunkMatchedLine;
 
121
 
 
122
    int hunkFuzz;
 
123
 
 
124
    /**
 
125
     * This constructor is to be used by the native code.
 
126
     *
 
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
 
134
     * the item.
 
135
     * @param propState The {@link Status} of the properties of
 
136
     * the item.
 
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.
 
142
     */
 
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)
 
153
    {
 
154
        super(path == null ? "" : path);
 
155
        this.action = action;
 
156
        this.kind = kind;
 
157
        this.mimeType = mimeType;
 
158
        this.lock = lock;
 
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;
 
176
    }
 
177
 
 
178
    /**
 
179
     * @return The path of the item, which is the source of the event.
 
180
     */
 
181
    public String getPath()
 
182
    {
 
183
        return (String) super.source;
 
184
    }
 
185
 
 
186
    /**
 
187
     * @return The {@link Action} which triggered this event.
 
188
     */
 
189
    public Action getAction()
 
190
    {
 
191
        return action;
 
192
    }
 
193
 
 
194
    /**
 
195
     * @return The {@link NodeKind} of the item.
 
196
     */
 
197
    public NodeKind getKind()
 
198
    {
 
199
        return kind;
 
200
    }
 
201
 
 
202
    /**
 
203
     * @return The MIME type of the item.
 
204
     */
 
205
    public String getMimeType()
 
206
    {
 
207
        return mimeType;
 
208
    }
 
209
 
 
210
    /**
 
211
     * @return Any lock for the item.
 
212
     */
 
213
    public Lock getLock()
 
214
    {
 
215
        return lock;
 
216
    }
 
217
 
 
218
    /**
 
219
     * @return Any error message for the item.
 
220
     */
 
221
    public String getErrMsg()
 
222
    {
 
223
        return errMsg;
 
224
    }
 
225
 
 
226
    /**
 
227
     * @return The {@link Status} of the content of the item.
 
228
     */
 
229
    public Status getContentState()
 
230
    {
 
231
        return contentState;
 
232
    }
 
233
 
 
234
    /**
 
235
     * @return The {@link Status} of the properties of the item.
 
236
     */
 
237
    public Status getPropState()
 
238
    {
 
239
        return propState;
 
240
    }
 
241
 
 
242
    /**
 
243
     * @return The {@link LockStatus} of the lock of the item.
 
244
     */
 
245
    public LockStatus getLockState()
 
246
    {
 
247
        return lockState;
 
248
    }
 
249
 
 
250
    /**
 
251
     * @return The revision of the item.
 
252
     */
 
253
    public long getRevision()
 
254
    {
 
255
        return revision;
 
256
    }
 
257
 
 
258
    /**
 
259
     * @return The name of the changelist.
 
260
     */
 
261
    public String getChangelistName()
 
262
    {
 
263
        return changelistName;
 
264
    }
 
265
 
 
266
    /**
 
267
     * @return The range of the merge just beginning to occur.
 
268
     */
 
269
    public RevisionRange getMergeRange()
 
270
    {
 
271
        return mergeRange;
 
272
    }
 
273
 
 
274
    /**
 
275
     * @return The common absolute path prefix.
 
276
     */
 
277
    public String getPathPrefix()
 
278
    {
 
279
        return pathPrefix;
 
280
    }
 
281
 
 
282
    public String getPropName()
 
283
    {
 
284
        return propName;
 
285
    }
 
286
 
 
287
    public Map<String, String> getRevProps()
 
288
    {
 
289
        return revProps;
 
290
    }
 
291
 
 
292
    public long getOldRevision()
 
293
    {
 
294
        return oldRevision;
 
295
    }
 
296
 
 
297
    public long getHunkOriginalStart()
 
298
    {
 
299
        return hunkOriginalStart;
 
300
    }
 
301
 
 
302
    public long getHunkOriginalLength()
 
303
    {
 
304
        return hunkOriginalLength;
 
305
    }
 
306
 
 
307
    public long getHunkModifiedStart()
 
308
    {
 
309
        return hunkModifiedStart;
 
310
    }
 
311
 
 
312
    public long getHunkModifiedLength()
 
313
    {
 
314
        return hunkModifiedLength;
 
315
    }
 
316
 
 
317
    public long getHunkMatchedLine()
 
318
    {
 
319
        return hunkMatchedLine;
 
320
    }
 
321
 
 
322
    public int getHunkFuzz()
 
323
    {
 
324
        return hunkFuzz;
 
325
    }
 
326
 
 
327
    /**
 
328
     * The type of action triggering the notification
 
329
     */
 
330
    public enum Action
 
331
    {
 
332
        /** Adding a path to revision control. */
 
333
        add             ("add"),
 
334
 
 
335
        /** Copying a versioned path. */
 
336
        copy            ("copy"),
 
337
 
 
338
        /** Deleting a versioned path. */
 
339
        delete          ("delete"),
 
340
 
 
341
        /** Restoring a missing path from the pristine text-base. */
 
342
        restore         ("restore"),
 
343
 
 
344
        /** Reverting a modified path. */
 
345
        revert          ("revert"),
 
346
 
 
347
        /** A revert operation has failed. */
 
348
        failed_revert   ("failed revert"),
 
349
 
 
350
        /** Resolving a conflict. */
 
351
        resolved        ("resolved"),
 
352
 
 
353
        /** Skipping a path. */
 
354
        skip            ("skip"),
 
355
 
 
356
        /* The update actions are also used for checkouts, switches, and
 
357
           merges. */
 
358
 
 
359
        /** Got a delete in an update. */
 
360
        update_delete   ("update delete"),
 
361
 
 
362
        /** Got an add in an update. */
 
363
        update_add      ("update add"),
 
364
 
 
365
        /** Got any other action in an update. */
 
366
        update_update   ("update modified"),
 
367
 
 
368
        /** The last notification in an update */
 
369
        update_completed ("update completed"),
 
370
 
 
371
        /** About to update an external module, use for checkouts and switches
 
372
         *  too, end with @c svn_wc_update_completed.
 
373
         */
 
374
        update_external ("update external"),
 
375
 
 
376
        /** The last notification in a status (including status on externals).
 
377
         */
 
378
        status_completed ("status completed"),
 
379
 
 
380
        /** Running status on an external module. */
 
381
        status_external ("status external"),
 
382
 
 
383
        /** Committing a modification. */
 
384
        commit_modified ("sending modified"),
 
385
 
 
386
        /** Committing an addition. */
 
387
        commit_added    ("sending added"),
 
388
 
 
389
        /** Committing a deletion. */
 
390
        commit_deleted  ("sending deleted"),
 
391
 
 
392
        /** Committing a replacement. */
 
393
        commit_replaced ("sending replaced"),
 
394
 
 
395
        /** Transmitting post-fix text-delta data for a file. */
 
396
        commit_postfix_txdelta ("transfer"),
 
397
 
 
398
        /** Processed a single revision's blame. */
 
399
        blame_revision  ("blame revision processed"),
 
400
 
 
401
        /** Locking a path */
 
402
        locked          ("locked"),
 
403
 
 
404
        /** Unlocking a path */
 
405
        unlocked        ("unlocked"),
 
406
 
 
407
        /** Failed to lock a path */
 
408
        failed_lock     ("locking failed"),
 
409
 
 
410
        /** Failed to unlock a path */
 
411
        failed_unlock   ("unlocking failed"),
 
412
 
 
413
        /** Tried adding a path that already exists.  */
 
414
        exists          ("path exists"),
 
415
 
 
416
        /** Set the changelist for a path.  */
 
417
        changelist_set  ("changelist set"),
 
418
 
 
419
        /** Clear the changelist for a path.  */
 
420
        changelist_clear ("changelist cleared"),
 
421
 
 
422
        /** A path has moved to another changelist.  */
 
423
        changelist_moved    ("changelist moved"),
 
424
 
 
425
        /** A merge operation has begun.  */
 
426
        merge_begin     ("merge begin"),
 
427
 
 
428
        /** A merge operation from a foreign repository has begun.  */
 
429
        foreign_merge_begin ("foreign merge begin"),
 
430
 
 
431
        /** Got a replaced in an update.  */
 
432
        update_replaced ("replaced"),
 
433
 
 
434
        /** Property added.  */
 
435
        property_added  ("property added"),
 
436
 
 
437
        /** Property modified.  */
 
438
        property_modified ("property modified"),
 
439
 
 
440
        /** Property deleted.  */
 
441
        property_deleted ("property deleted"),
 
442
 
 
443
        /** Property delete nonexistent.  */
 
444
        property_deleted_nonexistent ("nonexistent property deleted"),
 
445
 
 
446
        /** Revision property set.  */
 
447
        revprop_set     ("revprop set"),
 
448
 
 
449
        /** Revision property deleted.  */
 
450
        revprop_deleted ("revprop deleted"),
 
451
 
 
452
        /** The last notification in a merge.  */
 
453
        merge_completed ("merge completed"),
 
454
 
 
455
        /** The path is a tree-conflict victim of the intended action */
 
456
        tree_conflict   ("tree conflict"),
 
457
 
 
458
        /** The path is a subdirectory referenced in an externals definition
 
459
          * which is unable to be operated on.  */
 
460
        failed_external ("failed external"),
 
461
 
 
462
        /** Starting an update operation */
 
463
        update_started ("update started"),
 
464
 
 
465
        /** Skipping an obstruction working copy */
 
466
        update_skip_obstruction ("update skip obstruction"),
 
467
 
 
468
        /** Skipping a working only node */
 
469
        update_skip_working_only ("update skip working only"),
 
470
 
 
471
        /** Skipped a file or directory to which access couldn't be obtained */
 
472
        update_skip_access_denied ("update skip access denied"),
 
473
 
 
474
        /** An update operation removed an external working copy.  */
 
475
        update_external_removed ("update external removed"),
 
476
 
 
477
        /** Applying a shadowed add */
 
478
        update_shadowed_add ("update shadowed add"),
 
479
 
 
480
        /** Applying a shadowed update */
 
481
        update_shadowed_update ("update shadowed update"),
 
482
 
 
483
        /** Applying a shadowed delete */
 
484
        update_shadowed_delete ("update shadowed delete"),
 
485
 
 
486
        /** The mergeinfo on path was updated.  */
 
487
        merge_record_info   ("merge record info"),
 
488
 
 
489
        /** An working copy directory was upgraded to the latest format.  */
 
490
        upgraded_path       ("upgraded path"),
 
491
 
 
492
        /** Mergeinfo describing a merge was recorded.  */
 
493
        merge_record_info_begin     ("merge record info begin"),
 
494
 
 
495
        /** Mergeinfo was removed due to elision.  */
 
496
        merge_elide_info    ("Merge elide info"),
 
497
 
 
498
        /** A file in the working copy was patched.  */
 
499
        patch       ("patch"),
 
500
 
 
501
        /** A hunk from a patch was applied.  */
 
502
        patch_applied_hunk  ("patch applied hunk"),
 
503
 
 
504
        /** A hunk from a patch was rejected.  */
 
505
        patch_rejected_hunk ("patch rejected hunk"),
 
506
 
 
507
        /** A hunk from a patch was found to be already applied. */
 
508
        patch_hunk_already_applied ("patch hunk already applied"),
 
509
 
 
510
        /** Committing a non-overwriting copy (path is the target of the
 
511
          * copy, not the source). */
 
512
        commit_copied   ("commit copied"),
 
513
 
 
514
        /** Committing an overwriting (replace) copy (path is the target of
 
515
          * the copy, not the source).  */
 
516
        commit_copied_replaced  ("commit copied replaced"),
 
517
 
 
518
        /** The server has instructed the client to follow a URL
 
519
          * redirection. */
 
520
        url_redirect    ("url redirect"),
 
521
 
 
522
        /** The operation was attempted on a path which doesn't exist. */
 
523
        path_nonexistent ("path nonexistent"),
 
524
 
 
525
        /** Removing a path by excluding it. */
 
526
        exclude ("exclude"),
 
527
 
 
528
        /** Operation failed because the node remains in conflict */
 
529
        failed_conflict ("failed conflict"),
 
530
 
 
531
        /** Operation failed because an added node is missing */
 
532
        failed_missing ("failed missing"),
 
533
 
 
534
        /** Operation failed because a node is out of date */
 
535
        failed_out_of_date ("failed out of date"),
 
536
 
 
537
        /** Operation failed because an added parent is not selected */
 
538
        failed_no_parent ("failed no parent"),
 
539
 
 
540
        /** Operation failed because a node is locked */
 
541
        failed_locked ("failed by lock"),
 
542
 
 
543
        /** Operation failed because the operation was forbidden */
 
544
        failed_forbidden_by_server ("failed forbidden by server"),
 
545
 
 
546
        /** Operation skipped the path because it was conflicted */
 
547
        skip_conflicted ("skipped conflicted path");
 
548
 
 
549
        /**
 
550
         * The description of the action.
 
551
         */
 
552
        private String description;
 
553
 
 
554
        Action(String description)
 
555
        {
 
556
            this.description = description;
 
557
        }
 
558
 
 
559
        public String toString()
 
560
        {
 
561
            return description;
 
562
        }
 
563
    }
 
564
 
 
565
    public enum Status
 
566
    {
 
567
        /** It not applicable*/
 
568
        inapplicable    ("inapplicable"),
 
569
 
 
570
        /** Notifier doesn't know or isn't saying. */
 
571
        unknown         ("unknown"),
 
572
 
 
573
        /** The state did not change. */
 
574
        unchanged       ("unchanged"),
 
575
 
 
576
        /** The item wasn't present. */
 
577
        missing         ("missing"),
 
578
 
 
579
        /** An unversioned item obstructed work. */
 
580
        obstructed      ("obstructed"),
 
581
 
 
582
        /** Pristine state was modified. */
 
583
        changed         ("changed"),
 
584
 
 
585
        /** Modified state had mods merged in. */
 
586
        merged          ("merged"),
 
587
 
 
588
        /** Modified state got conflicting mods. */
 
589
        conflicted      ("conflicted");
 
590
 
 
591
        /**
 
592
         * The description of the action.
 
593
         */
 
594
        private String description;
 
595
 
 
596
        Status(String description)
 
597
        {
 
598
            this.description = description;
 
599
        }
 
600
 
 
601
        public String toString()
 
602
        {
 
603
            return description;
 
604
        }
 
605
    }
 
606
 
 
607
    public enum LockStatus
 
608
    {
 
609
        /** does not make sense for this operation */
 
610
        inapplicable    ("inapplicable"),
 
611
 
 
612
        /** unknown lock state */
 
613
        unknown         ("unknown"),
 
614
 
 
615
        /** the lock change did not change */
 
616
        unchanged       ("unchanged"),
 
617
 
 
618
        /** the item was locked */
 
619
        locked          ("locked"),
 
620
 
 
621
        /** the item was unlocked */
 
622
        unlocked        ("unlocked");
 
623
 
 
624
        /**
 
625
         * The description of the action.
 
626
         */
 
627
        private String description;
 
628
 
 
629
        LockStatus(String description)
 
630
        {
 
631
            this.description = description;
 
632
        }
 
633
 
 
634
        public String toString()
 
635
        {
 
636
            return description;
 
637
        }
 
638
    }
 
639
}