> +    * Retrieve the virtual machine this volume is attached to.
> +    * 
> +    * @return The virtual machine this volume is attached to, or null if it 
> is
> +    * not attached.
> +    */
> +   public VirtualMachine getVirtualMachine() {
> +      checkState(ATTACHED == VolumeState.valueOf(target.getState()), "Volume 
> is not attached to a VM");
> +      RESTLink vmLink = 
> checkNotNull(target.searchLink(ParentLinkName.VIRTUAL_MACHINE),
> +            ValidationErrors.MISSING_REQUIRED_LINK + " " + 
> ParentLinkName.VIRTUAL_MACHINE);
> +      vmLink.setType(VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE);
> +      HttpResponse response = context.getApi().get(vmLink);
> +
> +      ParseXMLWithJAXB<VirtualMachineWithNodeExtendedDto> parser = 
> context.utils()
> +            .injector()
> +            .getInstance(
> +                  Key.get(new 
> TypeLiteral<ParseXMLWithJAXB<VirtualMachineWithNodeExtendedDto>>(){}));

I agree with you: it's a piece of odd formatted code, I'll make some
improvements tomorrow morning if you want.
El 04/11/2013 19:04, "Andrew Phillips" <notificati...@github.com> escribió:

> In abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/Volume.java:
>
> > +    * Retrieve the virtual machine this volume is attached to.
> > +    *
> > +    * @return The virtual machine this volume is attached to, or null if 
> > it is
> > +    * not attached.
> > +    */
> > +   public VirtualMachine getVirtualMachine() {
> > +      checkState(ATTACHED == VolumeState.valueOf(target.getState()), 
> > "Volume is not attached to a VM");
> > +      RESTLink vmLink = 
> > checkNotNull(target.searchLink(ParentLinkName.VIRTUAL_MACHINE),
> > +            ValidationErrors.MISSING_REQUIRED_LINK + " " + 
> > ParentLinkName.VIRTUAL_MACHINE);
> > +      vmLink.setType(VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE);
> > +      HttpResponse response = context.getApi().get(vmLink);
> > +
> > +      ParseXMLWithJAXB<VirtualMachineWithNodeExtendedDto> parser = 
> > context.utils()
> > +            .injector()
> > +            .getInstance(
> > +                  Key.get(new 
> > TypeLiteral<ParseXMLWithJAXB<VirtualMachineWithNodeExtendedDto>>(){}));
>
> [minor] Odd formatting?
>
> ParseXMLWithJAXB<VirtualMachineWithNodeExtendedDto> parser = 
> context.utils().injector()
>       .getInstance(Key.get(new 
> TypeLiteral<ParseXMLWithJAXB<VirtualMachineWithNodeExtendedDto>>(){}));
>
> or so? But also find to proceed without this.
>
> —
> Reply to this email directly or view it on 
> GitHub<https://github.com/jclouds/jclouds-labs/pull/31/files#r7407663>
> .
>

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/31/files#r7409133

Reply via email to