...
Create a Java class that implements the
ddf.catalog.resource.ResourceWriter
interface.Code Block language java title ResourceWriter Implementation Skeleton import java.io.IOException; import java.net.URI; import java.util.Map; import ddf.catalog.resource.Resource; import ddf.catalog.resource.ResourceNotFoundException; import ddf.catalog.resource.ResourceNotSupportedException; import ddf.catalog.resource.ResourceWriter; public class SampleResourceWriter implements ResourceWriter { @Override public void deleteResource(URI uri, Map<String, Object> arguments) throws ResourceNotFoundException, IOException { // WRITE IMPLEMENTATION } @Override public URI storeResource(Resource resource, Map<String, Object> arguments)throws ResourceNotSupportedException, IOException { // WRITE IMPLEMENTATION return null; } @Override public URI storeResource(Resource resource, String id, Map<String, Object> arguments) throws ResourceNotSupportedException, IOException { // WRITE IMPLEMENTATION return null; } }
Register the implementation as a Service in the OSGi Service Registry.
Code Block language html/xml title Blueprint Service Registration Example ... <service ref="[[ResourceWriterReference]]" interface="ddf.catalog.resource.ResourceWriter" /> ...
- Deploy the OSGi bundled packaged service to the
run-time.Insert excerpt ApplicationName ApplicationName nopanel trueApplicationName - Check the Working with OSGi - Bundles section.
...