author | dadubrow |
Mon, 01 Feb 2010 13:27:18 -0600 | |
branch | RCL_2_4 |
changeset 857 | d66843399035 |
parent 0 | fb279309251b |
child 900 | 8b30bf718a17 |
permissions | -rw-r--r-- |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
1 |
/* |
857 | 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 |
|
857 | 24 |
import org.eclipse.core.runtime.CoreException; |
25 |
||
26 |
import com.nokia.carbide.remoteconnections.internal.api.IConnection2; |
|
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 |
857 | 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 |
|
857 | 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 |
|
857 | 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 |
|
857 | 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 |
|
857 | 56 |
|
57 |
/** |
|
58 |
* Listener interface for connections which are added, removed and set as current |
|
59 |
* @since 3.0 |
|
60 |
*/ |
|
61 |
public interface IConnectionListener { |
|
62 |
void connectionAdded(IConnection connection); |
|
63 |
void connectionRemoved(IConnection connection); |
|
64 |
void currentConnectionSet(IConnection connection); |
|
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 |
|
857 | 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 |
|
857 | 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 |
|
857 | 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 |
|
857 | 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 |
|
857 | 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 |
|
857 | 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 |
|
857 | 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 |
|
857 | 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 |
|
857 | 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 |
|
130 |
* @deprecated use {@link #getClientSiteUI2(IService)} |
|
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 |
|
857 | 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); |
857 | 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 |
/** |
|
158 |
* Sets the current connection. |
|
159 |
* @param connection IConnection |
|
160 |
* @since 3.0 |
|
161 |
*/ |
|
162 |
void setCurrentConnection(IConnection connection); |
|
163 |
||
164 |
/** |
|
165 |
* Returns the current connection. |
|
166 |
* @return IConnection |
|
167 |
* @since 3.0 |
|
168 |
*/ |
|
169 |
IConnection getCurrentConnection(); |
|
170 |
||
171 |
/** |
|
172 |
* Returns the IClientServiceSiteUI2 for a service. Filters connection types to those that |
|
173 |
* are supported by the service. Connection list UI as well as new and edit wizards are filtered. |
|
174 |
* Allows selecting a "current" connection which maps to #getCurrentConnection() |
|
175 |
* when you use #ensureConenction(). |
|
176 |
* @param service IService |
|
177 |
* @return IClientServiceSiteUI2 |
|
178 |
* @since 3.0 |
|
179 |
*/ |
|
180 |
IClientServiceSiteUI2 getClientSiteUI2(IService service); |
|
181 |
||
182 |
/** |
|
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 |
/** |
|
197 |
* Returns a connection from an id (including the current connection id) or null if none found. |
|
198 |
* @param connectionId String |
|
199 |
* @param service IService |
|
200 |
* @return IConnection |
|
201 |
* @throws CoreException |
|
202 |
* @since 3.0 |
|
203 |
*/ |
|
204 |
IConnection findConnection(String connectionId); |
|
205 |
||
206 |
/** |
|
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. |
|
211 |
* @param connection IConnection2 |
|
212 |
* @since 3.0 |
|
213 |
*/ |
|
214 |
void disconnect(IConnection2 connection); |
|
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. |
|
220 |
* @param connection IConnection2 |
|
221 |
* @since 3.0 |
|
222 |
*/ |
|
223 |
boolean reconnect(IConnection2 connection); |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
224 |
} |