public class

PersistenceController

extends Object
java.lang.Object
   ↳ vars.annotation.ui.PersistenceController

Class Overview

PersistenceService manages database transactions for the user-interface. It will keep the persistent objects AND the user interface in synch.

Summary

Public Constructors
PersistenceController(ToolBelt toolBelt)
Constructs ...
Public Methods
String getValidatedConceptName(String conceptName)
Look up the 'validate' name, that's the primary name for a given concept
static String makeVideoArchiveName(String platform, int seqNumber, int tapeNumber, String postfix)
Convenience method very specific to MBARI internal usage and naming conventions.
static Set<VideoFrame> toVideoFrames(Collection<Observation> observations)
Returns the unique videoframes associated with a collection of observations
Collection<Observation> updateAndValidate(Collection<Observation> observations)
Thread-safe.
Collection<CameraData> updateCameraDataUrls(VideoArchive videoArchive, File imageTarget, URL imageTargetMapping)
Changes the CameraData URL's that match the currently set local directory to use ther URL (image mapping target) defined in the uses preferences.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PersistenceController (ToolBelt toolBelt)

Constructs ...

Public Methods

public String getValidatedConceptName (String conceptName)

Look up the 'validate' name, that's the primary name for a given concept

Parameters
conceptName The string name to validate
Returns
  • The validated name. If it's not found in the knowledgebase then then the original string is returned.

public static String makeVideoArchiveName (String platform, int seqNumber, int tapeNumber, String postfix)

Convenience method very specific to MBARI internal usage and naming conventions. MBARI likes to name video archives so that a tape #3 from dive# 302 (seqNumber)using the ROV Tiburon (platform) would be named T0302-03.

Parameters
platform The platform name. THe first character of the name is used. This is stored in the VideoArchiveSet
seqNumber In MBARI's case we use dive number. seqNumber is stored in the CameraPlatformDeployment. Numbers with more than 4 digits are not supported.
tapeNumber This is an MBARI specific value. It is not stored in the VARS database. Numbers of more than 2 digits are not supported.
postfix This is any text to be appended to the end of the VideoArchive's name. At MBARI, we use this to indicate HD tapes by appending 'HD'. If it's null nothing will be appended
Returns
  • A string name that is generated from the supplied arguments

public static Set<VideoFrame> toVideoFrames (Collection<Observation> observations)

Returns the unique videoframes associated with a collection of observations

Parameters
observations A collection of observations
Returns
  • The unique videoframes

public Collection<Observation> updateAndValidate (Collection<Observation> observations)

Thread-safe. Updates changes made to the observations in the database. Validates the concept names used by the Observations and their child Association

public Collection<CameraData> updateCameraDataUrls (VideoArchive videoArchive, File imageTarget, URL imageTargetMapping)

Changes the CameraData URL's that match the currently set local directory to use ther URL (image mapping target) defined in the uses preferences.

Parameters
imageTarget The directory where the frames are saved into
imageTargetMapping The URL that maps imageTarget onto a web server
Returns
  • A Collection of CameraData objects whose URL's have been updated in the database. (Returns the udpated instance)
Throws
MalformedURLException