You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

There is a sample resource that has already been created and has very simple functionality.

When launching OpenNaas the Sample Resource bundle can be seen

 

OpenNaaS>list
          
     [147] [Active] [Created] [ ] [60] OpenNaaS :: Sample Resource (0.12.0.SNAPSHOT)

 

 

There is a sample resource descriptor in opennaas/utils/examples/descriptors 

<resourceDescriptor>
  <!-- Capability information -->
     <capabilityDescriptors>
                 <information><type>example</type></information>
      </capabilityDescriptors>
  <!-- Resource information. It specify type and name-->
     <information>
                 <type>sampleresource</type>
                 <name>resource1</name>
     </information>
 <properties/>
</resourceDescriptor>

 

If  a resource with the above descriptor  thas been created (type=sampleresource, name=resource1)

OpenNaaS>example:sayhello sampleresource:resource1 Adam
[INFO] sampleresource:resource1 says : Hello Adam

 
 The code can be found in  opennaas/extensions/bundles/sampleresource.
  • No labels