java.lang.Object |
↳ |
vars.shared.preferences.PreferencesService |
Class Overview
A convient interface for reading/writing some specialized preferences used
by VARS
Summary
Public Constructors |
|
PreferencesService(PreferencesFactory preferencesFactory)
Constructs ...
|
Public Methods |
boolean
|
findAutoconnectVcr(String hostname)
Returns the autoconnect setting
|
File
|
findDefaultImageTarget(String hostname)
Read the default URL used to write images to.
|
URL
|
findDefaultImageTargetMapping(String hostname)
Read the URL used to read images from a web server that were written to
imageTarget.
|
String
|
findFullVcrUrl(String username, String hostname)
|
File
|
findImageTarget(String username, String hostname)
Read the URL used to write images to.
|
URL
|
findImageTargetMapping(String username, String hostname)
Read the URL used to read images from a web server that were written to
imageTarget.
|
String
|
findLastVideoConnectionId(String hostname)
Returns the default VCR URL.
|
String
|
findVcrHostname(String username, String hostname)
Retrieve the hostname used to access a networked VCR
|
String
|
findVcrPort(String username, String hostname)
Retrieve the port number used to access a networked VCR
|
String
|
getHostname()
|
void
|
persistAutoconnectVcr(String hostname, boolean autoconnect)
Store the autoconnect setting
|
void
|
persistDefaultImageTarget(String hostname, File targetDirectory)
Write the URL used to write images to.
|
void
|
persistDefaultImageTargetMapping(String hostname, URL targetMappingURL)
Write the URL used to read images from a web server that were written to
imageTarget.
|
void
|
persistImageTarget(String username, String hostname, File targetDirectory)
Write the URL used to write images to.
|
void
|
persistImageTargetMapping(String username, String hostname, URL targetMappingURL)
Write the URL used to read images from a web server that were written to
imageTarget.
|
void
|
persistLastVideoConnectionId(String hostname, String vcrUrl)
Store the default (i.e.
|
void
|
persistVcrUrl(String username, String hostname, String vcrhost, String vcrport)
Save the UDP VCR's information
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0)
|
final
void
|
wait(long arg0, int arg1)
|
|
Public Constructors
public
PreferencesService
(PreferencesFactory preferencesFactory)
Public Methods
public
boolean
findAutoconnectVcr
(String hostname)
Returns the autoconnect setting
Returns
- true if you should autoconnect on startup, false otherwise
public
File
findDefaultImageTarget
(String hostname)
Read the default URL used to write images to.
Returns
- The Base URL where images should be written into
public
URL
findDefaultImageTargetMapping
(String hostname)
Read the URL used to read images from a web server that were written to
imageTarget.
Parameters
hostname
| The computer of interest |
Returns
- The Base URL on a web server that maps to imageTarget
public
String
findFullVcrUrl
(String username, String hostname)
public
File
findImageTarget
(String username, String hostname)
Read the URL used to write images to.
Returns
- The Base URL where images should be written into
public
URL
findImageTargetMapping
(String username, String hostname)
Read the URL used to read images from a web server that were written to
imageTarget.
Parameters
username
| The name of the user as logged into VARS |
hostname
| the name of the host computer |
Returns
- The Base URL on a web server that maps to imageTarget
public
String
findLastVideoConnectionId
(String hostname)
Returns the default VCR URL. In general this will be the last VCR
that was connected to on that host.
Parameters
hostname
| The hostname of the current system |
Returns
- The VCR URL. If it contains a colon its a UDP URL otherwise
it's a comm port.
public
String
findVcrHostname
(String username, String hostname)
Retrieve the hostname used to access a networked VCR
Parameters
username
| UserAccount.getUserName() |
hostname
| preferencesService.getHostname() |
public
String
findVcrPort
(String username, String hostname)
Retrieve the port number used to access a networked VCR
Parameters
username
| UserAccount.getUserName() |
hostname
| preferencesService.getHostname() |
public
String
getHostname
()
public
void
persistAutoconnectVcr
(String hostname, boolean autoconnect)
Store the autoconnect setting
public
void
persistDefaultImageTarget
(String hostname, File targetDirectory)
Write the URL used to write images to.
Parameters
hostname
| The current hostname of the platform that VARS is running on |
targetDirectory
| The URL to write images to.
|
public
void
persistDefaultImageTargetMapping
(String hostname, URL targetMappingURL)
Write the URL used to read images from a web server that were written to
imageTarget.
Parameters
hostname
| The name of the user as logged into VARS |
targetMappingURL
| The Base URL on a web server that maps to imageTarget
|
public
void
persistImageTarget
(String username, String hostname, File targetDirectory)
Write the URL used to write images to.
Parameters
username
| The username |
hostname
| The current hostname of the platform that VARS is running on |
targetDirectory
| The URL to write images to.
|
public
void
persistImageTargetMapping
(String username, String hostname, URL targetMappingURL)
Write the URL used to read images from a web server that were written to
imageTarget.
Parameters
username
| The name of the user as logged into VARS |
targetMappingURL
| The Base URL on a web server that maps to imageTarget
|
public
void
persistLastVideoConnectionId
(String hostname, String vcrUrl)
Store the default (i.e. last connect VCR URL in prefs). This should be
either the comm port name or a URL in the form of 'hostname:port' (for
example: oyashio.shore.mbari.org:9000)
public
void
persistVcrUrl
(String username, String hostname, String vcrhost, String vcrport)
Save the UDP VCR's information