SYNOPSIS

ccn_repo [-memory memory] [-debug portno] [-output output_file] [-debug-daemon portno] [-profile profile_info] [-suspend] [-noshare] [-debug-flags flags] <repository_directory> [-log loglevel] [-policy <policy_file>] [-global <global_prefix>] | interactive <respository_directory> | stop <pid> | stopall | signal <name> <pid>]

DESCRIPTION

The ccn_repo utility starts, stops and signals CCNx Java content object repositories. This call requires a backend repository_directory to store the content objects to the filesystem. Only one repository should run on a single repository_directory at any time.

The utility has several modes - it is normally started in the background, but can also be started in the foreground, allowing logging information to be seen on the console. It can also be signalled and stopped. The modes are as follows:

ccn_repo <repository_directory>

This will start a content object repository in the specified directory. Once the repository is ready, a process id will be printed to the terminal. This pid is needed to signal this specific repository. The repository starts as a Daemon by default.

ccn_repo interactive <repository_directory>

This will start the repository in the foreground so that logging information is output to the console.

ccn_repo signal <name> <pid>

This command is generally used to cause the running repository to dump the names of its stored content objects to a file. The name option can be either nametree or nametreewide. nametree dumps the basic name tree while nametreewide dumps the name tree with full name components (may be hard to read). The pid is the process id displayed when the repository was started. The name tree file is written to the directory the repository was started with.

ccn_repo signal <name> <pid>

This command is generally used to cause the running repository to dump the names of its stored content objects to a file. The name option can be either nametree or nametreewide. nametree dumps the basic name tree while nametreewide dumps the name tree with full name components (may be hard to read). The pid is the process id displayed when the repository was started. The name tree file is written to the directory the repository was started with.

ccn_repo stop <pid>

This command stops a single repository with the supplied pid.

ccn_repo stopall

Stop all repositories running on a single machine (each needs a different repository_directory).

OPTIONS

The following options are available for all modes of ccn_repo except interactive:

-memory memory

This option adjusts the maximum amount of heap memory used by the repository. Units are bytes; optionally with a letter suffix (K, M, G, …).

-debug portno

Allows attachment of an eclipse remote debugger to the repo at the specified port number.

-output output_file

Writes the output from the repository to a file. This has a side effect which causes ccn_repo to remain running in the foreground.

-debug-daemon portno

Allows for debugging a running repository through the supplied port.

-profile profile_info

Allows arbitrary system flags to the JVM for profiling or other uses.

-suspend

Only useful in combination with -debug. Suspends the daemon at startup.

-noshare

Used to turn off Java sharing. Needed for the vmvisual profiler.

-debug-flags flags

Used to set Java properties. For the repository, using REPO_EXITDUMP will cause the repository to write out its name tree on exit without requiring a dynamic signal.


The following options are available only when starting a repository. Note that these options must be specified on the command line after the specification of the <repository_directory>:

-log LEVEL

Set the logging level. LEVEL must be the an acceptable Java Logger level: either an integer or a level name (e.g. SEVERE).

-policy policy_file

A policy file can most usefully be used to restrict the CCNx namespace(s) backed by this repo. It can also used to set the global prefix. A policy file is an XML file which must contain a <Policy> element containing the following elements:

  • <PolicyVersion> (required) must be 1.5.

  • <LocalName> (required) The eventual intent of this element is a value to be used as a "friendly name" for the repository. It is currently unused by the repository but must be present in the policy file.

  • <GlobalPrefix> (required) The global prefix of the repo.

  • <Namespace> The XML file may contain any number of <Namespace> elements which define the CCNx namespace backed by this repo. However in practice it is required that at least one of these elements define the key namespace which is by default ccnx.org/Users.

Here’s an example policy file which restricts the namespace backed by the repo to /parc.com/Users/rasmussen and /parc.com/CCNx/documentation as well as the key namespace:

     <?xml version="1.0" encoding="UTF-8"?>
     <Policy>
        <PolicyVersion> 1.5 </PolicyVersion>
        <LocalName> /ParcRepositories/TestRepository </LocalName>
        <GlobalPrefix> parc.com/csl/ccn/repositories/TestRepository </GlobalPrefix>
        <Namespace> /parc.com/Users/rasmussen </Namespace>
        <Namespace> /parc.com/CCNx/documentation </Namespace>
        <Namespace> /ccnx.org/Users </Namespace>
     </Policy>

Note that once the -policy option has been used to start a repository, the specified policy becomes that repository’s permanent policy. If the repository is restarted, the -policy option does not need to be reissued to retain the same policy. To change the policy, the repository must be restarted using the -policy option specifying a policy file with a different policy.

-global global_prefix

Sets the global name prefix for the repository (NOT the content it stores). The prefix must be globally unique.

EXIT STATUS

0

Success

1

Failure (syntax or usage error; startup error; failed to have ccnd running)

AUTHOR

Paul Rasmussen <rasmussen@parc.com> Rebecca Braynard <rbraynar@parc.com> Jim Thornton <jthornto@parc.com>