comparison src/org/tmatesoft/hg/internal/remote/Connector.java @ 687:9859fcea475d

Towards ssh remote repositories: refactor HgRemoteRepository - move http related code to HttpConnector
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Sat, 27 Jul 2013 18:34:14 +0200
parents
children 822f3a83ff57
comparison
equal deleted inserted replaced
686:f1f095e42555 687:9859fcea475d
1 /*
2 * Copyright (c) 2013 TMate Software Ltd
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * For information on how to redistribute this software under
14 * the terms of a license other than GNU General Public License
15 * contact TMate Software at support@hg4j.com
16 */
17 package org.tmatesoft.hg.internal.remote;
18
19 import java.io.InputStream;
20 import java.io.OutputStream;
21 import java.net.URL;
22 import java.util.Collection;
23 import java.util.List;
24
25 import org.tmatesoft.hg.core.HgRemoteConnectionException;
26 import org.tmatesoft.hg.core.Nodeid;
27 import org.tmatesoft.hg.core.SessionContext;
28 import org.tmatesoft.hg.repo.HgRuntimeException;
29 import org.tmatesoft.hg.repo.HgRemoteRepository.Range;
30
31 /**
32 *
33 * @author Artem Tikhomirov
34 * @author TMate Software Ltd.
35 */
36 public interface Connector {
37 static final String CMD_HELLO = "hello"; // TODO enum
38 static final String CMD_CAPABILITIES = "capabilities";
39 static final String CMD_HEADS = "heads";
40 static final String CMD_BETWEEN = "between";
41 static final String CMD_BRANCHES = "branches";
42 static final String CMD_CHANGEGROUP = "changegroup";
43 static final String CMD_UNBUNDLE = "unbundle";
44 static final String CMD_PUSHKEY = "pushkey";
45 static final String CMD_LISTKEYS = "listkeys";
46 static final String NS_BOOKMARKS = "bookmarks";
47 static final String NS_PHASES = "phases";
48
49 void init(URL url, SessionContext sessionContext, Object globalConfig) throws HgRuntimeException;
50 String getServerLocation();
51 //
52 void connect() throws HgRemoteConnectionException, HgRuntimeException;
53 void disconnect() throws HgRemoteConnectionException, HgRuntimeException;
54 void sessionBegin() throws HgRemoteConnectionException, HgRuntimeException;
55 void sessionEnd() throws HgRemoteConnectionException, HgRuntimeException;
56 //
57 String getCapabilities() throws HgRemoteConnectionException, HgRuntimeException;
58
59 InputStream heads() throws HgRemoteConnectionException, HgRuntimeException;
60 InputStream between(Collection<Range> ranges) throws HgRemoteConnectionException, HgRuntimeException;
61 InputStream branches(List<Nodeid> nodes) throws HgRemoteConnectionException, HgRuntimeException;
62 InputStream changegroup(List<Nodeid> roots) throws HgRemoteConnectionException, HgRuntimeException;
63 OutputStream unbundle(long outputLen, List<Nodeid> remoteHeads) throws HgRemoteConnectionException, HgRuntimeException;
64 InputStream pushkey(String opName, String namespace, String key, String oldValue, String newValue) throws HgRemoteConnectionException, HgRuntimeException;
65 InputStream listkeys(String namespace, String actionName) throws HgRemoteConnectionException, HgRuntimeException;
66 }