connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IConnectionsManager.java
changeset 687 593d05f9d5ca
parent 0 fb279309251b
child 698 9162f4cfad65
equal deleted inserted replaced
686:745a1a177838 687:593d05f9d5ca
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 package com.nokia.carbide.remoteconnections.interfaces;
    19 package com.nokia.carbide.remoteconnections.interfaces;
    20 
    20 
    21 
    21 
    22 import java.util.Collection;
    22 import java.util.Collection;
    23 
    23 
       
    24 import org.eclipse.core.runtime.CoreException;
       
    25 
    24 /**
    26 /**
    25  * An interface encapsulating the manager of connection objects
    27  * An interface encapsulating the manager of connection objects
       
    28  * @noimplement
    26  */
    29  */
    27 public interface IConnectionsManager {
    30 public interface IConnectionsManager {
    28 
    31 
       
    32 	/**
       
    33 	 * Listener interface for connection manager events
       
    34 	 * (These tend to be used internally by remote connections UI)
       
    35 	 * @deprecated
       
    36 	 */
    29 	public interface IConnectionsManagerListener {
    37 	public interface IConnectionsManagerListener {
    30 		void connectionStoreChanged();
    38 		void connectionStoreChanged();
    31 		void displayChanged();
    39 		void displayChanged();
    32 	}
    40 	}
    33 
    41 
       
    42 	/**
       
    43 	 * Internal method for loading connections from persisted state
       
    44 	 * @deprecated
       
    45 	 */
    34 	void loadConnections();
    46 	void loadConnections();
    35 
    47 
       
    48 	/**
       
    49 	 * Internal method for persisting connections
       
    50 	 * @deprecated
       
    51 	 */
    36 	void storeConnections();
    52 	void storeConnections();
    37 
    53 
       
    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 	 */
    38 	void addConnectionStoreChangedListener(IConnectionsManagerListener listener);
    70 	void addConnectionStoreChangedListener(IConnectionsManagerListener listener);
    39 	
    71 	
       
    72 	/**
       
    73 	 * Remove a listener for internal connection manager events
       
    74 	 * @param listener IConnectionsManagerListener
       
    75 	 * @deprecated
       
    76 	 */
    40 	void removeConnectionStoreChangedListener(IConnectionsManagerListener listener);
    77 	void removeConnectionStoreChangedListener(IConnectionsManagerListener listener);
    41 
    78 
       
    79 	/**
       
    80 	 * Add a connection to the system
       
    81 	 * @param connection IConnection
       
    82 	 */
    42 	void addConnection(IConnection connection);
    83 	void addConnection(IConnection connection);
    43 
    84 
       
    85 	/**
       
    86 	 * Remove a connection from the system
       
    87 	 * @param connection IConnection
       
    88 	 */
    44 	void removeConnection(IConnection connection);
    89 	void removeConnection(IConnection connection);
    45 
    90 
       
    91 	/**
       
    92 	 * Return all connections in the system
       
    93 	 * @return Collection<IConnection>
       
    94 	 */
    46 	Collection<IConnection> getConnections();
    95 	Collection<IConnection> getConnections();
    47 	
    96 	
       
    97 	/**
       
    98 	 * Return all the connected services for a connection
       
    99 	 * @param connection IConnection
       
   100 	 * @return Collection<IConnectedService>
       
   101 	 */
    48 	Collection<IConnectedService> getConnectedServices(IConnection connection);
   102 	Collection<IConnectedService> getConnectedServices(IConnection connection);
    49 	
   103 	
       
   104 	/**
       
   105 	 * Returns a unique id to be used for a new connection
       
   106 	 * @return String
       
   107 	 */
    50 	String getUniqueConnectionId();
   108 	String getUniqueConnectionId();
    51 	
   109 	
       
   110 	/**
       
   111 	 * Returns whether some display name is in use for any existing connections
       
   112 	 * @param name String
       
   113 	 * @return boolean
       
   114 	 */
    52 	boolean connectionNameInUse(String name);
   115 	boolean connectionNameInUse(String name);
    53 	
   116 	
       
   117 	/**
       
   118 	 * Fires internal display changed event
       
   119 	 * @deprecated
       
   120 	 */
    54 	void updateDisplays();
   121 	void updateDisplays();
    55 	
   122 	
       
   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 	 */
    56 	IClientServiceSiteUI getClientSiteUI(IService service);
   129 	IClientServiceSiteUI getClientSiteUI(IService service);
    57 	
   130 	
       
   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 	 */
    58 	IConnectedService createConnectedService(IService service, IConnection connection);
   138 	IConnectedService createConnectedService(IService service, IConnection connection);
       
   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 	/**
       
   162 	 * Can be called by specific service implementors (e.g., debugger) to ensure some connection
       
   163 	 * exists and supports this service. If the connection does not exist or does not support
       
   164 	 * the service, a CoreException may be thrown after the framework attempts to allow the user
       
   165 	 * to correct the situation. If an IConnection is returned, it is assumed to be 
       
   166 	 * a valid connection in the system that supports the service.
       
   167 	 * @param connectionId String
       
   168 	 * @param service IService
       
   169 	 * @return IConnection
       
   170 	 * @throws CoreException
       
   171 	 * @since 3.0
       
   172 	 */
       
   173 	IConnection ensureConnection(String connectionId, IService service) throws CoreException;
       
   174 	
       
   175 	/**
       
   176 	 * Sets a dynamic connection as disconnected. Is no-op on user generated connections.
       
   177 	 * If a dynamic connection is disconnected, it is transitioned to a disconnected state while it
       
   178 	 * is in use by some client service, and is eventually removed from the system once it is 
       
   179 	 * no longer in use. 
       
   180 	 * @param connection IConnection
       
   181 	 * @since 3.0
       
   182 	 */
       
   183 	void disconnect(IConnection connection);
       
   184 	
       
   185 	/**
       
   186 	 * Attempts to set a disconnected dynamic connection back to its in-use state. 
       
   187 	 * If the connection has not been removed from the system, and is still in-use, 
       
   188 	 * it will be restored. Returns true if successful in restoring the connection.
       
   189 	 * @param connection IConnection
       
   190 	 * @since 3.0
       
   191 	 */
       
   192 	boolean reconnect(IConnection connection);
    59 }
   193 }