uk.ac.starlink.connect
Interface Connector


public interface Connector

Interface for logging in to a remote facility.

Since:
18 Feb 2005

Method Summary
 Icon getIcon()
          Returns an icon which labels this connector.
 AuthKey[] getKeys()
          Returns an array of authorization keys whose values are required to attempt a connection.
 String getName()
          Returns the name of the type of facility to which this connector can connect.
 Connection logIn(Map authValues)
          Attempts to open a connection.
 

Method Detail

getName

public String getName()
Returns the name of the type of facility to which this connector can connect.


getIcon

public Icon getIcon()
Returns an icon which labels this connector. The icon should preferably be 20x20 pixels. Null may be returned if you have no suitable icon.

Returns:
icon for this connector

getKeys

public AuthKey[] getKeys()
Returns an array of authorization keys whose values are required to attempt a connection. These will commonly include name and password keys, but there may be others.

Returns:
authorization keys

logIn

public Connection logIn(Map authValues)
                 throws IOException
Attempts to open a connection. The supplied authValues map contains an entry for each of the keys returned by getKeys(), with the entry's value being the value for that key. Thus the values will typically be the user's name, password, etc. The values will be either String or char[] values or null (char[] may be used for hidden values for security reasons).

Parameters:
authValues - AuthKey->value map containing connection information
Returns:
a live connection object
Throws:
IOException - if there was some error, for instance authorization failure

Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved.