|
|||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
Archiver | The central class of this package, to store, retrieve, update and delete VO Tables XML documents to/from the XML store. |
Browser | A very basic browser to display the VOTables contained in the the ALMA Archive XMLStore through a Swing GUI and submit XPath queries. |
Project | |
TestArchive1 | An application to test the alma.aedf.Arciver methods. |
TestArchive2 | An application to test the alma.aedf.Archiver methods. |
TestProject | An application to test the alma.aedf.Project class. |
Exception Summary | |
ArchiverException | The exception thrown by all methods of Archiver . |
Provides classes for storing / retrieving / updating / deleting XML documents in the archive; these documents are assumed to be conform with the VO Tables schema and to represent tables as defined by the Alma Export Data Format document.
Archiver
. Creating an instance of this class
opens a connection with an ARCHIVE ACS component, that can be used to perform the following tasks :
Logger logger = Logger.getLogger("OperationalClient"); Archiver ar = null; try { String managerLoc = "corbaloc::" + InetAddress.getLocalHost().getHostName() + ":3000/Manager"; ar = new Archiver(logger, managerLoc); } catch (UnknownHostException e1) { e1.printStackTrace(); } catch (ArchiverException e1) { e1.printStackTrace(); } catch (Exception e1) { e1.printStackTrace(); }The constructor expects two arguments :
corbaloc::salsa.obspm.fr:3000/Manager
store.
Archiver ar; String xmlString; String UID; . // Instantiate an Archiver in ar, // Fill xmlString with an XML text conform with the VO Table schema. . try { UID = ar.store(xmlString); } catch (ArchiveException e2) { e2.printStackTrace(); }The method returns in the unique identifier allocated to this XML document in the archive. Attention: the XML document must be conform to the VO Table schema which will be associated to this document in the archive.
retrieve
.Archiver ar; String xmlString; String UID; . // Instantiate an Archiver in ar, . try { UID = "uid://X000000000000006d/X00000000"; xmlString = ar.retrieve(UID); } catch (ArchiveException e) { e.printStackTrace(); }Returns the XML document stored in the archive with UID
uid://X000000000000006d/X00000000"
.
getUIDs
.Archiver ar; String[] retUIDs = null; . // Instantiate an Archiver in ar, . try { retUIDs = ar.getUIDs("/VOTABLE/RESOURCE/PARAM[@name=\"PROJECT_UID\" and @value=\"anotherProjectUID\"]"); } catch (ArchiveException e) { e.printStackTrace(); }On return,
retUIDs
contains the identifiers of all the XML document with a RESOURCE
element veryfing the
two following conditions :
RESOURCE
element itself child of a VOTABLE
element
located at the root of the document. name
and value
whose values
must be respectively PROJECT_UID
and anotherProjectUID
.
getAllUIDs
.Archiver ar; String[] retUIDs = null; . // Instantiate an Archiver in ar, . try { retUIDs = ar.getAllUIDs(); } catch (ArchiveException e) { e.printStackTrace(); }On return
retUIDs
contains the UIDs of all VOTables XML document stored in
the archive. Note: this method returns the same result than getUIDs("/*");
.
update
.Archiver ar; String xmlString = null; . // Instantiate an Archiver in ar, // Fills xmlString with some VO Table XML document's text. // Store it in the archive. String UID = ar.store(xmlString); . . // Modify the xmlString content. . . // Update the VO Table XML document content in the archive. try { ar.update(UID, xmlString); } catch (ArchiveException e) { e.printStackTrace(); }In this example, a first version of a VO Table XML document is stored in the archive. The
store
method
returns an identifier saved in a String variable UID
. This identifier can be user later in
a call to update
together with the modified XML content.
Archiver
's methods may throw an alma.aedf.ArchiverException
.
The getMessage
of this exception is of the form ArchiverException :
followed
by a text describing in which circumstances it occurred.
|
|||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |