Skip to content

Extension Naming

spmallette edited this page May 11, 2011 · 4 revisions

Extension naming plays an important role in how the extension is exposed within Rexster. Extension names are defined through the ExtensionNaming annotation which applies to a class. The annotation takes two parameters: the namespace and name. Consider the following example:

@ExtensionNaming(name = "myextension", namespace = "ns")

The namespace specifies the “package” within which the extension will serve and really behaves as a means for organizing common extensions. If the namespace is not specified, it will be defaulted to the “global” namespace which is specified as “g”. Therefore, the following annotations are equivalent:

@ExtensionNaming(name = "myextension", namespace = "g")
@ExtensionNaming(name = "myextension")

The name parameter refers to the name of the extension itself. The name should be unique within the namespace. Rexster will not complain of naming collisions, so therefore it is important to examine both the approach to naming as well as the configuration within Rexster of individual extensions per graph.

The values supplied to the @ExtensionName annotation directly define the the extension URI given a particular extension point. Therefore, assuming a particular graph configured the an extension with the following @ExtensionNaming annotation:

@ExtensionNaming(name = "myextension", namespace = "ns")

The above annotation would expose that extension on the following base URIs depending upon the extension point:

# graph extension point
http://{base}/{graph}/ns/myextension

# vertex extension point
http://{base}/{graph}/vertices/{id}/ns/myextension

# edge extension point
http://{base}/{graph}/edges/{id}/ns/myextension

Please refer to the Rexster Configuration section for explanation as to how extensions can be configured to work with graphs given the name and namespace parameters on the @ExtensionNaming annotation.

Clone this wiki locally