Knopflerfish OSGi 5.2.0

org.osgi.service.indexer
Interface ResourceIndexer


public interface ResourceIndexer

ResourceIndexer is an OSGi service that creates a Repository XML representation by indexing resource capabilities and requirements.


Field Summary
static java.lang.String LICENSE_URL
          Name of the configuration variable for the license URL of the repository
static java.lang.String PRETTY
          Name of the configuration variable to enable pretty-printing: non-gzipped, indented XML
static java.lang.String REPOSITORY_NAME
          Name of the configuration variable for the repository name
static java.lang.String REPOSITORYNAME_DEFAULT
          the default repository name
static java.lang.String ROOT_URL
          Name of the configuration variable for the root (directory) URL of the repository
static java.lang.String STYLESHEET
          Name of the configuration variable for the stylesheet of the XML representation
static java.lang.String STYLESHEET_DEFAULT
          the default stylesheet for the XML representation
static java.lang.String URL_TEMPLATE
          Name of the configuration variable for the template for the URLs in the XML representation.
static java.lang.String VERBOSE
          Name of the configuration variable for the verbose mode
 
Method Summary
 void index(java.util.Set<java.io.File> files, java.io.OutputStream out, java.util.Map<java.lang.String,java.lang.String> config)
          Index a set of input files and write the Repository XML representation to the stream
 void indexFragment(java.util.Set<java.io.File> files, java.io.Writer out, java.util.Map<java.lang.String,java.lang.String> config)
           Index a set of input files and write a Repository XML fragment to the given writer.
 

Field Detail

PRETTY

static final java.lang.String PRETTY
Name of the configuration variable to enable pretty-printing: non-gzipped, indented XML

See Also:
Constant Field Values

REPOSITORYNAME_DEFAULT

static final java.lang.String REPOSITORYNAME_DEFAULT
the default repository name

See Also:
Constant Field Values

REPOSITORY_NAME

static final java.lang.String REPOSITORY_NAME
Name of the configuration variable for the repository name

See Also:
Constant Field Values

STYLESHEET_DEFAULT

static final java.lang.String STYLESHEET_DEFAULT
the default stylesheet for the XML representation

See Also:
Constant Field Values

STYLESHEET

static final java.lang.String STYLESHEET
Name of the configuration variable for the stylesheet of the XML representation

See Also:
Constant Field Values

URL_TEMPLATE

static final java.lang.String URL_TEMPLATE
Name of the configuration variable for the template for the URLs in the XML representation. A template can contain the following symbols:

See Also:
Constant Field Values

ROOT_URL

static final java.lang.String ROOT_URL
Name of the configuration variable for the root (directory) URL of the repository

See Also:
Constant Field Values

LICENSE_URL

static final java.lang.String LICENSE_URL
Name of the configuration variable for the license URL of the repository

See Also:
Constant Field Values

VERBOSE

static final java.lang.String VERBOSE
Name of the configuration variable for the verbose mode

See Also:
Constant Field Values
Method Detail

index

void index(java.util.Set<java.io.File> files,
           java.io.OutputStream out,
           java.util.Map<java.lang.String,java.lang.String> config)
           throws java.lang.Exception
Index a set of input files and write the Repository XML representation to the stream

Parameters:
files - a set of input files
out - the stream to write the XML representation to
config - a set of optional parameters (use the interface constants as keys)
Throws:
java.lang.Exception - in case of an error

indexFragment

void indexFragment(java.util.Set<java.io.File> files,
                   java.io.Writer out,
                   java.util.Map<java.lang.String,java.lang.String> config)
                   throws java.lang.Exception

Index a set of input files and write a Repository XML fragment to the given writer.

Note that the result will be one or more XML resource elements without a top-level surrounding repository element. The resulting XML is therefore not well-formed.

This method may be useful for repository managers that wish to (re-)index individual resources and assemble the XML fragments into a complete repository document later.

Parameters:
files - a set of input files
out - the writer to write the Repository XML representation to
config - a set of optional parameter (use the interface constants as keys)
Throws:
java.lang.Exception - in case of an error

Knopflerfish OSGi 5.2.0