Package uk.ac.starlink.connect

# Interface Connector

public interface Connector
Interface for logging in to a remote facility.

Since:
  18 Feb 2005
Author:
  Mark Taylor (Starlink)

## Method Summary

Modifier and Type
Method
Description
`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<AuthKey,?> authValues)`
Attempts to open a connection.

## Method Details

### getName

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

Returns:
  connector type

### getIcon

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

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

Connection logIn(Map<AuthKey,?> 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