1 /**
2 * Copyright 2005-2006 the original author or authors.
3 *
4 * Licensed under the Gnu General Pubic License, Version 2.0 (the
5 * "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/gpl-license.php
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the Gnu General Public License for more details.
14 */
15 package org.figure8.join.services.vcs;
16
17 import java.io.Serializable;
18 /**
19 * Service interface defining an accessor for Version and Configuration
20 * management System. This interface defines operations for initializing
21 * this accessor (bunch of setX() methods), for retrieving this accessor
22 * properties (bunch of getX() methods) and for interacting with VCS
23 * system (login(), checkout() and logout() methods).
24 * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
25 * @version $Revision: 1.2 $
26 */
27 public interface VCSAccessor extends Serializable{
28
29
30
31 /** @return The user for connecting to VCS implementation */
32 public abstract String getUser();
33 /** @param user The user for connecting to VCS implementation */
34 public abstract void setUser(String user);
35 /** @return The password for user who is connecting to VCS */
36 public abstract String getPassword();
37 /** @param password The password for uer who is connecting to VCS */
38 public abstract void setPassword(String password);
39
40 /**
41 * Module of version and configuration management system used by this accessor
42 * @return The VCS implementation module name (ex: module for CVS, "trunk" for Subversion, ...)
43 */
44 public abstract String getModule();
45 /**
46 * Set the VCS module to used. This property has different meaning depending
47 * on the VCS implementation. It really describes a module in CVS but should be
48 * the trunk of a Subversion repository. Check the implementation documentation.
49 * @param module Module of VCS used by this accessor
50 */
51 public abstract void setModule(String module);
52
53 /** @return The protocol used for connecting VCS */
54 public abstract String getProtocol();
55 /** @param protocol The protocol used for connecting VCS */
56 public abstract void setProtocol(String protocol);
57
58 /**
59 * The root remote repository path of VCS. This property has different meaning
60 * depending on the VCS implemnetation. Typically, it is the valur of CVSROOT
61 * for CVS and an URL for Subversion. Check the implementation documentation.
62 * @return The VCS remote repository path
63 */
64 public abstract String getRootRepository();
65 /**
66 * Check <code>getRootRepository()</code> comments for details.
67 * @param repository The VCS remote repository path
68 */
69 public abstract void setRootRepository(String repository);
70
71 /**
72 * Login onto configuration management system.
73 * @throws VCSAccessException if login is not successfull
74 */
75 public abstract void login() throws VCSAccessException;
76
77 /**
78 * Perform a checkout command (or equivalent) on the VCS using a specified
79 * baseline <b>tag</b>. Extracted files are stored within <b>destDirectory</b>
80 * @param tag Baseline tag for retrieving module from VCS
81 * @param destDirectory Path of the destination directory where to put extracted files
82 * @throws VCSAccessException if cehckout command is not successfull
83 */
84 public abstract void checkout(String tag, String destDirectory) throws VCSAccessException;
85
86 /**
87 * Logout from configuration management system.
88 * @throws VCSAccessException if logout is not successfull
89 */
90 public abstract void logout() throws VCSAccessException;
91 }