jwo.vfc.hub
Class Metadata

java.lang.Object
  |
  +--jwo.vfc.hub.Metadata

public class Metadata
extends Object

Class for encapsulating VFC metadata. Note that not all metadata fields are validated by this class. That should be the responsibility of the metadatabase.

Version:
1.2.3, 21st December, 1999.
Author:
Jo Wood

Constructor Summary
Metadata()
          Creates a new Metadata object.
 
Method Summary
 boolean checkIntegrity()
          Validates the integrity of the metadata.
 boolean checkMinimum()
          Checks whether the compulsory fields are filled.
 boolean extract(String metaKey)
          Stores the metadata items identified in keyword-argument pairs.
 String getAccess()
          Identifies the read/write access of the object.
 String getAnimSound()
          Identifies whether animation has a soundtrack.
 String getAuthor()
          Identifies the primary author(s) associated with the object.
 String getBearing()
          Identifies the bearing usually associated with landscape images.
 String getCommand()
          Creates a command string which consists of the keyword argument pairs necessary to represent all metadata stored in this class.
 String getContributor()
          Identifies the secondary contributor(s) associated with the object.
 String getDatabaseFile()
          Identifies the database file name.
 String getDateTime()
          Identifies the date/time of data collection.
 String getDescription()
          Identifies the description associated with the object (used for captions etc.).
 String getDirName()
          Identifies the object's original directory name.
 String getEast()
          Identifies the eastern boundary of the object's spatial extent.
 String getError()
          Reports any conversion errors associated with creating the metadata structure.
 String getFileName()
          Identifies the object's original file name.
 String getFormat()
          Identifies the format of the object.
 String getFOV()
          Identifies the field of view usually associated with landscape images.
 String getGazetteer()
          Identifies the gazetteer keywords associated with an object's spatial location.
 String getKeyword()
          Identifies the keywords associated with the object.
 String getLanguage()
          Identifies the language associated with object.
 String getLink()
          Identifies the numbers of any objects linked with this one.
 String getMiscNotes()
          Identifies any additional notes associated with miscellaneous data types.
 String getNorth()
          Identifies the northern boundary of the object's spatial extent.
 String getNotes()
          Identifies any additional notes associated with the object.
 int getObjectID()
          Identifies the object's unique ID.
 String getObjectType()
          Identifies the type of object.
 String getOwner()
          Identifies the owner of the object.
 String getProjection()
          Identifies the type of projection associated with spatial objects.
 String getRights()
          Identifies ownership, copyright, IPR and distribution rights of object.
 String getSource()
          Identifies the original source of the object.
 String getSouth()
          Identifies the southern boundary of the object's spatial extent.
 String getSpatialType()
          Identifies the type of spatial object stored.
 String getWest()
          Identifies the western boundary of the object's spatial extent.
 String getXCoord()
          Identifies the x-coordinate of the object's point location.
 String getYCoord()
          Identifies the y-coordinate of the object's point location.
 void merge(Metadata newMetadata)
          Merges the contents of a given metadata structure with this one.
 void setAccess(String access)
          Sets the read/write access of the object.
 void setAnimSound(String soundtrack)
          Sets the flag identifying whether the animation has a soundtrack.
 void setAuthor(String author)
          Sets the primary author(s) associated with the object.
 void setBearing(String bearing)
          Sets the bearing usually associated with landscape images.
 void setContributor(String contributor)
          Sets the secondary contributor(s) to the object.
 void setDatabaseFile(String fileName)
          Sets the database file name.
 void setDateTime(String dateTime)
          Sets the date/time of data collection.
 void setDescription(String description)
          Sets the description associated with the object.
 void setDirName(String dirName)
          Sets the object's original directory name.
 void setEast(String east)
          Sets the eastern boundary of the object's spatial extent.
 void setFileName(String fileName)
          Sets the object's original file name.
 void setFormat(String format)
          Sets the format of the object.
 void setFOV(String fov)
          Sets the field of view usually associated with landscape images.
 void setGazetteer(String placeNames)
          Sets the gazetteer keywords associated with an object's spatial location.
 void setKeyword(String keyword)
          Sets the keywords associated with the object.
 void setLanguage(String language)
          Sets the language associated with the object.
 void setLink(String links)
          Sets any linked object IDs associated with this object.
 void setMiscNotes(String miscNotes)
          Sets the notes associated with miscellaneous data types.
 void setNorth(String north)
          Sets the northern boundary of the object's spatial extent.
 void setNotes(String notes)
          Sets the notes associated with the object.
 void setObjectID(int objectID)
          Sets the object's unique ID.
 void setObjectType(String objectType)
          Sets the type of object.
 void setOwner(String owner)
          Sets the owner of the object.
 void setProjection(String projection)
          Sets the type of projection associated with spatial object.
 void setRights(String rights)
          Sets the ownership and distribution rights of the object.
 void setSource(String source)
          Sets the original source of the object.
 void setSouth(String south)
          Sets the southern boundary of the object's spatial extent.
 void setSpatialType(String type)
          Sets the type of spatial object.
 void setWest(String west)
          Sets the western boundary of the object's spatial extent.
 void setXCoord(String xCoord)
          Sets the x-coordinate of the object's point location.
 void setYCoord(String yCoord)
          Sets the y-coordinate of the object's point location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Metadata

