KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ibm > webdav > TargetSelector


1 /*
2  * (C) Copyright IBM Corp. 2000 All rights reserved.
3  *
4  * The program is provided "AS IS" without any warranty express or
5  * implied, including the warranty of non-infringement and the implied
6  * warranties of merchantibility and fitness for a particular purpose.
7  * IBM will not be liable for any damages suffered by you as a result
8  * of using the Program. In no event will IBM be liable for any
9  * special, indirect or consequential damages or lost profits even if
10  * IBM has been advised of the possibility of their occurrence. IBM
11  * will not be liable for any third party claims against you.
12  */

13
14 package com.ibm.webdav;
15
16 /**
17  * A target selector can be a label name, label id, working resource id,
18  * or an indicator that the VersionedResource itself should be selected.
19  * A TargetSelector selects the revision with the associated label or id.
20  */

21 public abstract class TargetSelector {
22     Workspace workspace = null;
23     String JavaDoc targetSelector = null;
24 /**
25  * Create a TargetSelector that has no Workspace or TargetSelector.
26  *
27  * @param targetSelector the target selector
28  * @exception com.ibm.webdav.WebDAVException
29  */

30 protected TargetSelector() {
31 }
32 /**
33  * Create a TargetSelector for the given Workspace and selector override.
34  * The targetSelector overrides the Workspace for the requested resource.
35  * The Workspace is used to select revisions of all other referenced
36  * resources.
37  *
38  * @param workspace the Workspace used by this TargetSelector
39  * @param targetSelector the target selector
40  * @exception com.ibm.webdav.WebDAVException
41  */

42 public TargetSelector(Workspace workspace, String JavaDoc targetSelector) throws WebDAVException {
43     this.workspace = workspace;
44     this.targetSelector = targetSelector;
45 }
46 /**
47  * Create a TargetSelector that has no Workspace.
48  *
49  * @param targetSelector the target selector
50  * @exception com.ibm.webdav.WebDAVException
51  */

52 public TargetSelector(String JavaDoc targetSelector) throws WebDAVException {
53     this.targetSelector = targetSelector;
54 }
55 /**
56  * Get the selector key for this TargetSelector. Each subtype has a different
57  * key in order to indicate to the server the type of the TargetSelector. This
58  * method is used for marshalling only.
59  *
60  * @return the selected revision
61  * @exception com.ibm.webdav.WebDAVException
62  */

63 public abstract String JavaDoc getSelectorKey() throws WebDAVException;
64 /**
65  * Get the Workspace for this TargetSelector.
66  *
67  * @return the Workspace used by this TargetSelector
68  * @exception com.ibm.webdav.WebDAVException
69  */

70 public Workspace getWorkspace() throws WebDAVException {
71     return workspace;
72 }
73 }
74
Popular Tags