Package alma.aedf

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.

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.
 

Package alma.aedf Description

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

The main class defined by this package is Archiver. Creating an instance of this class opens a connection with an ARCHIVE ACS component, that can be used to perform the following tasks :

Constructor.

Example :
		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 :

To store an XML document : store.

Example:
		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.

To retrieve an XML document given its identifier : retrieve .

Example:
		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".

To retrieve UIDs of VOTables XML documents matching an XPath expression : getUIDs.

Example :
		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 :

To retrieve the UIDs of all VOTables XML documents stored in the archive : getAllUIDs.

Example:
		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("/*");.

To update a VOTable XML document : update.

Example:
		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 Exception

All the 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.