<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yiv9366310362"><div id="yui_3_16_0_1_1445338067930_7276"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;" id="yui_3_16_0_1_1445338067930_7275"><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" id="yiv9366310362yui_3_16_0_1_1445338067930_4296" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">Hi Salifou,</span><span></span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" id="yiv9366310362yui_3_16_0_1_1445338067930_4547" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">OK, i see now, then you have two options:</span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;" id="yui_3_16_0_1_1445338067930_7286">a) To extend the sdk:</span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" id="yiv9366310362yui_3_16_0_1_1445338067930_4800" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">1. extend java-sdk by allowing to inject custom headers in every request</span><span class="yiv9366310362" style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;"> </span><span id="yui_3_16_0_1_1445338067930_8082" class="" style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">(not trivial as all ovirt SDKs are auto-generated</span><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">,</span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;" class="" id="yui_3_16_0_1_1445338067930_9090">but if its common case, you may find yourself getting help from community/maintainers)</span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span style="font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;" class=""><br></span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" id="yiv9366310362yui_3_16_0_1_1445338067930_4801" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">2. fork java-sdk customizing it for your needs</span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;"><br clear="none"></span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" id="yiv9366310362yui_3_16_0_1_1445338067930_4974" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">I'd recommend the former as fork will leave you with no support/maintenance from community plus you'll have</span></div><div dir="ltr" id="yiv9366310362yui_3_16_0_1_1445338067930_4283"><span class="yiv9366310362" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;" id="yui_3_16_0_1_1445338067930_7285">to implement new </span><span id="yiv9366310362yui_3_16_0_1_1445338067930_5162" style="font-family:'Helvetica Neue', 'Segoe UI', Helvetica, Arial, 'Lucida Grande', sans-serif;">features by your own (what will become a moving target very quickly)</span></div> <br clear="none"><div class="yiv9366310362qtdSeparateBR" id="yui_3_16_0_1_1445338067930_7274" dir="ltr">b) Proxying the sdk</div><div class="yiv9366310362qtdSeparateBR" id="yui_3_16_0_1_1445338067930_7274" dir="ltr"><br></div><div class="yiv9366310362qtdSeparateBR" id="yui_3_16_0_1_1445338067930_7274" dir="ltr">You can implement dynamic proxy wrapping SDK's HttpProxy.java#execute and intercept the context from there,</div><div class="yiv9366310362qtdSeparateBR" id="yui_3_16_0_1_1445338067930_7274" dir="ltr">but you've to stay tuned as backward compatibility is for interface and not for SDK internals,</div><div class="yiv9366310362qtdSeparateBR" id="yui_3_16_0_1_1445338067930_7274" dir="ltr">so "potentially" you can find your code broken in one of the following upgrades</div><div class="yiv9366310362qtdSeparateBR" id="yui_3_16_0_1_1445338067930_7274" dir="ltr"><br></div><div class="yiv9366310362qtdSeparateBR" id="yui_3_16_0_1_1445338067930_7274" dir="ltr">hope it helps. <br clear="none"><br clear="none"></div><div class="yiv9366310362yqt0562777282" id="yiv9366310362yqt81591"></div></div></div></div><div class=".yiv9366310362yahoo_quoted" id="yui_3_16_0_1_1445338067930_8533"> <div style="font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;" id="yui_3_16_0_1_1445338067930_8532"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_1_1445338067930_8531"> <div dir="ltr" id="yui_3_16_0_1_1445338067930_8554"> <font size="2" face="Arial" id="yui_3_16_0_1_1445338067930_8559"> On Monday, October 19, 2015 6:05 PM, Salifou Sidi M. Malick <ssidimah@redhat.com> wrote:<br clear="none"> </font> </div> <br clear="none"><br clear="none"> <div class="yiv9366310362y_msg_container" id="yui_3_16_0_1_1445338067930_8712">Hi Micheal,<br clear="none"><br clear="none">Thanks for replying. Unfortunately the headers are dynamic ...<br clear="none"><br clear="none">Here is the story:<br clear="none"><br clear="none">We implemented a custom RHEV-M AAA module for a client<br clear="none">in order to allow their custom portal to make RHEV-M API <br clear="none">calls. <br clear="none"><br clear="none">The custom AAA module requires extra dynamic data in the HTTP <br clear="none">request (as request headers for now but request parameters <br clear="none">should be fine too). <br clear="none"><br clear="none">Their is no problem if they go with the REST API, I am just <br clear="none">trying to anticipate/identify potential integration problem ...<br clear="none"><br clear="none">It seems like they will have to use the REST API or modify the <br clear="none">java sdk ... <br clear="none"><br clear="none">Thanks a lot,<br clear="none">Salifou<br clear="none"><br clear="none"><div class="yiv9366310362yqt8023103542" id="yiv9366310362yqtfd83808"><br clear="none">----- Original Message -----<br clear="none">From: "Michael Pasternak" <<a rel="nofollow" shape="rect" ymailto="mailto:mishka8520@yahoo.com" target="_blank" href="mailto:mishka8520@yahoo.com">mishka8520@yahoo.com</a>><br clear="none">To: "Salifou Sidi M. Malick" <<a rel="nofollow" shape="rect" ymailto="mailto:ssidimah@redhat.com" target="_blank" href="mailto:ssidimah@redhat.com">ssidimah@redhat.com</a>><br clear="none">Cc: "Users" <<a rel="nofollow" shape="rect" ymailto="mailto:users@ovirt.org" target="_blank" href="mailto:users@ovirt.org">users@ovirt.org</a>><br clear="none">Sent: Sunday, October 18, 2015 5:45:05 AM<br clear="none">Subject: Re: Question about the ovirt-engine-sdk-java<br clear="none"><br clear="none">Hi Salifou,<br clear="none">Actually java sdk is intentionally hiding transport level internals so developers could stay in java domain,if your headers are static, easiest way would be using reverse proxy in a middle to intercept requests, <br clear="none"><br clear="none">can you tell me why do you need this?<br clear="none"> <br clear="none"><br clear="none"><br clear="none"> On Friday, October 16, 2015 1:14 AM, Salifou Sidi M. Malick <<a rel="nofollow" shape="rect" ymailto="mailto:ssidimah@redhat.com" target="_blank" href="mailto:ssidimah@redhat.com">ssidimah@redhat.com</a>> wrote:<br clear="none"> <br clear="none"><br clear="none"> Hi Micheal,<br clear="none"><br clear="none">I have a question about the ovirt-engine-sdk-java.<br clear="none"><br clear="none">Is there a way to add custom request headers to each RHEVM API call?<br clear="none"><br clear="none">Here is an example of a request that I would like to do:<br clear="none"><br clear="none">$ curl -v -k \<br clear="none"> -H "ID: <a rel="nofollow" shape="rect" ymailto="mailto:user1@ad.xyz.com" target="_blank" href="mailto:user1@ad.xyz.com">user1@ad.xyz.com</a>" \<br clear="none"> -H "PASSWORD: Pwssd" \<br clear="none"> -H "TARGET: kobe" \<br clear="none"> <a rel="nofollow" shape="rect" target="_blank" href="https://vm0.smalick.com/api/hosts">https://vm0.smalick.com/api/hosts</a><br clear="none"><br clear="none"><br clear="none">I would like to add ID, PASSWORD and TARGET as HTTP request header. <br clear="none"><br clear="none">Thanks,<br clear="none">Salifou<br clear="none"><br clear="none"><br clear="none"></div><br clear="none"><br clear="none"></div> </div> </div> </div></div></body></html>