Version: 1.1.1

ca.ucalgary.seahawk.util
Class SeahawkOptions

java.lang.Object
  extended by ca.ucalgary.seahawk.util.SeahawkOptions

public class SeahawkOptions
extends Object

A class for storing user preferences affecting the behaviour of Seahawk.


Field Summary
static String CACHE_POLICY_PROP
           
static String CONVERTER_HOST_PROP
           
static String CONVERTER_PORT_PROP
           
static String CUSTOM_REGISTRY_SYNONYM
           
static String PROPS_FILE_COMMENT
           
static String PROPS_FILE_ENCODING
           
static String PROPS_FILE_NAME
           
static String PROPS_FILE_SYS_PROPERTY
           
static String REFERRER_POLICY_PROP
           
static String REGISTRY_ENDPOINT_PROP
           
static String REGISTRY_NAMESPACE_PROP
           
static String REGISTRY_SYNONYM_PROP
           
static String TEMP_DIR_PROP
           
 
Constructor Summary
SeahawkOptions()
           
 
Method Summary
static double getCacheExpiry()
           
static File getDefaultsFile()
           
static String getDocConverterHost()
          May be null (in which case conversions will not be available)
static int getDocConverterPort()
           
static Registry getRegistry()
           
static boolean getSendReferrerPolicy()
           
static File getTempDir()
           
static void restoreSettings()
          Sets the options based on a shortcircuiting set of rules (PROPS_FILE_SYS_PROPERTY, java.io.tmpdir/PROPS_FILE_NAME), using a properties file saved in the location saveSettings() puts it.
static void restoreSettings(URL u)
          Sets the options based on the contents of the file (created with saveSettings()).
static boolean saveSettings()
          Saves the current values of the preferences to a default location that restoreSettings() will use too.
static void saveSettings(OutputStream os)
          Store the settings in text form that can be understood by restoreSettings().
static void setCacheExpiry(double hours)
           
static void setDocConverterHost(String hostname)
          For more details on how to run your own file converter, see http://www.artofsolving.com/node/10
static void setDocConverterPort(int port)
           
static void setRegistry(Registry reg)
           
static void setSendReferrerPolicy(boolean send)
           
static void setTempDir(File dir)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_POLICY_PROP

public static final String CACHE_POLICY_PROP
See Also:
Constant Field Values

REFERRER_POLICY_PROP

public static final String REFERRER_POLICY_PROP
See Also:
Constant Field Values

TEMP_DIR_PROP

public static final String TEMP_DIR_PROP
See Also:
Constant Field Values

REGISTRY_SYNONYM_PROP

public static final String REGISTRY_SYNONYM_PROP
See Also:
Constant Field Values

REGISTRY_ENDPOINT_PROP

public static final String REGISTRY_ENDPOINT_PROP
See Also:
Constant Field Values

REGISTRY_NAMESPACE_PROP

public static final String REGISTRY_NAMESPACE_PROP
See Also:
Constant Field Values

CONVERTER_HOST_PROP

public static final String CONVERTER_HOST_PROP
See Also:
Constant Field Values

CONVERTER_PORT_PROP

public static final String CONVERTER_PORT_PROP
See Also:
Constant Field Values

CUSTOM_REGISTRY_SYNONYM

public static final String CUSTOM_REGISTRY_SYNONYM
See Also:
Constant Field Values

PROPS_FILE_NAME

public static final String PROPS_FILE_NAME
See Also:
Constant Field Values

PROPS_FILE_COMMENT

public static final String PROPS_FILE_COMMENT
See Also:
Constant Field Values

PROPS_FILE_ENCODING

public static final String PROPS_FILE_ENCODING
See Also:
Constant Field Values

PROPS_FILE_SYS_PROPERTY

public static final String PROPS_FILE_SYS_PROPERTY
See Also:
Constant Field Values
Constructor Detail

SeahawkOptions

public SeahawkOptions()
Method Detail

restoreSettings

public static void restoreSettings()
Sets the options based on a shortcircuiting set of rules (PROPS_FILE_SYS_PROPERTY, java.io.tmpdir/PROPS_FILE_NAME), using a properties file saved in the location saveSettings() puts it.


restoreSettings

public static void restoreSettings(URL u)
                            throws Exception
Sets the options based on the contents of the file (created with saveSettings()).

Throws:
Exception

saveSettings

public static void saveSettings(OutputStream os)
                         throws IOException
Store the settings in text form that can be understood by restoreSettings().

Throws:
IOException

saveSettings

public static boolean saveSettings()
Saves the current values of the preferences to a default location that restoreSettings() will use too.

Returns:
true of the save was successful, false otherwise

getDefaultsFile

public static File getDefaultsFile()
Returns:
the file system location where preferences are stored (whether the file currently exists or not)

setCacheExpiry

public static void setCacheExpiry(double hours)
Parameters:
hours - the number of hours cached data (e.g. ontologies & service lookups) are valid for, 0 or negative numbers meaning until Seahawk is closed

getCacheExpiry

public static double getCacheExpiry()
Returns:
the number of hours cached data (e.g. ontologies & service lookups) are valid for

getRegistry

public static Registry getRegistry()
Returns:
the Moby registry that will be used by default to resolve services, data types, etc.

setRegistry

public static void setRegistry(Registry reg)
Parameters:
reg - the Moby registry that should be used by default to resolve services, data types, etc.

getTempDir

public static File getTempDir()
Returns:
where temporary files are stored

setTempDir

public static void setTempDir(File dir)
                       throws Exception
Parameters:
dir - directory where temporary files should be stored
Throws:
Exception - if the parameter is not a directory, or cannot be created or written to

setSendReferrerPolicy

public static void setSendReferrerPolicy(boolean send)
Parameters:
send - true if Seahawk should send a referrer service HTTP header to services, otherwise false

getSendReferrerPolicy

public static boolean getSendReferrerPolicy()
Returns:
true if Seahawk should send a referrer service HTTP header to services, otherwise false

setDocConverterPort

public static void setDocConverterPort(int port)
                                throws Exception
Parameters:
port - positive number representing where the OpenOffice file converter is listening
Throws:
Exception

getDocConverterPort

public static int getDocConverterPort()
Returns:
the port number on which OpenOffice is listening, waiting to do document format conversion

setDocConverterHost

public static void setDocConverterHost(String hostname)
For more details on how to run your own file converter, see http://www.artofsolving.com/node/10

Parameters:
hostname - machine on which an OpenOffice file converter is running

getDocConverterHost

public static String getDocConverterHost()
May be null (in which case conversions will not be available)


Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010