author | stechong |
Wed, 20 Oct 2010 11:19:31 -0500 | |
changeset 2165 | 2a7b5eccb0bc |
parent 1544 | 93a010393cd9 |
permissions | -rw-r--r-- |
688 | 1 |
/** |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
700 | 18 |
package com.nokia.carbide.remoteconnections.internal.api; |
688 | 19 |
|
20 |
import java.net.URL; |
|
21 |
||
22 |
import org.eclipse.core.runtime.CoreException; |
|
23 |
||
24 |
/** |
|
25 |
* An interface to a device discovery agent |
|
899 | 26 |
* @since 2.5 |
688 | 27 |
*/ |
28 |
public interface IDeviceDiscoveryAgent { |
|
29 |
||
30 |
/** |
|
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
31 |
* An interface for discovery agents to implement that the manager uses |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
32 |
* before loading the agent to get errors about required components. |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
33 |
* <p> |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
34 |
* Every discovery agent must implement this interface. |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
35 |
*/ |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
36 |
public interface IPrerequisiteStatus { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
37 |
/** |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
38 |
* Is the status OK? |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
39 |
* @return boolean |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
40 |
*/ |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
41 |
boolean isOK(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
42 |
/** |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
43 |
* If status is not OK, return error message text. |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
44 |
* @return String |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
45 |
*/ |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
46 |
String getErrorText(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
47 |
/** |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
48 |
* Optionally return a URL for user to browse to for more information on error. |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
49 |
* @return URL |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
50 |
*/ |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
51 |
URL getURL(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
52 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
53 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
54 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
55 |
/** |
688 | 56 |
* Starts agent. Once started, runs until stopped. |
57 |
* @throws CoreException |
|
58 |
*/ |
|
59 |
void start() throws CoreException; |
|
60 |
||
61 |
/** |
|
62 |
* Stops agent. |
|
63 |
* @throws CoreException |
|
64 |
*/ |
|
65 |
void stop() throws CoreException; |
|
66 |
||
67 |
/** |
|
68 |
* Returns a URL to specific information about this discovery mechanism, |
|
69 |
* troubleshooting, etc. |
|
70 |
* @return URL |
|
71 |
*/ |
|
72 |
URL getInformation(); |
|
73 |
||
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
74 |
/** |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
75 |
* Returns a display name for the particular discovery agent in case we need to |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
76 |
* let the user know errors from the agents. |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
77 |
* @return String |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
78 |
*/ |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
79 |
String getDisplayName(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
80 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
81 |
/** |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
82 |
* Manager will call this to get any status of prerequisites not satisfied before |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
83 |
* the manager calls start(). The agent should check its prerequisites at this time. |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
84 |
* <p> |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
85 |
* If the agent has no prerequisites return a status of OK. |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
86 |
* @return IPrerequisiteStatus |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
87 |
*/ |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
88 |
IPrerequisiteStatus getPrerequisiteStatus(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
700
diff
changeset
|
89 |
|
1544 | 90 |
/** |
91 |
* Return whether this discovery agent is running |
|
92 |
* @return boolean |
|
93 |
*/ |
|
94 |
boolean isRunning(); |
|
95 |
||
96 |
/** |
|
97 |
* The unique id for this agent |
|
98 |
* @return String |
|
99 |
*/ |
|
100 |
String getId(); |
|
101 |
||
688 | 102 |
// In addition, there may need to be an additional API to do a deeper form of discovery for |
103 |
// connection mechanisms that require pairing (like BT or Wifi). In these cases, normal discovery |
|
104 |
// will probably be for already paired devices, however, the user will want to discover all |
|
105 |
// potential devices from some UI in order to set up a paired device. |
|
106 |
// A method for doing this will need to be added. |
|
107 |
||
108 |
} |