01: /*
02: * (C) Copyright IBM Corp. 2000 All rights reserved.
03: *
04: * The program is provided "AS IS" without any warranty express or
05: * implied, including the warranty of non-infringement and the implied
06: * warranties of merchantibility and fitness for a particular purpose.
07: * IBM will not be liable for any damages suffered by you as a result
08: * of using the Program. In no event will IBM be liable for any
09: * 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 targetSelector = null;
24:
25: /**
26: * Create a TargetSelector that has no Workspace or TargetSelector.
27: *
28: * @param targetSelector the target selector
29: * @exception com.ibm.webdav.WebDAVException
30: */
31: protected TargetSelector() {
32: }
33:
34: /**
35: * Create a TargetSelector for the given Workspace and selector override.
36: * The targetSelector overrides the Workspace for the requested resource.
37: * The Workspace is used to select revisions of all other referenced
38: * resources.
39: *
40: * @param workspace the Workspace used by this TargetSelector
41: * @param targetSelector the target selector
42: * @exception com.ibm.webdav.WebDAVException
43: */
44: public TargetSelector(Workspace workspace, String targetSelector)
45: throws WebDAVException {
46: this .workspace = workspace;
47: this .targetSelector = targetSelector;
48: }
49:
50: /**
51: * Create a TargetSelector that has no Workspace.
52: *
53: * @param targetSelector the target selector
54: * @exception com.ibm.webdav.WebDAVException
55: */
56: public TargetSelector(String targetSelector) throws WebDAVException {
57: this .targetSelector = targetSelector;
58: }
59:
60: /**
61: * Get the selector key for this TargetSelector. Each subtype has a different
62: * key in order to indicate to the server the type of the TargetSelector. This
63: * method is used for marshalling only.
64: *
65: * @return the selected revision
66: * @exception com.ibm.webdav.WebDAVException
67: */
68: public abstract String getSelectorKey() throws WebDAVException;
69:
70: /**
71: * Get the Workspace for this TargetSelector.
72: *
73: * @return the Workspace used by this TargetSelector
74: * @exception com.ibm.webdav.WebDAVException
75: */
76: public Workspace getWorkspace() throws WebDAVException {
77: return workspace;
78: }
79: }
|