spacer spacer spacer
spacer spacer spacer
spacer
NASA Jet Propulsion Laboratory, California Institute of Technology + View the NASA Portal

+ NASA en Español

+ Contact NASA
Search the API    

Client Applications

The client applications for the Metadata Service component are comprised of Java classes which provide an Application Program Interface (API) for interfacing with the server applications for this component.

Environment

This section describes the environmental configuration necessary for the execution of the client applications or applications implemented utilizing their APIs.

Required Components

Applications described in this document require the following components:

Component JAR File Name Description
Common Components edm-commons-x.x.x.jar This OODT component provides utilities for logging, managing the configuration file, etc.
Query Expression Component edm-query-x.x.x.jar This OODT component provides a way to express queries in a generic manner.
CORBA Services edm-corba-x.x.x.jar This OODT component provides CORBA utilites and a name server.
JacORB jacorb-x.x.x.jar This external component contains the CORBA implementation utilized by the OODT applications.
Metadata Service metadata-se rvice-x.x.x.jar This OODT component contains the client application classes.

The current version dependencies for each of the components above, can be found in the Dependencies document for the Metadata Service. Each of the above component JAR files must be referenced in the calling environment's class path. This can be accomplished either by specifying the references in the CLASSPATH environment variable or in the -classpath option of the java interpreter. The components may also be referenced by specifying the directory containing the component JAR files using the java.ext.dirs property.

Java Properties

This section details the Java properties utilized by the client applications of the Metadata Service.

Generic Properties

The following generic properties may be specified for the Metadata Service for all instances:

Property Description
java.ext.dirs The directory location for discovering installed optional packages. This property will typically be used for specifying the directory location of the dependent JAR files.
jpl.eda.Configuration.file The specification of the EDM/OODT configuration file.

RMI Properties

The RMI protocol support properties must be specified for the Metadata Service for all instances.

Property Description
jpl.eda.rmiregistries This property will typically be used for specifying the RMI registry. For example, rmi://localhost:9202.

Logging Properties

The logging capability properties specify how the messages generated by the application will be handled.

Property Description
jpl.eda.util.LogInit.listener The class specification for the log listener. The messages may be sent to a file or to the terminal's standard error stream. Valid values: jpl.eda.util.FileLogger or jpl.eda.util.ScreenLogger .
jpl.eda.util.LogInit.categories The categories of messages to ignore. The value may be a space separated list of categories or it may be left blank indicating that all messages will be logged. Valid values: Trace , Debug , Info , Warn and Error .
If the jpl.eda.util.LogInit.listener property is set to the jpl.eda.util.FileLogger value, then the following properties may be set:
jpl.eda.util.FileLogger.path The directory location of the log file. If this property is not set, the default location is the local directory where the application was launched. Example value: /usr/local/metadata/var/log .
jpl.eda.util.FileLogger.name The name of the log file. If this property is not set, the default naming convention is eda_{YYYYMMDDhhmmssSSS}.log . Example value: metadata.log .

Miscellaneous Properties

The miscellaneous properties provide instance specific values.

Property Description
jpl.eda.metadata.registry.tmpDir The directory location where temporary files will be written. Example value: /tmp .

CORBA Property Files

Two CORBA related property files are required to be accessible. They are the jacorb.properties and orb.properties file. They can also be named .jacorb.properties and .orb.properties respectively. These files should be present in either a directory specified in the class path, the home directory, the current directory or in the Java installation library directory ($JAVA_HOME/jre/lib).

OODT Configuration File

The OODT configuration file is required to be accessible. The file may be named edarc.xml or .edarc.xml . This file should be present in the home directory or in the Java installation library directory ($JAVA_HOME/jre/lib). This file may also be referenced by specifying the file name using the jpl.eda.Configuration.file property. The following is an example of a minimal configuration file for the client applications:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC
  "-//JPL//DTD EDA Configuration 1.0//EN"
  "http://oodt.jpl.nasa.gov/dtd/configuration.dtd">

<configuration>

  <webServer>
    <host>localhost</host>
    <port>80</port>
    <dir>/usr/local/metadata/htdocs</dir>
  </webServer>

  <nameServer>
    <iiop>
      <host>localhost</host>
      <port>2809</port>
    </iiop>
  </nameServer>

  <properties>
    <!-- Log listener properties. -->
    <key>jpl.eda.util.LogInit.listener</key>
    <value>jpl.eda.util.ScreenLogger</value>
    <key>jpl.eda.util.LogInit.categories</key>
    <value></value>

    <!-- Miscellaneous properties. -->
    <key>jpl.eda.metadata.registry.tmpDir</key>
    <value>/tmp</value>
  </properties>

</configuration>
        

In order for a client application to find the CORBA Name Server, the host and port elements inside the webServer element must be specified correctly. The nameServer element is only used when starting the Name Server. The log listener properties specified in the configuration file indicate that all messages generated by a client application will be sent to the terminal's standard error stream.

Schema Client

This application enables access to the Schema Registry server application. This application is contained in the class jpl.eda.metadata.registry.schema.SchemaClient . If implementing a client application, use the methods contained in this class to access the server application, otherwise the main() method of this class enables command-line execution of this application with the following common arguments:

