Quantcast

revisiting requisition url handlers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

revisiting requisition url handlers

Jesse White-3
All;

I'm looking into ways we can make the requisition imports a little more flexible, with the goal of getting the handlers
to run on Minion.

Currently, custom handlers like 'dns' and 'vmware' are registered via the global GenericURLFactory:

https://github.com/OpenNMS/opennms/blob/e782249d46c07f54f28746cedca7e17f7c8bc51d/opennms-util/src/main/java/org/opennms/core/utils/url/GenericURLFactory.java#L75

And URLs of the form 'vmware://vcenter.mydomain.org?importHostPoweredOff=true' trigger the appropriate handler, which
returns a stream containing a Requisition document.

To make this more flexible, while requiring minimal changes to provisiond I thought we could add a new handler to
support URLs for the form:
   requisition://type?host=host&port=port&location=location&attr=attr

So this URL:
   vmware://vcenter.mydomain.org/?importHostPoweredOff=true

Would become:
   requisition://vmware/?host=vcenter.mydomain.org&importHostPoweredOff=true

Existing handlers would continue to expose the custom URL handlers in addition to a new interface:

   public interface RequisitionProvider {
       Requisition getRequisition(Map<String, String> params);
   }

Which would be exposed via OSGi using:

  <service ref="myRequisitionProvider" interface="org.opennms.netmgt.provision.RequisitionProvider">
    <service-properties>
      <entry key="type" value="mytype" />
    </service-properties>
  </service>

The handler for the 'requisition' protocol would then delegate the requests to the typed provider, and perform an RPC
call to a remote location when necessary.

Does this sound reasonable?

-Jesse

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: revisiting requisition url handlers

Jeff Gehlbach
On 02/03/2017 12:37 PM, Jesse White wrote:

> Does this sound reasonable?

Yes. Elegant, even. Thank you!

-jeff


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

signature.asc (836 bytes) Download Attachment
Loading...