uk.ac.starlink.astrogrid
Class AcrConnector

java.lang.Object
  extended by uk.ac.starlink.astrogrid.AcrConnector
All Implemented Interfaces:
Connector

public class AcrConnector
extends Object
implements Connector

Connector which connects to MySpace using the ACR (Astronomy/Astrogrid Client Runtime) server written by Noel Winstanley. This currently uses the XML-RPC interface to the ACR, since this is presumed to make these classes less vulnerable to changes in the ACR interface, and we're only using a small amount of the functionality.

Since:
9 Sep 2005
Author:
Mark Taylor
See Also:
ACR

Field Summary
static String CACHE_PROPERTY
          Boolean-valued property which determines whether MySpace directories are to be cached.
 
Constructor Summary
AcrConnector()
           
 
Method Summary
static boolean getCacheDirectories()
          Determines whether directories should be cached by default in connections produced by this connector.
 Icon getIcon()
          Returns an icon which labels this connector.
 AuthKey[] getKeys()
          Returns an empty array.
 String getName()
          Returns the name of the type of facility to which this connector can connect.
 Connection logIn()
          Attempts to open a connection.
 Connection logIn(Map authValues)
          Attempts to open a connection.
static void main(String[] args)
          Utility method which calls one of the ACR services using XML-RPC and prints the result to standard output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_PROPERTY

public static final String CACHE_PROPERTY
Boolean-valued property which determines whether MySpace directories are to be cached. Setting this true will probably lead to incorrect behaviour (directories not being updated with new files) but may be worthwhile as a workaround for the atrocious performance exhibited by MySpace at time of writing (April 2006).

See Also:
Constant Field Values
Constructor Detail

AcrConnector

public AcrConnector()
Method Detail

getName

public String getName()
Description copied from interface: Connector
Returns the name of the type of facility to which this connector can connect.

Specified by:
getName in interface Connector

getKeys

public AuthKey[] getKeys()
Returns an empty array. This connector needs no authentication, since any authentication which has to be done is taken care of by the ACR itself at the other end of a remote connection.

Specified by:
getKeys in interface Connector
Returns:
empty key array

getIcon

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

Specified by:
getIcon in interface Connector
Returns:
icon for this connector

logIn

public Connection logIn(Map authValues)
                 throws IOException
Description copied from interface: Connector
Attempts to open a connection. The supplied authValues map contains an entry for each of the keys returned by Connector.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).

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

logIn

public Connection logIn()
                 throws IOException
Attempts to open a connection.

Returns:
a live connection object
Throws:
IOException - if there was some error, for instance authorization failure

getCacheDirectories

public static boolean getCacheDirectories()
Determines whether directories should be cached by default in connections produced by this connector. Result is based on the (boolean) value of the CACHE_PROPERTY property. If the property is unset, it will return false.

Returns:
true iff directories should be cached by default

main

public static void main(String[] args)
                 throws Exception
Utility method which calls one of the ACR services using XML-RPC and prints the result to standard output. The first argument is the fully-qualified name of the service, and any subsequent ones are arguments to it.

Parameters:
args - argument
Throws:
Exception


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.