--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/AbstractConnection.java Fri Dec 18 09:34:05 2009 -0600
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/AbstractConnection.java Fri Dec 18 09:34:19 2009 -0600
@@ -24,7 +24,7 @@
import org.eclipse.jface.resource.ImageDescriptor;
import com.nokia.carbide.remoteconnections.internal.api.IConnection2;
-import com.nokia.carbide.remoteconnections.internal.api.IConnection2.IStatus.EStatus;
+import com.nokia.carbide.remoteconnections.internal.api.IConnection2.IConnectionStatus.EConnectionStatus;
import com.nokia.cpp.internal.api.utils.core.Check;
import com.nokia.cpp.internal.api.utils.core.ListenerList;
@@ -33,16 +33,16 @@
*/
public abstract class AbstractConnection implements IConnection2 {
- public class Status implements IStatus {
- private EStatus estatus;
+ public static class ConnectionStatus implements IConnectionStatus {
+ private EConnectionStatus estatus;
private String description;
- public Status(EStatus estatus, String description) {
+ public ConnectionStatus(EConnectionStatus estatus, String description) {
this.estatus = estatus;
this.description = description;
}
- public EStatus getEStatus() {
+ public EConnectionStatus getEConnectionStatus() {
return estatus;
}
@@ -50,7 +50,7 @@
return description;
}
- public void setEStatus(EStatus estatus) {
+ public void setEStatus(EConnectionStatus estatus) {
this.estatus = estatus;
}
@@ -64,14 +64,14 @@
private String name;
private String id;
private boolean dynamic;
- private IStatus status;
+ private IConnectionStatus status;
private ImageDescriptor imageDescriptor;
- private ListenerList<IStatusChangedListener> listeners;
+ private ListenerList<IConnectionStatusChangedListener> listeners;
public AbstractConnection(IConnectionType connectionType, Map<String, String> settings) {
this.connectionType = connectionType;
this.settings = new HashMap<String, String>(settings);
- status = new Status(EStatus.NOT_READY, ""); //$NON-NLS-1$
+ status = new ConnectionStatus(EConnectionStatus.NOT_READY, ""); //$NON-NLS-1$
}
public void dispose() {
@@ -114,22 +114,22 @@
this.dynamic = dynamic;
}
- public IStatus getStatus() {
+ public IConnectionStatus getStatus() {
return status;
}
- public void setStatus(IStatus status) {
+ public void setStatus(IConnectionStatus status) {
Check.checkArg(status);
this.status = status;
}
- public void addStatusChangedListener(IStatusChangedListener listener) {
+ public void addStatusChangedListener(IConnectionStatusChangedListener listener) {
if (listeners == null)
- listeners = new ListenerList<IStatusChangedListener>();
+ listeners = new ListenerList<IConnectionStatusChangedListener>();
listeners.add(listener);
}
- public void removeStatusChangedListener(IStatusChangedListener listener) {
+ public void removeStatusChangedListener(IConnectionStatusChangedListener listener) {
if (listeners != null)
listeners.remove(listener);
}
@@ -137,7 +137,7 @@
public void fireStatusChanged() {
if (listeners == null)
return;
- for (IStatusChangedListener listener : listeners) {
+ for (IConnectionStatusChangedListener listener : listeners) {
listener.statusChanged(status);
}
}
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionsManager.java Fri Dec 18 09:34:05 2009 -0600
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionsManager.java Fri Dec 18 09:34:19 2009 -0600
@@ -23,6 +23,8 @@
import org.eclipse.core.runtime.CoreException;
+import com.nokia.carbide.remoteconnections.internal.api.IConnection2;
+
/**
* An interface encapsulating the manager of connection objects
* @noimplement
@@ -184,17 +186,17 @@
* If a dynamic connection is disconnected, it is transitioned to a disconnected state while it
* is in use by some client service, and is eventually removed from the system once it is
* no longer in use.
- * @param connection IConnection
+ * @param connection IConnection2
* @since 3.0
*/
- void disconnect(IConnection connection);
+ void disconnect(IConnection2 connection);
/**
* Attempts to set a disconnected dynamic connection back to its in-use state.
* If the connection has not been removed from the system, and is still in-use,
* it will be restored. Returns true if successful in restoring the connection.
- * @param connection IConnection
+ * @param connection IConnection2
* @since 3.0
*/
- boolean reconnect(IConnection connection);
+ boolean reconnect(IConnection2 connection);
}
\ No newline at end of file
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/api/IConnection2.java Fri Dec 18 09:34:05 2009 -0600
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/api/IConnection2.java Fri Dec 18 09:34:19 2009 -0600
@@ -44,12 +44,12 @@
/**
* The status of a connection
*/
- public interface IStatus {
- enum EStatus {
+ public interface IConnectionStatus {
+ enum EConnectionStatus {
READY, NOT_READY, IN_USE, IN_USE_DISCONNECTED
};
- EStatus getEStatus();
+ EConnectionStatus getEConnectionStatus();
String getDescription();
}
@@ -58,33 +58,33 @@
* Gets this connection's status
* @return IStatus
*/
- IStatus getStatus();
+ IConnectionStatus getStatus();
/**
* Sets this connection's status
* @see IConnection2#getStatus()
* @param status IStatus
*/
- void setStatus(IStatus status);
+ void setStatus(IConnectionStatus status);
/**
* A listener for status changes
*/
- public interface IStatusChangedListener {
- void statusChanged(IStatus status);
+ public interface IConnectionStatusChangedListener {
+ void statusChanged(IConnectionStatus status);
}
/**
* Adds a listener for status changes
* @param listener IStatusChangedListener
*/
- void addStatusChangedListener(IStatusChangedListener listener);
+ void addStatusChangedListener(IConnectionStatusChangedListener listener);
/**
* Removes a listener for status changes
* @param listener IStatusChangedListener
*/
- void removeStatusChangedListener(IStatusChangedListener listener);
+ void removeStatusChangedListener(IConnectionStatusChangedListener listener);
/**
* An optional icon representing this connection.
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java Fri Dec 18 09:34:05 2009 -0600
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java Fri Dec 18 09:34:19 2009 -0600
@@ -534,14 +534,15 @@
return defaultConnection;
}
- public void disconnect(IConnection connection) {
+ public void disconnect(IConnection2 connection) {
+
// TODO transition to disconnected state and wait:
// if not in-use, remove and stop waiting
// if reconnected, stop waiting
}
- public boolean reconnect(IConnection connection) {
+ public boolean reconnect(IConnection2 connection) {
// TODO if not removed, transition out of disconnected state
// return not removed
return false;