1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package nl.toolforge.karma.core.location;
20
21 import nl.toolforge.karma.core.boot.WorkingContext;
22 import nl.toolforge.karma.core.vc.AuthenticationException;
23 import nl.toolforge.karma.core.vc.AuthenticatorKey;
24
25 /***
26 * <p>A <code>Location</code> describes a location aspect of a module. Source modules are kept in a version control
27 * system, binary (third party) modules are kept in libraries. These locations are maintained in
28 * <code>locations.xml</code>.
29 * <p/>
30 * <p>A developer should maintain a <code>location-authentication.xml</code> file in the Karma configuration directory.
31 * This file contains
32 *
33 * @author D.A. Smedes
34 * @version $Id: Location.java,v 1.11 2004/11/02 23:57:06 asmedes Exp $
35 */
36 public interface Location {
37
38 /***
39 * Is the (remote) location available on the specified port ? Usefull to implement for remote locations.
40 * @return <code>false</code> if the location is not available, <code>true</code> if it is.
41 */
42 public boolean isAvailable();
43
44 /***
45 * The locations' type descriptor.
46 *
47 * @return A <code>Location.Type</code> instance.
48 */
49 public LocationType getType();
50
51 /***
52 * A locations' identifier. Should be unique over all <code>location</code>-elements. This id is
53 * matched against the <code>id</code>-attribute of a <code>location</code>-element in the
54 * <code>location-authentication.xml</code> file (see class documentation {@link nl.toolforge.karma.core.location.Location}.
55 *
56 * @return An identifier string for a location.
57 */
58 public String getId();
59
60 /***
61 * Returns a <location>-element for the specific type of location.
62 */
63 public StringBuffer asXML();
64
65 /***
66 * <p>Tries to open a connection to the server if the protocol is a remote protocol.
67 *
68 * @throws LocationException When connection failed. The ErrorCode will tell the reason.
69 */
70 public void connect() throws AuthenticationException, LocationException;
71
72 public void setWorkingContext(WorkingContext workingContext);
73
74 public AuthenticatorKey getAuthenticatorKey();
75 }