public Metadata()
Creates a new Metadata object.

Method Detail

extract

public boolean extract(String metaKey)
Stores the metadata items identified in keyword-argument pairs. Pairs should be space separated. e.g. fileName image.gif format GIF wtc. Arguments with multiple words should be enclosed in quotes at the first level and braces at the second. e.g. author "Jo Wood" keyword {"Dartmoor" "National Park"}. This is the inverse of the getCommand() method. This method can be used when parsing a client request after removing the first command. e.g. PUT objectType image format GIF etc.

Returns:
True if all items identified and stored.
See Also:
getCommand()

getCommand

public String getCommand()
Creates a command string which consists of the keyword argument pairs necessary to represent all metadata stored in this class. This is the inverse operation of the extract method.

Returns:
String containing keyword-argument pairs.
See Also:
extract(java.lang.String)

merge

public void merge(Metadata newMetadata)
Merges the contents of a given metadata structure with this one. Where the same field is full in both structures, the new one takes priority. All fields may be changed with the exceptions of the objectID and database filename.

Parameters:
newMetadata - Metadata to merge with this structure.

checkMinimum

public boolean checkMinimum()
Checks whether the compulsory fields are filled.

Returns:
True if compulsory fields are filled.

checkIntegrity

public boolean checkIntegrity()
Validates the integrity of the metadata. This method should be called before sending a PUT request to the HubServer so that the database remains internally consistent.

Returns:
True if metadata seem internally consistent.

getObjectID

public int getObjectID()
Identifies the object's unique ID. This may be undefined if the object has not yet been placed in the metadatabase.

Returns:
Object identifier, or -1 if undefined.

getFileName

public String getFileName()
Identifies the object's original file name. Note this is not necessarily the one used by the database, nor is it necessarily the file written when requested from the hub. It is provided for information only, so that Application Components can reconstruct local file stores.

Returns:
The object's original file name.

getDirName

public String getDirName()
Identifies the object's original directory name. Note this is not necessarily the one used by the database, nor is it necessarily the file written when requested from the hub. It is provided for information only, so that Application Components can reconstruct local file stores.

Returns:
The object's original file directory.

getDatabaseFile

public String getDatabaseFile()
Identifies the database file name. This is the one stored by the hub and written to a client's directory when requested.

Returns:
The object's database file name.

getObjectType

public String getObjectType()
Identifies the type of object. (e.g. rasterMap, image, animation etc.)

Returns:
Type of object.

getFormat

public String getFormat()
Identifies the format of the object. (e.g. JPEG or GIF for images, AVI or MPEG for video etc.)

Returns:
Object file format.

getOwner

public String getOwner()
Identifies the owner of the object.

