KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > core > IConnectionMethod


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.core;
12
13  
14 /**
15  * Implementators of this class can act as factories for creating connections to a CVS server
16  * with the desired custom communication protocol. Providers of CVS connection methods must implement
17  * this interface and register the implementation with the extension point:
18  *
19  * org.eclipse.team.cvs.core.connectionmethods
20  *
21  * The <code>createConnection()</code> method will be invoked by the CVS client when the user
22  * is attempting to make a connection to the server using the connection name which matches
23  * the <code>String</code> returned by <code>getName()</code> (e.g. "pserver", "ext", etc.).
24  */

25 public interface IConnectionMethod {
26     
27     /**
28      * Returns the name of this connection method (e.g."local", "ext").
29      */

30     public String JavaDoc getName();
31     
32     /**
33      * Creates a new server connection using the given repository root
34      * (which includes the user name) and the given password.
35      * If password is not given, null will be passed.
36      */

37     public IServerConnection createConnection(ICVSRepositoryLocation location, String JavaDoc password);
38     
39     /**
40      * Some connection method may persist the physical connection to the server
41      * through several IServerConnections. For example, when making several
42      * successive connections to the same location using SSH2, it would be very
43      * expensive to re-connect, re-negotiate and re-authenticate for each
44      * operation; therefore the SSH2 connection method will create one SSH
45      * session and open several channels (one for each IServerConnection
46      * created), and keep the session open until disconnect() is called.
47      * <p>
48      * This method actually closes any connection to the indicated location.
49      * </p>
50      */

51     public void disconnect(ICVSRepositoryLocation location);
52 }
53
Popular Tags