Here's an example of how to use @Consumes at the Type level from the 
CloudSigmaApi [1].

It will add or replace the Accept header for every call in that Api with 
whatever value you specify. I think it will do exactly what you want without 
you having to write more code.

Everett

[1] 
https://github.com/jclouds/jclouds/blob/master/apis/cloudsigma/src/main/java/org/jclouds/cloudsigma/CloudSigmaApi.java#L73


On Jan 2, 2014, at 1:01 AM, Ignasi Barrera wrote:


The only stupid question is the one that is not asked :)

Take a look at this method [1] and who calls it. That RestAnnotationProcessor 
class is where most of the magic happens. It takes the invoked api method, 
reads the annotations, and generates the request.

HTH!

[1] 
https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/rest/internal/RestAnnotationProcessor.java#L702-706

El 02/01/2014 04:53, "Nirmal Fernando" 
<nir...@wso2.com<mailto:nir...@wso2.com>> escribió:
Hi Ignasi,


On Thu, Jan 2, 2014 at 2:54 AM, Ignasi Barrera 
<ignasi.barr...@gmail.com<mailto:ignasi.barr...@gmail.com>> wrote:

You can replace the @RequestFilters annotation by: @Consumes("*/*")
That will translate to the Accept header being set, and can also be overridden 
in the methods that could need so.

Sorry if this question sounds like stupid. I still don't understand how adding 
@Consumes does what the filter does. This is my filter code;

@Singleton
public class VcloudSupportedVersions implements HttpRequestFilter {

   @Inject
   public VcloudSupportedVersions() {
   }

   @Override
   public HttpRequest filter(HttpRequest request) throws HttpException {
       return request.toBuilder().replaceHeader(HttpHeaders.ACCEPT, "*/*")
               .build();

   }
}

There is no prerequisite to implement the ComputeService :) I'm not familiar 
with vcloud, but I can help explaining how the ComputeService interface works 
and what and how needs to be configured (can also help with code but I lack the 
knowledge of how the vcloud api works). Perhaps we can have a chat in the IRC 
channel or start a new thread to discuss the impleme tation details. Would this 
work for you?

El 01/01/2014 18:05, "Nirmal Fernando" 
<nir...@wso2.com<mailto:nir...@wso2.com>> escribió:




On Wed, Jan 1, 2014 at 10:26 PM, Ignasi Barrera 
<ignasi.barr...@gmail.com<mailto:ignasi.barr...@gmail.com>> wrote:

It would be great to see those PR! Having contributions in the vcloud apis is 
definitely something that is very welcome.

Do you have any plan to add the Compute view for vcloud-director? I can help 
with that if you want/can!

What are the prerequisites? :)

El 01/01/2014 17:46, "Nirmal Fernando" 
<nir...@wso2.com<mailto:nir...@wso2.com>> escribió:

Only vcloud. I found that vcloud-director is missing the Compute view and it's 
not gonna help our cause, unfortunately. But I'm using vcloud against a Vcloud 
Director 1.5 IaaS.


On Wed, Jan 1, 2014 at 9:57 PM, Andrew Phillips 
<andr...@apache.org<mailto:andr...@apache.org>> wrote:
My plan is to send few pull requests to vcloud api, soon :) (I've fixed few
issues and now in the process of testing 'em.)

Just to clarify, are you working on/using the vcloud [1] or the vcloud-director 
[2] APIs, or both..?

ap

[1] https://github.com/jclouds/jclouds/tree/master/apis/vcloud
[2] https://github.com/jclouds/jclouds-labs/tree/master/vcloud-director



--

Thanks & regards,
Nirmal

Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733<tel:%2B94715779733>
Blog: http://nirmalfdo.blogspot.com/




--

Thanks & regards,
Nirmal

Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733<tel:%2B94715779733>
Blog: http://nirmalfdo.blogspot.com/




--

Thanks & regards,
Nirmal

Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733<tel:%2B94715779733>
Blog: http://nirmalfdo.blogspot.com/


Reply via email to