author | dadubrow |
Thu, 17 Dec 2009 11:28:11 -0600 | |
changeset 698 | 9162f4cfad65 |
parent 687 | 593d05f9d5ca |
child 701 | 1912b5c050e6 |
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 |
||
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
26 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
27 |
* An interface encapsulating the manager of connection objects |
687 | 28 |
* @noimplement |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
29 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
30 |
public interface IConnectionsManager { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
31 |
|
687 | 32 |
/** |
33 |
* Listener interface for connection manager events |
|
34 |
* (These tend to be used internally by remote connections UI) |
|
35 |
* @deprecated |
|
36 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
37 |
public interface IConnectionsManagerListener { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
38 |
void connectionStoreChanged(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
39 |
void displayChanged(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
40 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
41 |
|
687 | 42 |
/** |
43 |
* Internal method for loading connections from persisted state |
|
44 |
* @deprecated |
|
45 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
46 |
void loadConnections(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
47 |
|
687 | 48 |
/** |
49 |
* Internal method for persisting connections |
|
50 |
* @deprecated |
|
51 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
52 |
void storeConnections(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
53 |
|
687 | 54 |
|
55 |
/** |
|
56 |
* Listener interface for connections which are added, removed and set as default |
|
57 |
* @since 3.0 |
|
58 |
*/ |
|
59 |
public interface IConnectionListener { |
|
60 |
void connectionAdded(IConnection connection); |
|
61 |
void connectionRemoved(IConnection connection); |
|
62 |
void defaultConnectionSet(IConnection connection); |
|
63 |
} |
|
64 |
||
65 |
/** |
|
66 |
* Add a listener for internal connection manager events |
|
67 |
* @param listener IConnectionsManagerListener |
|
68 |
* @deprecated |
|
69 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
70 |
void addConnectionStoreChangedListener(IConnectionsManagerListener listener); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
71 |
|
687 | 72 |
/** |
73 |
* Remove a listener for internal connection manager events |
|
74 |
* @param listener IConnectionsManagerListener |
|
75 |
* @deprecated |
|
76 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
77 |
void removeConnectionStoreChangedListener(IConnectionsManagerListener listener); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
78 |
|
687 | 79 |
/** |
80 |
* Add a connection to the system |
|
81 |
* @param connection IConnection |
|
82 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
83 |
void addConnection(IConnection connection); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
84 |
|
687 | 85 |
/** |
86 |
* Remove a connection from the system |
|
87 |
* @param connection IConnection |
|
88 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
89 |
void removeConnection(IConnection connection); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
90 |
|
687 | 91 |
/** |
92 |
* Return all connections in the system |
|
93 |
* @return Collection<IConnection> |
|
94 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
95 |
Collection<IConnection> getConnections(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
96 |
|
687 | 97 |
/** |
98 |
* Return all the connected services for a connection |
|
99 |
* @param connection IConnection |
|
100 |
* @return Collection<IConnectedService> |
|
101 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
102 |
Collection<IConnectedService> getConnectedServices(IConnection connection); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
103 |
|
687 | 104 |
/** |
105 |
* Returns a unique id to be used for a new connection |
|
106 |
* @return String |
|
107 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
108 |
String getUniqueConnectionId(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
109 |
|
687 | 110 |
/** |
111 |
* Returns whether some display name is in use for any existing connections |
|
112 |
* @param name String |
|
113 |
* @return boolean |
|
114 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
115 |
boolean connectionNameInUse(String name); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
116 |
|
687 | 117 |
/** |
118 |
* Fires internal display changed event |
|
119 |
* @deprecated |
|
120 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
121 |
void updateDisplays(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
122 |
|
687 | 123 |
/** |
124 |
* Returns the IClientServiceSiteUI for a service. Filters connection types to those that |
|
125 |
* are supported by the service. Connection list UI as well as new and edit wizards are filtered. |
|
126 |
* @param service IService |
|
127 |
* @return IClientServiceSiteUI |
|
128 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
129 |
IClientServiceSiteUI getClientSiteUI(IService service); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
130 |
|
687 | 131 |
/** |
132 |
* Internal method to create the connected service over a connection (for service testing) |
|
133 |
* @param service IService |
|
134 |
* @param connection IConnection |
|
135 |
* @return IConnectedService |
|
136 |
* @deprecated |
|
137 |
*/ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
138 |
IConnectedService createConnectedService(IService service, IConnection connection); |
687 | 139 |
|
140 |
/** |
|
141 |
* Add new IConnectionListener |
|
142 |
* @param listener IConnectionListener |
|
143 |
* @since 3.0 |
|
144 |
*/ |
|
145 |
void addConnectionListener(IConnectionListener listener); |
|
146 |
||
147 |
/** |
|
148 |
* Remove IConnectionListener |
|
149 |
* @param listener IConnectionListener |
|
150 |
* @since 3.0 |
|
151 |
*/ |
|
152 |
void removeConnectionListener(IConnectionListener listener); |
|
153 |
||
154 |
/** |
|
155 |
* Sets the default connection. |
|
156 |
* @param connection IConnection |
|
157 |
* @since 3.0 |
|
158 |
*/ |
|
159 |
void setDefaultConnection(IConnection connection); |
|
160 |
||
161 |
/** |
|
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
162 |
* Returns the default connection. |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
163 |
* @return IConnection |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
164 |
* @since 3.0 |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
165 |
*/ |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
166 |
IConnection getDefaultConnection(); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
167 |
|
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
687
diff
changeset
|
168 |
/** |
687 | 169 |
* Can be called by specific service implementors (e.g., debugger) to ensure some connection |
170 |
* exists and supports this service. If the connection does not exist or does not support |
|
171 |
* the service, a CoreException may be thrown after the framework attempts to allow the user |
|
172 |
* to correct the situation. If an IConnection is returned, it is assumed to be |
|
173 |
* a valid connection in the system that supports the service. |
|
174 |
* @param connectionId String |
|
175 |
* @param service IService |
|
176 |
* @return IConnection |
|
177 |
* @throws CoreException |
|
178 |
* @since 3.0 |
|
179 |
*/ |
|
180 |
IConnection ensureConnection(String connectionId, IService service) throws CoreException; |
|
181 |
||
182 |
/** |
|
183 |
* Sets a dynamic connection as disconnected. Is no-op on user generated connections. |
|
184 |
* If a dynamic connection is disconnected, it is transitioned to a disconnected state while it |
|
185 |
* is in use by some client service, and is eventually removed from the system once it is |
|
186 |
* no longer in use. |
|
187 |
* @param connection IConnection |
|
188 |
* @since 3.0 |
|
189 |
*/ |
|
190 |
void disconnect(IConnection connection); |
|
191 |
||
192 |
/** |
|
193 |
* Attempts to set a disconnected dynamic connection back to its in-use state. |
|
194 |
* If the connection has not been removed from the system, and is still in-use, |
|
195 |
* it will be restored. Returns true if successful in restoring the connection. |
|
196 |
* @param connection IConnection |
|
197 |
* @since 3.0 |
|
198 |
*/ |
|
199 |
boolean reconnect(IConnection connection); |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
200 |
} |