Returns:
Owner of the object.

getAccess

public String getAccess()
Identifies the read/write access of the object. Can be 'r' (global read), 'w' (global read/write) or 'o' (owner read/write).

Returns:
Object access rights.

getBearing

public String getBearing()
Identifies the bearing usually associated with landscape images.

Returns:
Object bearing.

getFOV

public String getFOV()
Identifies the field of view usually associated with landscape images.

Returns:
Object field of view.

getAnimSound

public String getAnimSound()
Identifies whether animation has a soundtrack.

Returns:
Indication of whether soundtrack is stored with animation.

getSpatialType

public String getSpatialType()
Identifies the type of spatial object stored.

Returns:
Type of spatial object (point, line, area, surface, volume etc.).

getProjection

public String getProjection()
Identifies the type of projection associated with spatial objects.

Returns:
Type of projection associated with spatial object.

getXCoord

public String getXCoord()
Identifies the x-coordinate of the object's point location.

Returns:
x-coordinate of point location.

getYCoord

public String getYCoord()
Identifies the y-coordinate of the object's point location.

Returns:
y-coordinate of point location.

getNorth

public String getNorth()
Identifies the northern boundary of the object's spatial extent.

Returns:
Northern boundary of spatial extent.

getSouth

public String getSouth()
Identifies the southern boundary of the object's spatial extent.

Returns:
Southern boundary of spatial extent.

getEast

public String getEast()
Identifies the eastern boundary of the object's spatial extent.

Returns:
Eastern boundary of spatial extent.

getWest

public String getWest()
Identifies the western boundary of the object's spatial extent.

Returns:
Western boundary of spatial extent.

getGazetteer

public String getGazetteer()
Identifies the gazetteer keywords associated with an object's spatial location.

Returns:
Gazetteer keywords.

getKeyword

public String getKeyword()
Identifies the keywords associated with the object.

Returns:
Keywords.

getDescription

public String getDescription()
Identifies the description associated with the object (used for captions etc.).

Returns:
Description of the object.

getNotes

public String getNotes()
Identifies any additional notes associated with the object.

Returns:
Notes associated with object.

getMiscNotes

public String getMiscNotes()
Identifies any additional notes associated with miscellaneous data types.

Returns:
Notes associated with miscellaneous data types.

getLanguage

public String getLanguage()
Identifies the language associated with object.

Returns:
Language associated with object.

getDateTime

public String getDateTime()
Identifies the date/time of data collection.

Returns:
Date/time of data collection.

getAuthor

public String getAuthor()
Identifies the primary author(s) associated with the object.

Returns:
Primary author(s) of the data object.

getContributor

public String getContributor()
Identifies the secondary contributor(s) associated with the object.

Returns:
Secondary contributor(s) to the object.

getSource

public String getSource()
Identifies the original source of the object.

Returns:
Original source of the object.

getRights

public String getRights()
Identifies ownership, copyright, IPR and distribution rights of object.

Returns:
Ownership rights of object.

getLink

public String getLink()
Identifies the numbers of any objects linked with this one. If more than one object is linked, it should be enclosed in "quotes".

Returns:
Linked object id(s).

getError

public String getError()
Reports any conversion errors associated with creating the metadata structure.

Returns:
Conversion error message.

setObjectID

public void setObjectID(int objectID)
Sets the object's unique ID. This should only be set after getting the relevant ID from the metadatbase.

Parameters:
objectID - Object identifier, or -1 if undefined.

setFileName

public void setFileName(String fileName)
Sets the object's original file name. Note this is not necessarily the one used by the database, nor is it necessarily the file written when requested from the hub. It is provided for information only, so that Application Components can reconstruct local file stores.

Parameters:
fileName - The object's original file name.

setDirName

public void setDirName(String dirName)
Sets the object's original directory name. Note this is not necessarily the one used by the database, nor is it necessarily the file written when requested from the hub. It is provided for information only, so that Application Components can reconstruct local file stores.

Parameters:
dirName - The object's original directory.

setDatabaseFile

