author | dadubrow |
Wed, 13 Jan 2010 11:50:35 -0600 | |
changeset 761 | 19123c07e2ab |
parent 759 | d4aeef4e0f16 |
child 899 | b5675f3e69ad |
permissions | -rw-r--r-- |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
1 |
/* |
687 | 2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
8 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
11 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
13 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
15 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
16 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
17 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
18 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
19 |
package com.nokia.carbide.remoteconnections.interfaces; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
20 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
21 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
22 |
import java.util.Collection; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
23 |
|
687 | 24 |
import org.eclipse.core.runtime.CoreException; |
25 |
||
701
1912b5c050e6
make disconnect api based on new connection interface
dadubrow
parents:
698
diff
changeset
|
26 |
import com.nokia.carbide.remoteconnections.internal.api.IConnection2; |
1912b5c050e6
make disconnect api based on new connection interface
dadubrow
parents:
698
diff
changeset
|
27 |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
28 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
29 |
* An interface encapsulating the manager of connection objects |
687 | 30 |
* @noimplement |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
31 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
32 |
public interface IConnectionsManager { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
33 |
|
687 | 34 |
/** |
35 |
* Listener interface for connection manager events |
|
36 |
* (These tend to be used internally by remote connections UI) |
|
37 |
* @deprecated |
|
38 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
39 |
public interface IConnectionsManagerListener { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
40 |
void connectionStoreChanged(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
41 |
void displayChanged(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
42 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
43 |
|
687 | 44 |
/** |
45 |
* Internal method for loading connections from persisted state |
|
46 |
* @deprecated |
|
47 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
48 |
void loadConnections(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
49 |
|
687 | 50 |
/** |
51 |
* Internal method for persisting connections |
|
52 |
* @deprecated |
|
53 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
54 |
void storeConnections(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
55 |
|
687 | 56 |
|
57 |
/** |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
759
diff
changeset
|
58 |
* Listener interface for connections which are added, removed and set as current |
687 | 59 |
* @since 3.0 |
60 |
*/ |
|
61 |
public interface IConnectionListener { |
|
62 |
void connectionAdded(IConnection connection); |
|
63 |
void connectionRemoved(IConnection connection); |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
759
diff
changeset
|
64 |
void currentConnectionSet(IConnection connection); |
687 | 65 |
} |
66 |
||
67 |
/** |
|
68 |
* Add a listener for internal connection manager events |
|
69 |
* @param listener IConnectionsManagerListener |
|
70 |
* @deprecated |
|
71 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
72 |
void addConnectionStoreChangedListener(IConnectionsManagerListener listener); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
73 |
|
687 | 74 |
/** |
75 |
* Remove a listener for internal connection manager events |
|
76 |
* @param listener IConnectionsManagerListener |
|
77 |
* @deprecated |
|
78 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
79 |
void removeConnectionStoreChangedListener(IConnectionsManagerListener listener); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
80 |
|
687 | 81 |
/** |
82 |
* Add a connection to the system |
|
83 |
* @param connection IConnection |
|
84 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
85 |
void addConnection(IConnection connection); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
86 |
|
687 | 87 |
/** |
88 |
* Remove a connection from the system |
|
89 |
* @param connection IConnection |
|
90 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
91 |
void removeConnection(IConnection connection); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
92 |
|
687 | 93 |
/** |
94 |
* Return all connections in the system |
|
95 |
* @return Collection<IConnection> |
|
96 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
97 |
Collection<IConnection> getConnections(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
98 |
|
687 | 99 |
/** |
100 |
* Return all the connected services for a connection |
|
101 |
* @param connection IConnection |
|
102 |
* @return Collection<IConnectedService> |
|
103 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
104 |
Collection<IConnectedService> getConnectedServices(IConnection connection); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
105 |
|
687 | 106 |
/** |
107 |
* Returns a unique id to be used for a new connection |
|
108 |
* @return String |
|
109 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
110 |
String getUniqueConnectionId(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
111 |
|
687 | 112 |
/** |
113 |
* Returns whether some display name is in use for any existing connections |
|
114 |
* @param name String |
|
115 |
* @return boolean |
|
116 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
117 |
boolean connectionNameInUse(String name); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
118 |
|
687 | 119 |
/** |
120 |
* Fires internal display changed event |
|
121 |
* @deprecated |
|
122 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
123 |
void updateDisplays(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
124 |
|
687 | 125 |
/** |
126 |
* Returns the IClientServiceSiteUI for a service. Filters connection types to those that |
|
127 |
* are supported by the service. Connection list UI as well as new and edit wizards are filtered. |
|
128 |
* @param service IService |
|
129 |
* @return IClientServiceSiteUI |
|
728
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
130 |
* @deprecated use {@link #getClientSiteUI2(IService)} |
687 | 131 |
*/ |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
132 |
IClientServiceSiteUI getClientSiteUI(IService service); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
133 |
|
687 | 134 |
/** |
135 |
* Internal method to create the connected service over a connection (for service testing) |
|
136 |
* @param service IService |
|
137 |
* @param connection IConnection |
|
138 |
* @return IConnectedService |
|
139 |
* @deprecated |
|
140 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
141 |
IConnectedService createConnectedService(IService service, IConnection connection); |
687 | 142 |
|
143 |
/** |
|
144 |
* Add new IConnectionListener |
|
145 |
* @param listener IConnectionListener |
|
146 |
* @since 3.0 |
|
147 |
*/ |
|
148 |
void addConnectionListener(IConnectionListener listener); |
|
149 |
||
150 |
/** |
|
151 |
* Remove IConnectionListener |
|
152 |
* @param listener IConnectionListener |
|
153 |
* @since 3.0 |
|
154 |
*/ |
|
155 |
void removeConnectionListener(IConnectionListener listener); |
|
156 |
||
157 |
/** |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
759
diff
changeset
|
158 |
* Sets the current connection. |
687 | 159 |
* @param connection IConnection |
160 |
* @since 3.0 |
|
161 |
*/ |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
759
diff
changeset
|
162 |
void setCurrentConnection(IConnection connection); |
687 | 163 |
|
164 |
/** |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
759
diff
changeset
|
165 |
* Returns the current connection. |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
166 |
* @return IConnection |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
167 |
* @since 3.0 |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
168 |
*/ |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
759
diff
changeset
|
169 |
IConnection getCurrentConnection(); |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
170 |
|
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
171 |
/** |
728
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
172 |
* Returns the IClientServiceSiteUI2 for a service. Filters connection types to those that |
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
173 |
* are supported by the service. Connection list UI as well as new and edit wizards are filtered. |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
759
diff
changeset
|
174 |
* Allows selecting a "current" connection which maps to #getCurrentConnection() |
728
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
175 |
* when you use #ensureConenction(). |
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
176 |
* @param service IService |
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
177 |
* @return IClientServiceSiteUI2 |
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
178 |
* @since 3.0 |
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
179 |
*/ |
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
180 |
IClientServiceSiteUI2 getClientSiteUI2(IService service); |
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
181 |
|
a39d0ba41f81
Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
701
diff
changeset
|
182 |
/** |
687 | 183 |
* Can be called by specific service implementors (e.g., debugger) to ensure some connection |
184 |
* exists and supports this service. If the connection does not exist or does not support |
|
185 |
* the service, a CoreException may be thrown after the framework attempts to allow the user |
|
186 |
* to correct the situation. If an IConnection is returned, it is assumed to be |
|
187 |
* a valid connection in the system that supports the service. |
|
188 |
* @param connectionId String |
|
189 |
* @param service IService |
|
190 |
* @return IConnection |
|
191 |
* @throws CoreException |
|
192 |
* @since 3.0 |
|
193 |
*/ |
|
194 |
IConnection ensureConnection(String connectionId, IService service) throws CoreException; |
|
195 |
||
196 |
/** |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
759
diff
changeset
|
197 |
* Returns a connection from an id (including the current connection id) or null if none found. |
759
d4aeef4e0f16
modify IConnectionsManager and IClientServiceSiteUI2 apis + document in relnotes
dadubrow
parents:
728
diff
changeset
|
198 |
* @param connectionId String |
d4aeef4e0f16
modify IConnectionsManager and IClientServiceSiteUI2 apis + document in relnotes
dadubrow
parents:
728
diff
changeset
|
199 |
* @param service IService |
d4aeef4e0f16
modify IConnectionsManager and IClientServiceSiteUI2 apis + document in relnotes
dadubrow
parents:
728
diff
changeset
|
200 |
* @return IConnection |
d4aeef4e0f16
modify IConnectionsManager and IClientServiceSiteUI2 apis + document in relnotes
dadubrow
parents:
728
diff
changeset
|
201 |
* @throws CoreException |
d4aeef4e0f16
modify IConnectionsManager and IClientServiceSiteUI2 apis + document in relnotes
dadubrow
parents:
728
diff
changeset
|
202 |
* @since 3.0 |
d4aeef4e0f16
modify IConnectionsManager and IClientServiceSiteUI2 apis + document in relnotes
dadubrow
parents:
728
diff
changeset
|
203 |
*/ |
d4aeef4e0f16
modify IConnectionsManager and IClientServiceSiteUI2 apis + document in relnotes
dadubrow
parents:
728
diff
changeset
|
204 |
IConnection findConnection(String connectionId); |
d4aeef4e0f16
modify IConnectionsManager and IClientServiceSiteUI2 apis + document in relnotes
dadubrow
parents:
728
diff
changeset
|
205 |
|
d4aeef4e0f16
modify IConnectionsManager and IClientServiceSiteUI2 apis + document in relnotes
dadubrow
parents:
728
diff
changeset
|
206 |
/** |
687 | 207 |
* Sets a dynamic connection as disconnected. Is no-op on user generated connections. |
208 |
* If a dynamic connection is disconnected, it is transitioned to a disconnected state while it |
|
209 |
* is in use by some client service, and is eventually removed from the system once it is |
|
210 |
* no longer in use. |
|
701
1912b5c050e6
make disconnect api based on new connection interface
dadubrow
parents:
698
diff
changeset
|
211 |
* @param connection IConnection2 |
687 | 212 |
* @since 3.0 |
213 |
*/ |
|
701
1912b5c050e6
make disconnect api based on new connection interface
dadubrow
parents:
698
diff
changeset
|
214 |
void disconnect(IConnection2 connection); |
687 | 215 |
|
216 |
/** |
|
217 |
* Attempts to set a disconnected dynamic connection back to its in-use state. |
|
218 |
* If the connection has not been removed from the system, and is still in-use, |
|
219 |
* it will be restored. Returns true if successful in restoring the connection. |
|
701
1912b5c050e6
make disconnect api based on new connection interface
dadubrow
parents:
698
diff
changeset
|
220 |
* @param connection IConnection2 |
687 | 221 |
* @since 3.0 |
222 |
*/ |
|
701
1912b5c050e6
make disconnect api based on new connection interface
dadubrow
parents:
698
diff
changeset
|
223 |
boolean reconnect(IConnection2 connection); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
224 |
} |