Argument Description
Server Name The URN of the Schema Registry server application. For example, urn:eda:corba:JPL.EDM.MetadataRegistry to connect to CORBA server or urn:eda:rmi:JPL.EDM.Metadataregistry to connect to RMI server.
Event The event to be initiated. Valid values: add and release . There are other supported events, but only the add and release events have been documented at this time.

The following is an example of how to execute this application from the command-line. The command has been broken up into several lines for readability. This command assumes a default Metadata Service installation located in the /usr/local/metadata directory. The CORBA property files are loca ted in the ./etc directory and the dependent component JAR files are located in the ./lib directory. The server is identified by URN urn:eda:corba:JPL.EDM.MetadataRegistry .

% java \
-classpath /usr/local/metadata/etc \
-Djava.ext.dirs=/usr/local/metadata/lib \
-Djpl.eda.Configuration.file=/usr/local/metadata/etc/edarc.xml \
jpl.eda.metadata.registry.schema.SchemaClient \
urn:eda:corba:JPL.EDM.MetadataRegistry <event> \
<arguments>
      

Add Event

This event enables a schema file to be submitted and registered in the Schema Registry with corresponding metadata. The additional command-line arguments are as follows:

Argument Description
Metadata File The file specification for a file containing metadata describing the schema file to be registered.
Schema File The file specification for the schema file to be registered.

The metadata file must be an XML document conforming to a specific structure. Although it is recommended that all of the Dublin Core elements be utilized when describing a schema file, only the DC.Identifier element is required. The following is an example of the metadata file:

<?xml version="1.0"?>
<dataDictionary>
  <metadata>
    <DC.Identifier>EDM.Test</DC.Identifier>
    <DC.Title>EDM Test Schema</DC.Title>
    <DC.Format>text/xml</DC.Format>
    <DC.Description>This is a test.</DC.Description>
    <DC.Creator>EDM</DC.Creator>
    <DC.Subject>EDM Test</DC.Subject>
    <DC.Publisher>Jet Propulsion Laboratory</DC.Publisher>
    <DC.Contributor>Cynthia Wong</DC.Contributor>
    <DC.Date>2004-09-29</DC.Date>
    <DC.Type>XSD</DC.Type>
    <DC.Source/>
    <DC.Language>en</DC.Language>
    <DC.Relation/>
    <DC.Coverage/>
    <DC.Rights>
      Copyright (c) 2004 California Institute of Technology.
      All rights reserved.
    </DC.Rights>
    <Version>1.0</Version>
  </metadata>
</dataDictionary>
        

The following is an example of how to execute the add event from the command-line. This command will register the test_schema.xsd file with metadata contained in the test_metadata.xml file with the Schema Registry.

% java \
-classpath /usr/local/metadata/etc \
-Djava.ext.dirs=/usr/local/metadata/lib \
-Djpl.eda.Configuration.file=/usr/local/metadata/etc/edarc.xml \
jpl.eda.metadata.registry.schema.SchemaClient \
urn:eda:corba:JPL.EDM.MetadataRegistry add \
test_metadata.xml test_schema.xsd
        

Release Event

This event enables a versioned schema file to be promoted or released. This action entails updating the schema's status from REGISTERED to RELEASED and the schema file is copied from its version specific directory to the parent directory in the hierarchy. The additional command-line arguments are as follows:

Argument Description
Schema Identifier The schema identifier as specified by the Identifier element in the metadata that accompanied the schema at the time of registration.
Version The version as specified by the Version element in the metadata that accompanied the schema at the time of registration. If a version was not supplied at registration, an empty value may be provided indicating that the most recently registered schema with the specified identifier will be promoted. An empty value can be provided on the command-lin e with two double or single quotes following the identifier argument.
Optionally, the following argument may be supplied instead of the previous two arguments:
Registry Identifier The registry identifier assigned by the Schema Registry at the time of registration.

The following is an example of how to execute the release event from the command-line. The first command will promote the schema identified by JPL.Test.Schema with version 1.0 while the second command will promote the schema with registry identifier 99 in the Schema Registry.

% java \
-classpath /usr/local/metadata/etc \
-Djava.ext.dirs=/usr/local/metadata/lib \
-Djpl.eda.Configuration.file=/usr/local/metadata/etc/edarc.xml \
jpl.eda.metadata.registry.schema.SchemaClient \
urn:eda:corba:JPL.EDM.MetadataRegistry release \
JPL.Test.Schema 1.0

Optionally:

% java \
-classpath /usr/local/metadata/etc \
-Djava.ext.dirs=/usr/local/metadata/lib \
-Djpl.eda.Configuration.file=/usr/local/metadata/etc/edarc.xml \
jpl.eda.metadata.registry.schema.SchemaClient \
urn:eda:corba:JPL.EDM.MetadataRegistry release \
99
        
FirstGov - Your First Click to the US Governmnet

+ Freedom of Information Act

+ NASA Privacy Statement, Disclaimer,

and Accessibility Certification


+ Freedom to Manage
NASA

Editor: Sean Kelly

NASA Official: Dan Crichton

Last Published: 04 November 2005

+ Contact NASA
spacer
spacer spacer spacer
spacer spacer spacer