public void setDatabaseFile(String fileName)
Sets the database file name. This is the one that is stored in the metadatabase and written to the client's directory when requested.

Parameters:
fileName - Name of databaseFile.

setObjectType

public void setObjectType(String objectType)
Sets the type of object. (e.g. rasterMap, image, animation etc.)

Parameters:
objectType - Type of object.

setFormat

public void setFormat(String format)
Sets the format of the object. (e.g. JPEG or GIF for images, AVI or MPEG for video etc.)

Parameters:
format - Object file format.

setOwner

public void setOwner(String owner)
Sets the owner of the object.

Parameters:
owner - Owner of the object.

setAccess

public void setAccess(String access)
Sets the read/write access of the object. Can be 'r' (global read), 'w' (global read/write) or 'o' (owner read/write).

Parameters:
access - Object access rights.

setBearing

public void setBearing(String bearing)
Sets the bearing usually associated with landscape images.

Parameters:
bearing - Object bearing.

setFOV

public void setFOV(String fov)
Sets the field of view usually associated with landscape images.

Parameters:
fov - Object field of view.

setAnimSound

public void setAnimSound(String soundtrack)
Sets the flag identifying whether the animation has a soundtrack.

Parameters:
soundtrack - True or False depending on presence of soundtrack.

setSpatialType

public void setSpatialType(String type)
Sets the type of spatial object.

Parameters:
type - Type of spatial object (point, line, area, surface, volume).

setProjection

public void setProjection(String projection)
Sets the type of projection associated with spatial object.

Parameters:
projection - Type of projection associated with spatial object.

setXCoord

public void setXCoord(String xCoord)
Sets the x-coordinate of the object's point location.

Parameters:
xCoord - x-coordinate of point location.

setYCoord

public void setYCoord(String yCoord)
Sets the y-coordinate of the object's point location.

Parameters:
yCoord - y-coordinate of point location.

setNorth

public void setNorth(String north)
Sets the northern boundary of the object's spatial extent.

Parameters:
north - Northern boundary of spatial extent.

setSouth

public void setSouth(String south)
Sets the southern boundary of the object's spatial extent.


setEast

public void setEast(String east)
Sets the eastern boundary of the object's spatial extent.

Parameters:
east - Eastern boundary of spatial extent.

setWest

public void setWest(String west)
Sets the western boundary of the object's spatial extent.

Parameters:
west - Western boundary of spatial extent.

setGazetteer

public void setGazetteer(String placeNames)
Sets the gazetteer keywords associated with an object's spatial location.

Parameters:
placeNames - gazetteer keywords.

setKeyword

public void setKeyword(String keyword)
Sets the keywords associated with the object.


setDescription

public void setDescription(String description)
Sets the description associated with the object.

Parameters:
description - Description of the data object.

setNotes

public void setNotes(String notes)
Sets the notes associated with the object.

Parameters:
notes - Notes associated with the data object.

setMiscNotes

public void setMiscNotes(String miscNotes)
Sets the notes associated with miscellaneous data types.


setLanguage

public void setLanguage(String language)
Sets the language associated with the object.

Parameters:
language - Language associated with the data object.

setDateTime

public void setDateTime(String dateTime)
Sets the date/time of data collection.

Parameters:
dateTime - Date/time of data collection.

setAuthor

public void setAuthor(String author)
Sets the primary author(s) associated with the object.

Parameters:
author - Primary author(s) of the object.

setContributor

public void setContributor(String contributor)
Sets the secondary contributor(s) to the object.

Parameters:
contributor - Secondary contributor(s) to the object.

setSource

public void setSource(String source)
Sets the original source of the object.

Parameters:
source - Original source of the object.

setRights

public void setRights(String rights)
Sets the ownership and distribution rights of the object.

Parameters:
rights - Ownership and distribution rights of the object.

setLink

public void setLink(String links)
Sets any linked object IDs associated with this object. If more than one object is linked with this one, the list should be enclosed in "quotes".

Parameters:
links - Linked object ID(s).