Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 71b438b5668b90e0f9a86c3540d3e0a98b8996ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*******************************************************************************
 * Copyright (c) 2014, 2015 Wind River Systems, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Markus Schorn - initial API and implementation
 *******************************************************************************/
package org.eclipse.tcf.te.tcf.remote.core;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteConnectionChangeListener;
import org.eclipse.remote.core.IRemoteConnectionWorkingCopy;
import org.eclipse.remote.core.IRemoteFileManager;
import org.eclipse.remote.core.IRemoteProcess;
import org.eclipse.remote.core.IRemoteProcessBuilder;
import org.eclipse.remote.core.exception.RemoteConnectionException;

public class TCFConnectionWorkingCopy extends TCFConnectionBase implements IRemoteConnectionWorkingCopy {

	private final TCFConnection fConnection;

	public TCFConnectionWorkingCopy(TCFConnection connection) {
		super(connection.getRemoteServices());
		fConnection = connection;
	}

	@Override
	public IRemoteConnection getOriginal() {
		return fConnection;
	}
	@Override
	public boolean isDirty() {
		return false;
	}
	@Override
	public IRemoteConnection save() {
		return fConnection;
	}
	@Override
	public void setAddress(String address) {
	}

	@Override
	public void setAttribute(String key, String value) {
	}

	@Override
	public void setName(String name) {
	}

	@Override
	public void setPassword(String password) {
	}

	@Override
	public void setPort(int port) {
	}

	@Override
	public void setUsername(String username) {
	}

	@Override
    public void addConnectionChangeListener(IRemoteConnectionChangeListener listener) {
		fConnection.addConnectionChangeListener(listener);
    }

	@Override
    public void close() {
		fConnection.close();
    }

	@Override
    public void fireConnectionChangeEvent(int type) {
		fConnection.fireConnectionChangeEvent(type);
    }

	@Override
    public String getAddress() {
	    return fConnection.getAddress();
    }

	@Override
    public Map<String, String> getAttributes() {
	    return fConnection.getAttributes();
    }

	@Override
    public IRemoteProcess getCommandShell(int flags) throws IOException {
		return fConnection.getCommandShell(flags);
    }

	@Override
    public Map<String, String> getEnv() {
	    return fConnection.getEnv();
    }

	@Override
    public IRemoteFileManager getFileManager() {
	    return fConnection.getFileManager();
    }

	@Override
    public String getName() {
	    return fConnection.getName();
    }

	@Override
    public int getPort() {
	    return fConnection.getPort();
    }

	@Override
    public IRemoteProcessBuilder getProcessBuilder(List<String> command) {
	    return fConnection.getProcessBuilder(command);
    }

	@Override
    public IRemoteProcessBuilder getProcessBuilder(String... command) {
	    return fConnection.getProcessBuilder(command);
    }

	@Override
    public String getUsername() {
	    return fConnection.getUsername();
    }

	@Override
    public IRemoteConnectionWorkingCopy getWorkingCopy() {
	    return this;
    }

	@Override
    public boolean isOpen() {
	    return fConnection.isOpen();
    }

	@Override
    public void open(IProgressMonitor monitor) throws RemoteConnectionException {
	    fConnection.open(monitor);
    }

	@Override
    public void removeConnectionChangeListener(IRemoteConnectionChangeListener listener) {
		fConnection.removeConnectionChangeListener(listener);
    }
}

Back to the top