Data Request Broker
2-3-release

fr.gael.drb
Class DrbFactory

java.lang.Object
  extended by fr.gael.drb.DrbFactory

public abstract class DrbFactory
extends Object

Node constructor. This class is a factory of nodes. Its static operations enable to create nodes according to a specific implementation of the "Data Request Broker". Basically all DRB root nodes are created from this class. As an example, the open() operation allows to create a root node of an existing document from a simple "Unified Resource Identifier" (URI) which is in most cases a simple file system path. A further implementation of DrbFactory will load dynamically the implementations from external Jar files and will provide additional functionality such as automatic recognition. Note: the URI accepts several contiguous fragment separators (e.g. "###"). Note : this class is not supposed to be instantiated.


Field Summary
static String DRB_IDENTIFIER
          Deprecated. caller shall now use getImplementationVersion()
static int MAJOR_VERSION
          Deprecated. caller shall now use getImplementationVersion()
static int MINIMAL_MINOR_VERSION
          Deprecated. caller shall now use getImplementationVersion()
 
Constructor Summary
DrbFactory()
           
 
Method Summary
static String getImplementationVersion()
          Returns the implementation version identifier.
static void main(String[] args)
          Command line that returns the implementation version of the software.
static DrbNodeList open(DrbNode node)
          Opens a given base node.
static DrbNode open(String xquery)
          Deprecated. caller shall now use Query directly for creating nodes from an XQuery script.
static DrbNode openAs(String uri, String format)
          Opens a root node from an URI using a specific implementation.
static DrbNode openURI(String uri)
          Opens the root node of a given URI.
static DrbNode openURI(String uri_string, boolean spi_envelope)
          Opens the root node of a given URI.
static void registerImplementation(DrbFactoryImpl factory, String format)
          Register an implementation that handle the specified format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DRB_IDENTIFIER

public static final String DRB_IDENTIFIER
Deprecated. caller shall now use getImplementationVersion()
DRB configuration management version. The both following attributes controls the version identifier of the overall DRB package. The major version correspond to the effective major version of DRB. The minor version is not considered here but only the minimal minor version expected in the license file. This is a permissive policy allowing to automatically grant the license to a continuous sequence of minor versions as far as it does not correspond to a significant improvement of the software.

See Also:
Constant Field Values

MAJOR_VERSION

public static final int MAJOR_VERSION
Deprecated. caller shall now use getImplementationVersion()
MAJOR_VERSION

See Also:
Constant Field Values

MINIMAL_MINOR_VERSION

public static final int MINIMAL_MINOR_VERSION
Deprecated. caller shall now use getImplementationVersion()
MINIMAL_MINOR_VERSION

See Also:
Constant Field Values
Constructor Detail

DrbFactory

public DrbFactory()
Method Detail

getImplementationVersion

public static String getImplementationVersion()
Returns the implementation version identifier.

This identification string is extracted from the Manifest of the "drb" artifact Jar archive. The identifier format has the following pattern:

drb-[M]-[m]-[class]-[#]
Where:
  • [M]: stands for the major version number
  • [m]: stands for the minor version number
  • [class]: is a sub-version classifier among:
    • release: for stable releases
    • patch: for updates of stable releases
    • rc: for release candidates
    • beta: for beta version that
  • [#]: incremental number identifying the following version among this class.

Example: drb-1-3-release, drb-2-3-beta-3

Returns:
the identification version from the Jar archive.

open

public static DrbNode open(String xquery)
Deprecated. caller shall now use Query directly for creating nodes from an XQuery script.

Opens a root node from an XQuery. The result of the XQuery is analyzed and the first item in the sequence is returned if it is a node. Else null is returned.

Parameters:
xquery - the XQuery script to consider.
Returns:
the root node.
See Also:
Query

openAs

public static DrbNode openAs(String uri,
                             String format)
Opens a root node from an URI using a specific implementation.

Parameters:
uri - the location of the node to be opened.
format - the implementation used to open the node.
Returns:
the opened node or null otherwise.

openURI

public static DrbNode openURI(String uri)
Opens the root node of a given URI. If the node has been successfully opened, it is enveloped with a DrbNodeSpi that will automatically handle resolutions from an implementation to another e.g. automatically switch from File to XML implementation when a given file has an ".xml" extension.

Parameters:
uri - The "Unified Resource Identifier" (URI) to be openned. This parameter shall not be null.
Returns:
A root node of the matching implementation or null if an error occurred or if no implementation has matched.
See Also:
DrbNodeSpi

openURI

public static DrbNode openURI(String uri_string,
                              boolean spi_envelope)
Opens the root node of a given URI.

Parameters:
uri_string - The "Unified Resource Identifier" (URI) to be openned. This parameter shall not be null.
Returns:
A root node of the matching implementation or null if an error occurred or if no implementation has matched.

open

public static DrbNodeList open(DrbNode node)
Opens a given base node. If the node has been successfully opened, it is enveloped with a DrbNodeSpi that will automatically handle resolutions from an implementation to another e.g. automatically switch from File to XML implementation when a given file has an ".xml" extension.

Parameters:
node - The base node be openned. This parameter shall not be null.
Returns:
A root node of the matching implementation or null if an error occurred or if no implementation has matched.
See Also:
DrbNodeSpi

registerImplementation

public static void registerImplementation(DrbFactoryImpl factory,
                                          String format)
Register an implementation that handle the specified format.

Parameters:
factory - the input factory
format - the input format

main

public static void main(String[] args)
Command line that returns the implementation version of the software.


Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .