You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by na...@apache.org on 2014/11/27 15:32:16 UTC

[01/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Repository: jclouds-labs
Updated Branches:
  refs/heads/master 3bceb3f4e -> 1b689dc17


http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/enterprises-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/enterprises-page.xml b/abiquo/src/test/resources/payloads/enterprises-page.xml
deleted file mode 100644
index c7e9b07..0000000
--- a/abiquo/src/test/resources/payloads/enterprises-page.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<enterprises>
-    <link rel="first" href="http://localhost/api/admin/enterprises" />
-    <link rel="next" href="http://localhost/api/admin/enterprises?startwith=1"/>
-    <link rel="last" href="http://localhost/api/admin/enterprises?startwith=1"/>
-    <totalSize>2</totalSize>
-    <enterprise>
-        <link rel="appslib/templateDefinitionLists" type="application/vnd.abiquo.templatedefinitionlists+xml" href="http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists"/>
-        <link rel="appslib/templateDefinitions" type="application/vnd.abiquo.templatedefinitions+xml" href="http://localhost/api/admin/enterprises/1/appslib/templateDefinitions"/>
-        <link rel="cloud/virtualdatacenters" type="application/vnd.abiquo.virtualdatacenters+xml" href="http://localhost/api/admin/enterprises/1/action/virtualdatacenters"/>
-        <link rel="datacenterrepositories" type="application/vnd.abiquo.datacenterrepositories+xml" href="http://localhost/api/admin/enterprises/1/datacenterrepositories"/>
-        <link rel="edit" type="application/vnd.abiquo.enterprise+xml" href="http://localhost/api/admin/enterprises/1"/>
-        <link rel="externalnetworks" type="application/vnd.abiquo.vlans+xml" href="http://localhost/api/admin/enterprises/1/action/externalnetworks"/>
-        <link rel="ips" href="http://localhost/api/admin/enterprises/1/action/ips"/>
-        <link rel="limits" type="application/vnd.abiquo.limits+xml" href="http://localhost/api/admin/enterprises/1/limits"/>
-        <link rel="properties" type="application/vnd.abiquo.enterpriseproperties+xml" href="http://localhost/api/admin/enterprises/1/properties"/>
-        <link rel="reservedmachines" type="application/vnd.abiquo.machines+xml" href="http://localhost/api/admin/enterprises/1/reservedmachines"/>
-        <link rel="users" type="application/vnd.abiquo.users+xml" href="http://localhost/api/admin/enterprises/1/users"/>
-        <link rel="virtualappliances" type="application/vnd.abiquo.virtualappliances+xml" href="http://localhost/api/admin/enterprises/1/action/virtualappliances"/>
-        <link rel="virtualmachines" type="application/vnd.abiquo.virtualmachines+xml" href="http://localhost/api/admin/enterprises/1/action/virtualmachines"/>
-        <link rel="volumes" type="application/vnd.abiquo.iscsivolumes+xml" href="http://localhost/api/admin/enterprises/1/action/volumes"/>
-        <cpuHard>0</cpuHard>
-        <cpuSoft>0</cpuSoft>
-        <hdHard>0</hdHard>
-        <hdSoft>0</hdSoft>
-        <publicIpsHard>0</publicIpsHard>
-        <publicIpsSoft>0</publicIpsSoft>
-        <ramHard>0</ramHard>
-        <ramSoft>0</ramSoft>
-        <storageHard>0</storageHard>
-        <storageSoft>0</storageSoft>
-        <vlansHard>0</vlansHard>
-        <vlansSoft>0</vlansSoft>
-        <id>1</id>
-        <isReservationRestricted>false</isReservationRestricted>
-        <name>Abiquo</name>
-        <repositoryHard>0</repositoryHard>
-        <repositorySoft>0</repositorySoft>
-    </enterprise>
-</enterprises>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/events-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/events-lastpage.xml b/abiquo/src/test/resources/payloads/events-lastpage.xml
deleted file mode 100644
index 84e1a73..0000000
--- a/abiquo/src/test/resources/payloads/events-lastpage.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<events>
-    <link rel="first" href="http://localhost/api/events"/>
-    <link rel="previous" href="http://localhost/api/events?startwith=0"/>
-    <link rel="last" href="http://localhost/api/events?startwith=1"/>
-    <totalSize>4</totalSize>
-    <event>
-        <actionPerformed>VOLUME_DELETE</actionPerformed>
-        <component>VOLUME</component>
-        <enterprise>Abiquo</enterprise>
-        <id>110</id>
-        <idEnterprise>1</idEnterprise>
-        <idUser>1</idUser>
-        <idVirtualDatacenter>1</idVirtualDatacenter>
-        <idVolume>1786</idVolume>
-        <performedBy>admin</performedBy>
-        <severity>INFO</severity>
-        <stacktrace>Deleting volume &apos;JC-3972c0f8-28b&apos;</stacktrace>
-        <timestamp>2013-01-23T14:07:14Z</timestamp>
-        <user>admin</user>
-        <virtualDatacenter>JC-d0cf5cd6-67b</virtualDatacenter>
-        <volume>JC-3972c0f8-28b</volume>
-    </event>
-    <event>
-        <actionPerformed>VOLUME_MODIFY</actionPerformed>
-        <component>VOLUME</component>
-        <enterprise>Abiquo</enterprise>
-        <id>111</id>
-        <idEnterprise>1</idEnterprise>
-        <idUser>1</idUser>
-        <idVirtualDatacenter>1</idVirtualDatacenter>
-        <idVolume>1786</idVolume>
-        <performedBy>admin</performedBy>
-        <severity>INFO</severity>
-        <stacktrace>Updated size of volume &apos;JC-Event vol&apos; to &apos;32&apos; MB</stacktrace>
-        <timestamp>2013-01-23T14:07:12Z</timestamp>
-        <user>admin</user>
-        <virtualDatacenter>JC-d0cf5cd6-67b</virtualDatacenter>
-        <volume>JC-3972c0f8-28b</volume>
-    </event>
-</events>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/events-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/events-page.xml b/abiquo/src/test/resources/payloads/events-page.xml
deleted file mode 100644
index 4ac8d22..0000000
--- a/abiquo/src/test/resources/payloads/events-page.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<events>
-    <link rel="first" href="http://localhost/api/events"/>
-    <link rel="next" href="http://localhost/api/events?startwith=1"/>
-    <link rel="last" href="http://localhost/api/events?startwith=1"/>
-    <totalSize>4</totalSize>
-    <event>
-        <actionPerformed>VOLUME_DELETE</actionPerformed>
-        <component>VOLUME</component>
-        <enterprise>Abiquo</enterprise>
-        <id>109</id>
-        <idEnterprise>1</idEnterprise>
-        <idUser>1</idUser>
-        <idVirtualDatacenter>1</idVirtualDatacenter>
-        <idVolume>1786</idVolume>
-        <performedBy>admin</performedBy>
-        <severity>INFO</severity>
-        <stacktrace>Deleting volume &apos;JC-3972c0f8-28b&apos;</stacktrace>
-        <timestamp>2013-01-23T14:07:14Z</timestamp>
-        <user>admin</user>
-        <virtualDatacenter>JC-d0cf5cd6-67b</virtualDatacenter>
-        <volume>JC-3972c0f8-28b</volume>
-    </event>
-    <event>
-        <actionPerformed>VOLUME_MODIFY</actionPerformed>
-        <component>VOLUME</component>
-        <enterprise>Abiquo</enterprise>
-        <id>108</id>
-        <idEnterprise>1</idEnterprise>
-        <idUser>1</idUser>
-        <idVirtualDatacenter>1</idVirtualDatacenter>
-        <idVolume>1786</idVolume>
-        <performedBy>admin</performedBy>
-        <severity>INFO</severity>
-        <stacktrace>Updated size of volume &apos;JC-Event vol&apos; to &apos;32&apos; MB</stacktrace>
-        <timestamp>2013-01-23T14:07:12Z</timestamp>
-        <user>admin</user>
-        <virtualDatacenter>JC-d0cf5cd6-67b</virtualDatacenter>
-        <volume>JC-3972c0f8-28b</volume>
-    </event>
-</events>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/externalips-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/externalips-lastpage.xml b/abiquo/src/test/resources/payloads/externalips-lastpage.xml
deleted file mode 100644
index 5e9311a..0000000
--- a/abiquo/src/test/resources/payloads/externalips-lastpage.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<externalips>
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="first" />
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips?startwith=0" rel="previous" />
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips?startwith=3" rel="last" />
-    <totalSize>4</totalSize>
-    <externalip>
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2" rel="externalnetwork" title="ExternalNetwork" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="ips" type="application/vnd.abiquo.externalips+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips/3" rel="self" title="externalip" type="application/vnd.abiquo.externalip+xml" />
-        <id>3</id>
-        <ip>10.0.0.1</ip>
-        <networkName>ExternalNetwork</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </externalip>
-    <externalip>
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2" rel="externalnetwork" title="ExternalNetwork" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="ips" type="application/vnd.abiquo.externalips+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips/4" rel="self" title="externalip" type="application/vnd.abiquo.externalip+xml" />
-        <id>4</id>
-        <ip>10.0.0.2</ip>
-        <networkName>ExternalNetwork</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </externalip>
-</externalips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/externalips-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/externalips-page.xml b/abiquo/src/test/resources/payloads/externalips-page.xml
deleted file mode 100644
index 4abe4a8..0000000
--- a/abiquo/src/test/resources/payloads/externalips-page.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<externalips>
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="first" />
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips?startwith=3" rel="next" />
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips?startwith=3" rel="last" />
-    <totalSize>4</totalSize>
-    <externalip>
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2" rel="externalnetwork" title="ExternalNetwork" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="ips" type="application/vnd.abiquo.externalips+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips/1" rel="self" title="externalip" type="application/vnd.abiquo.externalip+xml" />
-        <id>1</id>
-        <ip>10.0.0.1</ip>
-        <networkName>ExternalNetwork</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </externalip>
-    <externalip>
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2" rel="externalnetwork" title="ExternalNetwork" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="ips" type="application/vnd.abiquo.externalips+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips/2" rel="self" title="externalip" type="application/vnd.abiquo.externalip+xml" />
-        <id>2</id>
-        <ip>10.0.0.2</ip>
-        <networkName>ExternalNetwork</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </externalip>
-</externalips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/nst-create.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/nst-create.xml b/abiquo/src/test/resources/payloads/nst-create.xml
deleted file mode 100644
index 1accdeb..0000000
--- a/abiquo/src/test/resources/payloads/nst-create.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<networkservicetype>
-    <name>Service Network</name>
-    <defaultNST>true</defaultNST>
-</networkservicetype>

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/nst-edit.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/nst-edit.xml b/abiquo/src/test/resources/payloads/nst-edit.xml
deleted file mode 100644
index cf564af..0000000
--- a/abiquo/src/test/resources/payloads/nst-edit.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<networkservicetype>
-    <link href="http://localhost/api/admin/datacenters/1/networkservicetypes/1" type="application/vnd.abiquo.networkservicetype+xml" rel="edit"/>
-    <id>1</id>
-    <name>Service Network</name>
-    <defaultNST>true</defaultNST>
-</networkservicetype>

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/nst-list.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/nst-list.xml b/abiquo/src/test/resources/payloads/nst-list.xml
deleted file mode 100644
index d83f468..0000000
--- a/abiquo/src/test/resources/payloads/nst-list.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<networkservicestypes>
-    <networkservicetype>
-        <link rel="edit" type="application/vnd.abiquo.networkservicetype+xml" href="http://localhost:80/api/admin/datacenters/1/networkservicetypes/3"/>
-        <id>1</id>
-        <name>Service Network</name>
-        <defaultNST>true</defaultNST>
-    </networkservicetype>
-    <networkservicetype>
-        <link rel="edit" type="application/vnd.abiquo.networkservicetype+xml" href="http://localhost:80/api/admin/datacenters/1/networkservicetypes/2"/>
-        <id>2</id>
-        <name>Storage Network</name>
-        <defaultNST>false</defaultNST>
-    </networkservicetype>
-</networkservicestypes>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/privateips-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/privateips-lastpage.xml b/abiquo/src/test/resources/payloads/privateips-lastpage.xml
deleted file mode 100644
index d289567..0000000
--- a/abiquo/src/test/resources/payloads/privateips-lastpage.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<privateips>
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips" rel="first" />
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips?startwith=0" rel="previous" />
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips?startwith=1" rel="last" />
-    <totalSize>2</totalSize>
-    <privateip>
-        <link href="http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1" rel="privatenetwork" title="JC--privatenetwork-test" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips/3311" rel="self" title="privateip" type="application/vnd.abiquo.privateip+xml" />
-        <link href="http://localhost/api/cloud/virtualdatacenters/1" rel="virtualdatacenter" title="Aloha updated" type="application/vnd.abiquo.virtualdatacenter+xml" />
-        <id>2</id>
-        <ip>192.168.1.1</ip>
-        <mac>00:50:56:11:d4:a2</mac>
-        <name>00505611d4a2_host</name>
-        <networkName>JC--privatenetwork-test</networkName>
-    </privateip>
-</privateips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/privateips-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/privateips-page.xml b/abiquo/src/test/resources/payloads/privateips-page.xml
deleted file mode 100644
index 4a6acb1..0000000
--- a/abiquo/src/test/resources/payloads/privateips-page.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<privateips>
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips" rel="first" />
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips?startwith=1" rel="next" />
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips?startwith=1" rel="last" />
-    <totalSize>2</totalSize>
-    <privateip>
-        <link href="http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1" rel="privatenetwork" title="JC--privatenetwork-test" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips/3311" rel="self" title="privateip" type="application/vnd.abiquo.privateip+xml" />
-        <link href="http://localhost/api/cloud/virtualdatacenters/1" rel="virtualdatacenter" title="Aloha updated" type="application/vnd.abiquo.virtualdatacenter+xml" />
-        <id>1</id>
-        <ip>192.168.1.1</ip>
-        <mac>00:50:56:11:d4:a2</mac>
-        <name>00505611d4a2_host</name>
-        <networkName>JC--privatenetwork-test</networkName>
-    </privateip>
-</privateips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/publicips-available-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/publicips-available-lastpage.xml b/abiquo/src/test/resources/payloads/publicips-available-lastpage.xml
deleted file mode 100644
index dec31ec..0000000
--- a/abiquo/src/test/resources/payloads/publicips-available-lastpage.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<publicips>
-    <link rel="first" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase" />
-    <link rel="previous" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase?startwith=0" />
-    <link rel="last" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase?startwith=3" />
-    <totalSize>4</totalSize>
-    <publicip>
-        <link title="publicip" rel="edit" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase/3" />
-        <link title="publi" rel="publicnetwork" type="application/vnd.abiquo.vlan+xml" href="http://localhost/api/admin/datacenters/1/network/4" />
-        <link title="PUT" rel="purchase" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/3" />
-        <link rel="topurchase" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase" />
-        <id>3</id>
-        <ip>8.8.8.1</ip>
-        <networkName>publi</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-    <publicip>
-        <link title="publicip" rel="edit" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase/4" />
-        <link title="publi" rel="publicnetwork" type="application/vnd.abiquo.vlan+xml" href="http://localhost/api/admin/datacenters/1/network/4" />
-        <link title="PUT" rel="purchase" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/4" />
-        <link rel="topurchase" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase" />
-        <id>4</id>
-        <ip>8.8.8.3</ip>
-        <networkName>publi</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-</publicips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/publicips-available-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/publicips-available-page.xml b/abiquo/src/test/resources/payloads/publicips-available-page.xml
deleted file mode 100644
index f53c4ac..0000000
--- a/abiquo/src/test/resources/payloads/publicips-available-page.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<publicips>
-    <link rel="first" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase" />
-    <link rel="next" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase?startwith=3" />
-    <link rel="last" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase?startwith=3" />
-    <totalSize>4</totalSize>
-    <publicip>
-        <link title="publicip" rel="edit" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase/1" />
-        <link title="publi" rel="publicnetwork" type="application/vnd.abiquo.vlan+xml" href="http://localhost/api/admin/datacenters/1/network/4" />
-        <link title="PUT" rel="purchase" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/1" />
-        <link rel="topurchase" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase" />
-        <id>1</id>
-        <ip>8.8.8.1</ip>
-        <networkName>publi</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-    <publicip>
-        <link title="publicip" rel="edit" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase/2" />
-        <link title="publi" rel="publicnetwork" type="application/vnd.abiquo.vlan+xml" href="http://localhost/api/admin/datacenters/1/network/4" />
-        <link title="PUT" rel="purchase" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/2" />
-        <link rel="topurchase" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase" />
-        <id>2</id>
-        <ip>8.8.8.3</ip>
-        <networkName>publi</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-</publicips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/publicips-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/publicips-lastpage.xml b/abiquo/src/test/resources/payloads/publicips-lastpage.xml
deleted file mode 100644
index 04741d3..0000000
--- a/abiquo/src/test/resources/payloads/publicips-lastpage.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<publicips>
-    <link href="http://localhost/api/admin/datacenters/1/network/1/ips" rel="first" />
-    <link href="http://localhost/api/admin/datacenters/1/network/1/ips?startwith=0" rel="previous" />
-    <link href="http://localhost/api/admin/datacenters/1/network/1/ips?startwith=3" rel="last" />
-    <totalSize>4</totalSize>
-    <publicip>
-        <link href="http://localhost/api/admin/datacenters/1/network/1" rel="publicnetwork" title="JC--publicnetwork-test" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/datacenters/1/network/1/ips/3" rel="self" title="publicip" type="application/vnd.abiquo.publicip+xml" />
-        <id>3</id>
-        <ip>80.80.80.1</ip>
-        <networkName>JC--publicnetwork-test</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-    <publicip>
-        <link href="http://localhost/api/admin/datacenters/1/network/1" rel="publicnetwork" title="JC--publicnetwork-test" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/datacenters/1/network/1/ips/4" rel="self" title="publicip" type="application/vnd.abiquo.publicip+xml" />
-        <id>4</id>
-        <ip>80.80.80.2</ip>
-        <networkName>JC--publicnetwork-test</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-</publicips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/publicips-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/publicips-page.xml b/abiquo/src/test/resources/payloads/publicips-page.xml
deleted file mode 100644
index 092b403..0000000
--- a/abiquo/src/test/resources/payloads/publicips-page.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<publicips>
-    <link href="http://localhost/api/admin/datacenters/1/network/1/ips" rel="first" />
-    <link href="http://localhost/api/admin/datacenters/1/network/1/ips?startwith=3" rel="next" />
-    <link href="http://localhost/api/admin/datacenters/1/network/1/ips?startwith=3" rel="last" />
-    <totalSize>4</totalSize>
-    <publicip>
-        <link href="http://localhost/api/admin/datacenters/1/network/1" rel="publicnetwork" title="JC--publicnetwork-test" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/datacenters/1/network/1/ips/1" rel="self" title="publicip" type="application/vnd.abiquo.publicip+xml" />
-        <id>1</id>
-        <ip>80.80.80.1</ip>
-        <networkName>JC--publicnetwork-test</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-    <publicip>
-        <link href="http://localhost/api/admin/datacenters/1/network/1" rel="publicnetwork" title="JC--publicnetwork-test" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/datacenters/1/network/1/ips/2" rel="self" title="publicip" type="application/vnd.abiquo.publicip+xml" />
-        <id>2</id>
-        <ip>80.80.80.2</ip>
-        <networkName>JC--publicnetwork-test</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-</publicips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/publicips-purchased-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/publicips-purchased-lastpage.xml b/abiquo/src/test/resources/payloads/publicips-purchased-lastpage.xml
deleted file mode 100644
index 077b304..0000000
--- a/abiquo/src/test/resources/payloads/publicips-purchased-lastpage.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<publicips>
-    <link rel="first" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased" />
-    <link rel="previous" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased?startwith=0" />
-    <link rel="last" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased?startwith=3" />
-    <totalSize>4</totalSize>
-    <publicip>
-        <link title="publicip" rel="edit" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/3" />
-        <link title="publi" rel="publicnetwork" type="application/vnd.abiquo.vlan+xml" href="http://localhost/api/admin/datacenters/1/network/4" />
-        <link title="PUT" rel="purchase" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/3" />
-        <link rel="topurchase" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase" />
-        <id>3</id>
-        <ip>8.8.8.1</ip>
-        <networkName>publi</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-    <publicip>
-        <link title="publicip" rel="edit" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/4" />
-        <link title="publi" rel="publicnetwork" type="application/vnd.abiquo.vlan+xml" href="http://localhost/api/admin/datacenters/1/network/4" />
-        <link title="PUT" rel="purchase" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/4" />
-        <link rel="topurchase" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase" />
-        <id>4</id>
-        <ip>8.8.8.3</ip>
-        <networkName>publi</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-</publicips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/publicips-purchased-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/publicips-purchased-page.xml b/abiquo/src/test/resources/payloads/publicips-purchased-page.xml
deleted file mode 100644
index 9456946..0000000
--- a/abiquo/src/test/resources/payloads/publicips-purchased-page.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<publicips>
-    <link rel="first" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased" />
-    <link rel="next" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased?startwith=3" />
-    <link rel="last" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased?startwith=3" />
-    <totalSize>4</totalSize>
-    <publicip>
-        <link title="publicip" rel="edit" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/1" />
-        <link title="publi" rel="publicnetwork" type="application/vnd.abiquo.vlan+xml" href="http://localhost/api/admin/datacenters/1/network/4" />
-        <link title="PUT" rel="purchase" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/1" />
-        <link rel="topurchase" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase" />
-        <id>1</id>
-        <ip>8.8.8.1</ip>
-        <networkName>publi</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-    <publicip>
-        <link title="publicip" rel="edit" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/2" />
-        <link title="publi" rel="publicnetwork" type="application/vnd.abiquo.vlan+xml" href="http://localhost/api/admin/datacenters/1/network/4" />
-        <link title="PUT" rel="purchase" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased/2" />
-        <link rel="topurchase" type="application/vnd.abiquo.publicips+xml" href="http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase" />
-        <id>2</id>
-        <ip>8.8.8.3</ip>
-        <networkName>publi</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-    </publicip>
-</publicips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/templates-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/templates-lastpage.xml b/abiquo/src/test/resources/payloads/templates-lastpage.xml
deleted file mode 100644
index 63fa4cb..0000000
--- a/abiquo/src/test/resources/payloads/templates-lastpage.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<virtualMachineTemplates>
-    <link rel="first" href="http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates"/>
-    <link rel="previous" href="http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates?startwith=0"/>
-    <link rel="last" href="http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates?startwith=1"/>
-    <totalSize>2</totalSize>
-    <virtualMachineTemplate>
-        <link title="Web Servers" rel="category" type="application/vnd.abiquo.category+xml" href="http://localhost/api/config/categories/14"/>
-        <link rel="conversions" type="application/vnd.abiquo.conversions+xml" href="http://localhost/api/admin/enterprises/152/datacenterrepositories/2/virtualmachinetemplates/151/conversions"/>
-        <link rel="datacenter" type="application/vnd.abiquo.datacenter+xml" href="http://localhost/api/admin/datacenters/2"/>
-        <link rel="datacenterrepository" type="application/vnd.abiquo.datacenterrepository+xml" href="http://localhost/api/admin/enterprises/152/datacenterrepositories/2"/>
-        <link rel="diskfile" href="http://localhost/am/erepos/152/templates/apache%252Fubuntu-910-server-x86_64-vmdk5.ovf?format=diskFile"/>
-        <link title="Apache Server" rel="edit" type="application/vnd.abiquo.virtualmachinetemplate+xml" href="http://localhost/api/admin/enterprises/152/datacenterrepositories/2/virtualmachinetemplates/151"/>
-        <link rel="enterprise" type="application/vnd.abiquo.enterprise+xml" href="http://localhost/api/admin/enterprises/152"/>
-        <link rel="ovfdocument" href="http://localhost/am/erepos/152/templates/apache%252Fubuntu-910-server-x86_64-vmdk5.ovf?format=envelope"/>
-        <link rel="template" href="http://localhost/am/erepos/152/templates/apache%252Fubuntu-910-server-x86_64-vmdk5.ovf"/>
-        <link rel="templatedefinition" href="http://apache/ubuntu-910-server-x86_64-vmdk5.ovf"/>
-        <link rel="templatestatus" href="http://localhost/am/erepos/152/templates/apache%252Fubuntu-910-server-x86_64-vmdk5.ovf?format=status"/>
-        <id>152</id>
-        <name>Apache Server</name>
-        <description>Apache Server</description>
-        <path>1/apache/ubuntu-910-server-x86_64-vmdk5.vmdk</path>
-        <diskFormatType>VMDK_STREAM_OPTIMIZED</diskFormatType>
-        <diskFileSize>206947328</diskFileSize>
-        <cpuRequired>1</cpuRequired>
-        <ramRequired>512</ramRequired>
-        <hdRequired>734003200</hdRequired>
-        <shared>true</shared>
-        <costCode>0</costCode>
-        <creationDate>2012-04-18T17:42:42+02:00</creationDate>
-        <creationUser>SYSTEM</creationUser>
-        <chefEnabled>false</chefEnabled>
-        <iconUrl>http://icons.abiquo.com/apache.jpg</iconUrl>
-    </virtualMachineTemplate>
-</virtualMachineTemplates>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/templates-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/templates-page.xml b/abiquo/src/test/resources/payloads/templates-page.xml
deleted file mode 100644
index ec98f93..0000000
--- a/abiquo/src/test/resources/payloads/templates-page.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<virtualMachineTemplates>
-    <link rel="first" href="http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates"/>
-    <link rel="next" href="http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates?startwith=1"/>
-    <link rel="last" href="http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates?startwith=1"/>
-    <totalSize>2</totalSize>
-    <virtualMachineTemplate>
-        <link title="Web Servers" rel="category" type="application/vnd.abiquo.category+xml" href="http://localhost/api/config/categories/14"/>
-        <link rel="conversions" type="application/vnd.abiquo.conversions+xml" href="http://localhost/api/admin/enterprises/152/datacenterrepositories/2/virtualmachinetemplates/151/conversions"/>
-        <link rel="datacenter" type="application/vnd.abiquo.datacenter+xml" href="http://localhost/api/admin/datacenters/2"/>
-        <link rel="datacenterrepository" type="application/vnd.abiquo.datacenterrepository+xml" href="http://localhost/api/admin/enterprises/152/datacenterrepositories/2"/>
-        <link rel="diskfile" href="http://localhost/am/erepos/152/templates/apache%252Fubuntu-910-server-x86_64-vmdk5.ovf?format=diskFile"/>
-        <link title="Apache Server" rel="edit" type="application/vnd.abiquo.virtualmachinetemplate+xml" href="http://localhost/api/admin/enterprises/152/datacenterrepositories/2/virtualmachinetemplates/151"/>
-        <link rel="enterprise" type="application/vnd.abiquo.enterprise+xml" href="http://localhost/api/admin/enterprises/152"/>
-        <link rel="ovfdocument" href="http://localhost/am/erepos/152/templates/apache%252Fubuntu-910-server-x86_64-vmdk5.ovf?format=envelope"/>
-        <link rel="template" href="http://localhost/am/erepos/152/templates/apache%252Fubuntu-910-server-x86_64-vmdk5.ovf"/>
-        <link rel="templatedefinition" href="http://apache/ubuntu-910-server-x86_64-vmdk5.ovf"/>
-        <link rel="templatestatus" href="http://localhost/am/erepos/152/templates/apache%252Fubuntu-910-server-x86_64-vmdk5.ovf?format=status"/>
-        <id>151</id>
-        <name>Apache Server</name>
-        <description>Apache Server</description>
-        <path>1/apache/ubuntu-910-server-x86_64-vmdk5.vmdk</path>
-        <diskFormatType>VMDK_STREAM_OPTIMIZED</diskFormatType>
-        <diskFileSize>206947328</diskFileSize>
-        <cpuRequired>1</cpuRequired>
-        <ramRequired>512</ramRequired>
-        <hdRequired>734003200</hdRequired>
-        <shared>true</shared>
-        <costCode>0</costCode>
-        <creationDate>2012-04-18T17:42:42+02:00</creationDate>
-        <creationUser>SYSTEM</creationUser>
-        <chefEnabled>false</chefEnabled>
-        <iconUrl>http://icons.abiquo.com/apache.jpg</iconUrl>
-    </virtualMachineTemplate>
-</virtualMachineTemplates>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/unmanagedips-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/unmanagedips-lastpage.xml b/abiquo/src/test/resources/payloads/unmanagedips-lastpage.xml
deleted file mode 100644
index aade3a4..0000000
--- a/abiquo/src/test/resources/payloads/unmanagedips-lastpage.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<unmanagedips>
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="first" />
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips?startwith=0" rel="previous" />
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips?startwith=3" rel="last" />
-    <totalSize>4</totalSize>
-    <unmanagedip>
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2" rel="externalnetwork" title="ExternalNetwork" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="ips" type="application/vnd.abiquo.externalips+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips/3" rel="self" title="externalip" type="application/vnd.abiquo.externalip+xml" />
-        <id>3</id>
-        <ip>10.0.0.1</ip>
-        <networkName>UnmanagedNetwork</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-        <unmanaged>true</unmanaged>
-    </unmanagedip>
-    <unmanagedip>
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2" rel="externalnetwork" title="ExternalNetwork" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="ips" type="application/vnd.abiquo.externalips+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips/4" rel="self" title="externalip" type="application/vnd.abiquo.externalip+xml" />
-        <id>4</id>
-        <ip>10.0.0.2</ip>
-        <networkName>UnmanagedNetwork</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-        <unmanaged>true</unmanaged>
-    </unmanagedip>
-</unmanagedips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/unmanagedips-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/unmanagedips-page.xml b/abiquo/src/test/resources/payloads/unmanagedips-page.xml
deleted file mode 100644
index 2302218..0000000
--- a/abiquo/src/test/resources/payloads/unmanagedips-page.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<unmanagedips>
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="first" />
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips?startwith=3" rel="next" />
-    <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips?startwith=3" rel="last" />
-    <totalSize>4</totalSize>
-    <unmanagedip>
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2" rel="externalnetwork" title="ExternalNetwork" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="ips" type="application/vnd.abiquo.externalips+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips/1" rel="self" title="externalip" type="application/vnd.abiquo.externalip+xml" />
-        <id>1</id>
-        <ip>10.0.0.1</ip>
-        <networkName>UnmanagedNetwork</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-        <unmanaged>true</unmanaged>
-    </unmanagedip>
-    <unmanagedip>
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2" rel="externalnetwork" title="ExternalNetwork" type="application/vnd.abiquo.vlan+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips" rel="ips" type="application/vnd.abiquo.externalips+xml" />
-        <link href="http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips/2" rel="self" title="externalip" type="application/vnd.abiquo.externalip+xml" />
-        <id>2</id>
-        <ip>10.0.0.2</ip>
-        <networkName>UnmanagedNetwork</networkName>
-        <available>true</available>
-        <quarantine>false</quarantine>
-        <unmanaged>true</unmanaged>
-    </unmanagedip>
-</unmanagedips>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/users-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/users-lastpage.xml b/abiquo/src/test/resources/payloads/users-lastpage.xml
deleted file mode 100644
index def0a5b..0000000
--- a/abiquo/src/test/resources/payloads/users-lastpage.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<users>
-	<link rel="first" href="http://10.7.3.10:80/api/admin/enterprises/1/users?limit=2"/>
-	<link rel="previous" href="http://10.7.3.10:80/api/admin/enterprises/1/users?startwith=0&amp;limit=2"/>
-    <link rel="next" href="http://10.7.3.10:80/api/admin/enterprises/1/users?startwith=3&amp;limit=2"/>
-	<link rel="last" href="http://10.7.3.10:80/api/admin/enterprises/1/users?startwith=1&amp;limit=2"/>
-	<totalSize>3</totalSize>
-    <user>
-		<link rel="edit" type="application/vnd.abiquo.user+xml" href="http://localhost/api/admin/enterprises/1/users/3"/>
-		<link rel="enterprise" type="application/vnd.abiquo.enterprise+xml" href="http://localhost/api/admin/enterprises/1"/>
-		<link rel="role" type="application/vnd.abiquo.role+xml" href="http://localhost/api/admin/roles/7"/>
-		<link rel="virtualmachines" type="application/vnd.abiquo.virtualmachines+xml" href="http://localhost/api/admin/enterprises/1/users/3/action/virtualmachines"/>
-		<id>3</id>
-		<nick>ron</nick>
-		<password>0371e4dce3c8804f1543c3f0f309cc10</password>
-		<name>Ron</name>
-		<surname>Weasley</surname>
-		<description/>
-		<email>ron.weasley@hogwarts.edu</email>
-		<locale>en_EN</locale>
-		<authType>ABIQUO</authType>
-		<active>true</active>
-    </user>
-</users>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/users-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/users-page.xml b/abiquo/src/test/resources/payloads/users-page.xml
deleted file mode 100644
index 5427878..0000000
--- a/abiquo/src/test/resources/payloads/users-page.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<users>
-	<link rel="first" href="http://localhost/api/admin/enterprises/1/users?limit=2"/>
-    <link rel="next" href="http://localhost/api/admin/enterprises/1/users?startwith=2&amp;limit=2"/>
-	<link rel="last" href="http://localhost/api/admin/enterprises/1/users?startwith=2&amp;limit=2"/>
-	<totalSize>3</totalSize>
-    <user>
-		<link rel="edit" type="application/vnd.abiquo.user+xml" href="http://localhost/api/admin/enterprises/1/users/1"/>
-		<link rel="enterprise" type="application/vnd.abiquo.enterprise+xml" href="http://localhost/api/admin/enterprises/1"/>
-		<link rel="role" type="application/vnd.abiquo.role+xml" href="http://localhost/api/admin/roles/7"/>
-		<link rel="virtualmachines" type="application/vnd.abiquo.virtualmachines+xml" href="http://localhost/api/admin/enterprises/1/users/1/action/virtualmachines"/>
-		<id>1</id>
-		<nick>potter</nick>
-		<password>0371e4dce3c8804f1543c3f0f309cc10</password>
-		<name>Harry</name>
-		<surname>Potter</surname>
-		<description/>
-		<email>harry.potter@hogwarts.edu</email>
-		<locale>en_EN</locale>
-		<authType>ABIQUO</authType>
-		<active>true</active>
-    </user>
-    <user>
-		<link rel="edit" type="application/vnd.abiquo.user+xml" href="http://localhost/api/admin/enterprises/1/users/2"/>
-		<link rel="enterprise" type="application/vnd.abiquo.enterprise+xml" href="http://localhost/api/admin/enterprises/1"/>
-		<link rel="role" type="application/vnd.abiquo.role+xml" href="http://localhost/api/admin/roles/7"/>
-		<link rel="virtualmachines" type="application/vnd.abiquo.virtualmachines+xml" href="http://localhost/api/admin/enterprises/1/users/2/action/virtualmachines"/>
-		<id>2</id>
-		<nick>granger</nick>
-		<password>0371e4dce3c8804f1543c3f0f309cc10</password>
-		<name>Hermione</name>
-		<surname>Granger</surname>
-		<description/>
-		<email>hermione.granger@hogwarts.edu</email>
-		<locale>en_EN</locale>
-		<authType>ABIQUO</authType>
-		<active>true</active>
-    </user>
-</users>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/vm-accepted-request.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/vm-accepted-request.xml b/abiquo/src/test/resources/payloads/vm-accepted-request.xml
deleted file mode 100644
index 2efc649..0000000
--- a/abiquo/src/test/resources/payloads/vm-accepted-request.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<acceptedrequest>
-    <link rel="task" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/tasks/169f1877-5f17-4f62-9563-974001295c54" />
-</acceptedrequest>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/vm-snapshot.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/vm-snapshot.xml b/abiquo/src/test/resources/payloads/vm-snapshot.xml
deleted file mode 100644
index 7e28a7b..0000000
--- a/abiquo/src/test/resources/payloads/vm-snapshot.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<virtualmachineinstance>
-    <instanceName>foo</instanceName>
-</virtualmachineinstance>

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/vms-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/vms-lastpage.xml b/abiquo/src/test/resources/payloads/vms-lastpage.xml
deleted file mode 100644
index 889874f..0000000
--- a/abiquo/src/test/resources/payloads/vms-lastpage.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<virtualmachineswithnodeextended>
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines" rel="first" />
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines?startwith=0" rel="previous" />
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines?startwith=2" rel="last" />
-    <totalSize>2</totalSize>
-    <virtualmachinewithnodeextended>
-        <link rel="deploy" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/deploy" />
-        <link rel="disks" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/disks" />
-        <link rel="edit" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1" />
-        <link rel="state" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/state" />
-        <link rel="reset" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/reset" />
-        <link rel="tasks" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/tasks" />
-        <link rel="undeploy" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/undeploy" />
-        <link rel="persistent" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/persistent" />
-        <link rel="virtualappliance" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1" />
-        <link rel="virtualmachinetemplate" href="/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1" />
-        <link rel="nics" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/nics" />
-        <link rel="volumes" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/volumes" />
-        <link rel="configurations" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/configurations" />
-        <cpu>0</cpu>
-        <hdInBytes>0</hdInBytes>
-        <highDisponibility>0</highDisponibility>
-        <id>2</id>
-        <idState>0</idState>
-        <idType>0</idType>
-        <name>VM</name>
-        <ram>0</ram>
-        <vdrpPort>0</vdrpPort>
-    </virtualmachinewithnodeextended>
-</virtualmachineswithnodeextended>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/vms-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/vms-page.xml b/abiquo/src/test/resources/payloads/vms-page.xml
deleted file mode 100644
index 4535697..0000000
--- a/abiquo/src/test/resources/payloads/vms-page.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<virtualmachineswithnodeextended>
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines" rel="first" />
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines?startwith=2" rel="next" />
-    <link href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines?startwith=2" rel="last" />
-    <totalSize>2</totalSize>
-    <virtualmachinewithnodeextended>
-        <link rel="deploy" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/deploy" />
-        <link rel="disks" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/disks" />
-        <link rel="edit" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1" />
-        <link rel="state" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/state" />
-        <link rel="reset" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/reset" />
-        <link rel="tasks" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/tasks" />
-        <link rel="undeploy" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/undeploy" />
-        <link rel="persistent" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/persistent" />
-        <link rel="virtualappliance" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1" />
-        <link rel="virtualmachinetemplate" href="/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1" />
-        <link rel="nics" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/nics" />
-        <link rel="volumes" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/volumes" />
-        <link rel="configurations" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/configurations" />
-        <cpu>0</cpu>
-        <hdInBytes>0</hdInBytes>
-        <highDisponibility>0</highDisponibility>
-        <id>1</id>
-        <idState>0</idState>
-        <idType>0</idType>
-        <name>VM</name>
-        <ram>0</ram>
-        <vdrpPort>0</vdrpPort>
-    </virtualmachinewithnodeextended>
-</virtualmachineswithnodeextended>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/volumes-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/volumes-lastpage.xml b/abiquo/src/test/resources/payloads/volumes-lastpage.xml
deleted file mode 100644
index 3df58b0..0000000
--- a/abiquo/src/test/resources/payloads/volumes-lastpage.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<volumes>
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/volumes" rel="first" />
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/volumes?startwith=0" rel="previous" />
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/volumes?startwith=1" rel="last" />
-    <totalSize>2</totalSize>
-    <volume>
-        <link href="http://example.com/api/cloud/virtualdatacenters/1/volumes/1531" rel="edit" type="application/vnd.abiquo.volume+xml" />
-        <link href="http://example.com/api/cloud/virtualdatacenters/1/volumes/1531/action/initiatormappings" rel="initiator mappings" type="application/vnd.abiquo.initiatormappings+xml" />
-        <link href="http://example.com/api/cloud/virtualdatacenters/1/tiers/1" rel="tier" title="Default Tier 1" type="application/vnd.abiquo.tier+xml" />
-        <link href="http://example.com/api/cloud/virtualdatacenters/1" rel="virtualdatacenter" title="Aloha updated" type="application/vnd.abiquo.virtualdatacenter+xml" />
-        <id>1531</id>
-        <name>Hawaian volume updated</name>
-        <state>DETACHED</state>
-        <sizeInMB>32</sizeInMB>
-        <sequence>0</sequence>
-    </volume>
-</volumes>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/volumes-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/volumes-page.xml b/abiquo/src/test/resources/payloads/volumes-page.xml
deleted file mode 100644
index d069445..0000000
--- a/abiquo/src/test/resources/payloads/volumes-page.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<volumes>
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/volumes" rel="first" />
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/volumes?startwith=1" rel="next" />
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/volumes?startwith=1" rel="last" />
-    <totalSize>2</totalSize>
-    <volume>
-        <link href="http://example.com/api/cloud/virtualdatacenters/1/volumes/1530" rel="edit" type="application/vnd.abiquo.volume+xml" />
-        <link href="http://example.com/api/cloud/virtualdatacenters/1/volumes/1530/action/initiatormappings" rel="initiator mappings" type="application/vnd.abiquo.initiatormappings+xml" />
-        <link href="http://example.com/api/cloud/virtualdatacenters/1/tiers/1" rel="tier" title="Default Tier 1" type="application/vnd.abiquo.tier+xml" />
-        <link href="http://example.com/api/cloud/virtualdatacenters/1" rel="virtualdatacenter" title="Aloha updated" type="application/vnd.abiquo.virtualdatacenter+xml" />
-        <id>1530</id>
-        <name>Hawaian volume updated</name>
-        <state>DETACHED</state>
-        <sizeInMB>32</sizeInMB>
-        <sequence>0</sequence>
-    </volume>
-</volumes>
\ No newline at end of file


[19/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/event/Event.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/event/Event.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/event/Event.java
deleted file mode 100644
index 2a478db..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/event/Event.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.event;
-
-import java.util.Date;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.SeverityType;
-import com.abiquo.server.core.event.EventDto;
-
-public class Event extends DomainWrapper<EventDto> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Event(final ApiContext<AbiquoApi> context, final EventDto target) {
-      super(context, target);
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getUser() {
-      return target.getUser();
-   }
-
-   public void setUser(final String user) {
-      target.setUser(user);
-   }
-
-   public String getStacktrace() {
-      return target.getStacktrace();
-   }
-
-   public void setStacktrace(final String stacktrace) {
-      target.setStacktrace(stacktrace);
-   }
-
-   public String getComponent() {
-      return target.getComponent();
-   }
-
-   public void setComponent(final String component) {
-      target.setComponent(component);
-   }
-
-   public String getPerformedBy() {
-      return target.getPerformedBy();
-   }
-
-   public void setPerformedBy(final String performedBy) {
-      target.setPerformedBy(performedBy);
-   }
-
-   public Integer getIdNetwork() {
-      return target.getIdNetwork();
-   }
-
-   public void setIdNetwork(final Integer idNetwork) {
-      target.setIdNetwork(idNetwork);
-   }
-
-   public String getIdVolume() {
-      return target.getIdVolume();
-   }
-
-   public void setIdVolume(final String idVolume) {
-      target.setIdVolume(idVolume);
-   }
-
-   public String getStoragePool() {
-      return target.getStoragePool();
-   }
-
-   public void setStoragePool(final String storagePool) {
-      target.setStoragePool(storagePool);
-   }
-
-   public Date getTimestamp() {
-      return target.getTimestamp();
-   }
-
-   public void setTimestamp(final Date timestamp) {
-      target.setTimestamp(timestamp);
-   }
-
-   public String getVirtualApp() {
-      return target.getVirtualApp();
-   }
-
-   public void setVirtualApp(final String virtualApp) {
-      target.setVirtualApp(virtualApp);
-   }
-
-   public String getDatacenter() {
-      return target.getDatacenter();
-   }
-
-   public void setDatacenter(final String datacenter) {
-      target.setDatacenter(datacenter);
-   }
-
-   public String getActionPerformed() {
-      return target.getActionPerformed();
-   }
-
-   public void setActionPerformed(final String actionPerformed) {
-      target.setActionPerformed(actionPerformed);
-   }
-
-   public Integer getIdVirtualMachine() {
-      return target.getIdVirtualMachine();
-   }
-
-   public void setIdVirtualMachine(final Integer idVirtualMachine) {
-      target.setIdVirtualMachine(idVirtualMachine);
-   }
-
-   public String getVirtualDatacenter() {
-      return target.getVirtualDatacenter();
-   }
-
-   public void setVirtualDatacenter(final String virtualDatacenter) {
-      target.setVirtualDatacenter(virtualDatacenter);
-   }
-
-   public String getEnterprise() {
-      return target.getEnterprise();
-   }
-
-   public void setEnterprise(final String enterprise) {
-      target.setEnterprise(enterprise);
-   }
-
-   public String getStorageSystem() {
-      return target.getStorageSystem();
-   }
-
-   public void setStorageSystem(final String storageSystem) {
-      target.setStorageSystem(storageSystem);
-   }
-
-   public Integer getIdPhysicalMachine() {
-      return target.getIdPhysicalMachine();
-   }
-
-   public void setIdPhysicalMachine(final Integer idPhysicalMachine) {
-      target.setIdPhysicalMachine(idPhysicalMachine);
-   }
-
-   public SeverityType getSeverity() {
-      return target.getSeverity();
-   }
-
-   public void setSeverity(final SeverityType severity) {
-      target.setSeverity(severity);
-   }
-
-   public Integer getIdStorageSystem() {
-      return target.getIdStorageSystem();
-   }
-
-   public void setIdStorageSystem(final Integer idStorageSystem) {
-      target.setIdStorageSystem(idStorageSystem);
-   }
-
-   public Integer getIdDatacenter() {
-      return target.getIdDatacenter();
-   }
-
-   public void setIdDatacenter(final Integer idDatacenter) {
-      target.setIdDatacenter(idDatacenter);
-   }
-
-   public String getNetwork() {
-      return target.getNetwork();
-   }
-
-   public void setNetwork(final String network) {
-      target.setNetwork(network);
-   }
-
-   public String getPhysicalMachine() {
-      return target.getPhysicalMachine();
-   }
-
-   public void setPhysicalMachine(final String physicalMachine) {
-      target.setPhysicalMachine(physicalMachine);
-   }
-
-   public String getRack() {
-      return target.getRack();
-   }
-
-   public void setRack(final String rack) {
-      target.setRack(rack);
-   }
-
-   public Integer getIdVirtualDatacenter() {
-      return target.getIdVirtualDatacenter();
-   }
-
-   public void setIdVirtualDatacenter(final Integer idVirtualDatacenter) {
-      target.setIdVirtualDatacenter(idVirtualDatacenter);
-   }
-
-   public Integer getIdSubnet() {
-      return target.getIdSubnet();
-   }
-
-   public void setIdSubnet(final Integer idSubnet) {
-      target.setIdSubnet(idSubnet);
-   }
-
-   public String getVolume() {
-      return target.getVolume();
-   }
-
-   public void setVolume(final String volume) {
-      target.setVolume(volume);
-   }
-
-   public String getSubnet() {
-      return target.getSubnet();
-   }
-
-   public void setSubnet(final String subnet) {
-      target.setSubnet(subnet);
-   }
-
-   public Integer getIdUser() {
-      return target.getIdUser();
-   }
-
-   public void setIdUser(final Integer idUser) {
-      target.setIdUser(idUser);
-   }
-
-   public String getIdStoragePool() {
-      return target.getIdStoragePool();
-   }
-
-   public void setIdStoragePool(final String idStoragePool) {
-      target.setIdStoragePool(idStoragePool);
-   }
-
-   public Integer getIdRack() {
-      return target.getIdRack();
-   }
-
-   public void setIdRack(final Integer idRack) {
-      target.setIdRack(idRack);
-   }
-
-   public String getVirtualMachine() {
-      return target.getVirtualMachine();
-   }
-
-   public void setVirtualMachine(final String virtualMachine) {
-      target.setVirtualMachine(virtualMachine);
-   }
-
-   public Integer getIdVirtualApp() {
-      return target.getIdVirtualApp();
-   }
-
-   public void setIdVirtualApp(final Integer idVirtualApp) {
-      target.setIdVirtualApp(idVirtualApp);
-   }
-
-   public Integer getIdEnterprise() {
-      return target.getIdEnterprise();
-   }
-
-   public void setIdEnterprise(final Integer idEnterprise) {
-      target.setIdEnterprise(idEnterprise);
-   }
-
-   @Override
-   public String toString() {
-      return "Event [id=" + getId() + ", idUser=" + getIdUser() + ", user=" + getUser() + ", idEnterprise="
-            + getIdEnterprise() + ", enterprise=" + getEnterprise() + ", actionPerformed=" + getActionPerformed()
-            + ", component=" + getComponent() + ", idDatacenter=" + getIdDatacenter() + ", datacenter="
-            + getDatacenter() + ", idStoragePool=" + getIdStoragePool() + ", storagePool=" + getStoragePool()
-            + ", idVolume=" + getIdVolume() + ", volume=" + getVolume() + ", idNetwork=" + getIdNetwork()
-            + ", network=" + getNetwork() + ", idPhysicalMachine=" + getIdPhysicalMachine() + ", physicalMachine="
-            + getPhysicalMachine() + ", idRack=" + getIdRack() + ", rack=" + getRack() + ", idStorageSystem="
-            + getIdStorageSystem() + ", storageSystem=" + getStorageSystem() + ", idSubnet=" + getIdSubnet()
-            + ", subnet=" + getSubnet() + ", idVirtualApp=" + getIdVirtualApp() + ", virtualApp=" + getVirtualApp()
-            + ", idVirtualDatacenter=" + getIdVirtualDatacenter() + ", virtualDatacenter=" + getVirtualDatacenter()
-            + ", idVirtualMachine=" + getIdVirtualMachine() + ", virtualMachine=" + getVirtualMachine()
-            + ", stacktrace=" + getStacktrace() + ", performedBy=" + getPerformedBy() + ", severity=" + getSeverity()
-            + "]";
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/event/options/EventOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/event/options/EventOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/event/options/EventOptions.java
deleted file mode 100644
index 183b981..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/event/options/EventOptions.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.event.options;
-
-import java.util.Date;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.jclouds.abiquo.domain.options.FilterOptions.BaseFilterOptionsBuilder;
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-import com.abiquo.model.enumerator.ComponentType;
-import com.abiquo.model.enumerator.EventType;
-import com.abiquo.model.enumerator.SeverityType;
-import com.google.common.collect.Maps;
-
-/**
- * Available options to query events.
- */
-public class EventOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      EventOptions options = new EventOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder extends BaseFilterOptionsBuilder<Builder> {
-      private Map<String, String> filters = Maps.newHashMap();
-
-      public Builder filters(final Map<String, String> filters) {
-         this.filters = filters;
-         return this;
-      }
-
-      public Builder severity(final SeverityType severity) {
-         this.filters.put("severity", severity.name());
-         return this;
-      }
-
-      public Builder component(final ComponentType component) {
-         this.filters.put("component", component.name());
-         return this;
-      }
-
-      public Builder actionPerformed(final EventType action) {
-         this.filters.put("actionperformed", action.name());
-         return this;
-      }
-
-      public Builder datacenterName(final String dc) {
-         this.filters.put("datacenter", dc);
-         return this;
-      }
-
-      public Builder rackName(final String rack) {
-         this.filters.put("rack", rack);
-         return this;
-      }
-
-      public Builder physicalMachineName(final String pm) {
-         this.filters.put("physicalmachine", pm);
-         return this;
-      }
-
-      public Builder storageSystemName(final String ss) {
-         this.filters.put("storagesystem", ss);
-         return this;
-      }
-
-      public Builder storagePoolName(final String sp) {
-         this.filters.put("storagepool", sp);
-         return this;
-      }
-
-      public Builder volumeName(final String volume) {
-         this.filters.put("volume", volume);
-         return this;
-      }
-
-      public Builder networkName(final String network) {
-         this.filters.put("network", network);
-         return this;
-      }
-
-      public Builder subnetName(final String subnet) {
-         this.filters.put("subnet", subnet);
-         return this;
-      }
-
-      public Builder enterpriseName(final String ent) {
-         this.filters.put("enterprise", ent);
-         return this;
-      }
-
-      public Builder userName(final String user) {
-         this.filters.put("user", user);
-         return this;
-      }
-
-      public Builder virtualDatacenterName(final String vdc) {
-         this.filters.put("virtualdatacenter", vdc);
-         return this;
-      }
-
-      public Builder virtualAppName(final String vapp) {
-         this.filters.put("virtualapp", vapp);
-         return this;
-      }
-
-      public Builder virtualMachineName(final String vm) {
-         this.filters.put("virtualMachine", vm);
-         return this;
-      }
-
-      public Builder performedBy(final String pb) {
-         this.filters.put("performedBy", pb);
-         return this;
-      }
-
-      public Builder description(final String description) {
-         this.filters.put("stacktrace", description);
-         return this;
-      }
-
-      public Builder dateFrom(final Date date) {
-         this.filters.put("datefrom", String.valueOf(date.getTime()));
-         return this;
-      }
-
-      public Builder dateTo(final Date date) {
-         this.filters.put("dateTo", String.valueOf(date.getTime()));
-         return this;
-      }
-
-      public EventOptions build() {
-         EventOptions options = new EventOptions();
-
-         for (Entry<String, String> filter : filters.entrySet()) {
-            options.queryParameters.put(filter.getKey(), filter.getValue());
-         }
-
-         return addFilterOptions(options);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/AbiquoException.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/AbiquoException.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/AbiquoException.java
deleted file mode 100644
index c9df896..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/AbiquoException.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.exception;
-
-import static com.google.common.collect.Iterables.any;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.find;
-
-import java.util.List;
-
-import javax.ws.rs.core.Response.Status;
-
-import com.abiquo.model.transport.error.ErrorDto;
-import com.abiquo.model.transport.error.ErrorsDto;
-import com.google.common.base.Predicate;
-import com.google.common.collect.ImmutableList;
-
-/**
- * Abiquo API exception.
- */
-public class AbiquoException extends RuntimeException {
-
-   private static final long serialVersionUID = 3627304442037389536L;
-
-   /** The HTTP status. */
-   private Status httpStatus;
-
-   /** The errors. */
-   private ErrorsDto errors;
-
-   public AbiquoException(final Status httpStatus, final ErrorsDto errors) {
-      super();
-      this.httpStatus = httpStatus;
-      this.errors = errors;
-   }
-
-   /**
-    * Check if there is an error with the given code.
-    */
-   public boolean hasError(final String code) {
-      return any(errors.getCollection(), code(code));
-   }
-
-   /**
-    * Find the first error with the given code.
-    */
-   public ErrorDto findError(final String code) {
-      return find(errors.getCollection(), code(code), null);
-   }
-
-   /**
-    * Find all errors with the given code.
-    */
-   public List<ErrorDto> findErrors(final String code) {
-      return ImmutableList.copyOf(filter(errors.getCollection(), code(code)));
-   }
-
-   /**
-    * Get the number of errors.
-    */
-   public int numErrors() {
-      return errors.getCollection().size();
-   }
-
-   /**
-    * Get the list of all errors.
-    */
-   public List<ErrorDto> getErrors() {
-      return errors.getCollection();
-   }
-
-   /**
-    * Get the HTTP status code.
-    */
-   public int getHttpStatusCode() {
-      return httpStatus.getStatusCode();
-   }
-
-   /**
-    * Get the HTTP status name.
-    */
-   public String getHttpStatusName() {
-      return httpStatus.getReasonPhrase();
-   }
-
-   /**
-    * Get the HTTP status.
-    */
-   public Status getHttpStatus() {
-      return httpStatus;
-   }
-
-   @Override
-   public String getMessage() {
-      return errors.toString();
-   }
-
-   private static Predicate<ErrorDto> code(final String code) {
-      return new Predicate<ErrorDto>() {
-         @Override
-         public boolean apply(ErrorDto input) {
-            return input.getCode().equals(code);
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/BuilderException.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/BuilderException.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/BuilderException.java
deleted file mode 100644
index 7587ec2..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/BuilderException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.exception;
-
-/**
- * Exception thrown during domain object building.
- */
-public class BuilderException extends RuntimeException {
-
-   private static final long serialVersionUID = 540948631643049450L;
-
-   /**
-    * Creates a {@link BuilderException} with the given message.
-    * 
-    * @param message
-    *           The message.
-    */
-   public BuilderException(String message) {
-      super(message);
-   }
-
-   /**
-    * Creates a {@link BuilderException} with the given cause.
-    * 
-    * @param cause
-    *           The cause.
-    */
-   public BuilderException(Throwable cause) {
-      super(cause);
-   }
-
-   /**
-    * Creates a {@link BuilderException} with the given message and cause.
-    * 
-    * @param message
-    *           The message.
-    * @param cause
-    *           The cause.
-    */
-   public BuilderException(String message, Throwable cause) {
-      super(message, cause);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/WrapperException.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/WrapperException.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/WrapperException.java
deleted file mode 100644
index f2a4f37..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/exception/WrapperException.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.exception;
-
-import org.jclouds.abiquo.domain.DomainWrapper;
-
-import com.abiquo.model.transport.SingleResourceTransportDto;
-
-/**
- * Exception thrown during the wrapping process.
- */
-public class WrapperException extends RuntimeException {
-
-   private static final long serialVersionUID = 3756802225851609583L;
-
-   private Class<? extends DomainWrapper<?>> wrapperClass;
-
-   private SingleResourceTransportDto target;
-
-   public WrapperException(final Class<? extends DomainWrapper<?>> wrapperClass,
-         final SingleResourceTransportDto target, Throwable cause) {
-      super(cause);
-      this.wrapperClass = wrapperClass;
-      this.target = target;
-   }
-
-   @Override
-   public String getMessage() {
-      String msg = "Could not wrap object [" + target + "] in class " + wrapperClass.getName() + ": ";
-      return msg + super.getMessage();
-   }
-
-   public Class<? extends DomainWrapper<?>> getWrapperClass() {
-      return wrapperClass;
-   }
-
-   public void setWrapperClass(Class<? extends DomainWrapper<?>> wrapperClass) {
-      this.wrapperClass = wrapperClass;
-   }
-
-   public SingleResourceTransportDto getTarget() {
-      return target;
-   }
-
-   public void setTarget(SingleResourceTransportDto target) {
-      this.target = target;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datacenter.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datacenter.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datacenter.java
deleted file mode 100644
index 58322cf..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datacenter.java
+++ /dev/null
@@ -1,794 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.transform;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.enterprise.Limits;
-import org.jclouds.abiquo.domain.infrastructure.options.DatacenterOptions;
-import org.jclouds.abiquo.domain.infrastructure.options.IpmiOptions;
-import org.jclouds.abiquo.domain.infrastructure.options.MachineOptions;
-import org.jclouds.abiquo.domain.network.Network;
-import org.jclouds.abiquo.domain.network.NetworkServiceType;
-import org.jclouds.abiquo.domain.network.options.NetworkOptions;
-import org.jclouds.abiquo.predicates.NetworkServiceTypePredicates;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.enumerator.MachineIpmiState;
-import com.abiquo.model.enumerator.MachineState;
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.enumerator.RemoteServiceType;
-import com.abiquo.model.enumerator.VlanTagAvailabilityType;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.cloud.HypervisorTypeDto;
-import com.abiquo.server.core.cloud.HypervisorTypesDto;
-import com.abiquo.server.core.enterprise.DatacentersLimitsDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.MachineDto;
-import com.abiquo.server.core.infrastructure.MachineIpmiStateDto;
-import com.abiquo.server.core.infrastructure.MachineStateDto;
-import com.abiquo.server.core.infrastructure.MachinesDto;
-import com.abiquo.server.core.infrastructure.RackDto;
-import com.abiquo.server.core.infrastructure.RacksDto;
-import com.abiquo.server.core.infrastructure.RemoteServicesDto;
-import com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto;
-import com.abiquo.server.core.infrastructure.network.NetworkServiceTypesDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworksDto;
-import com.abiquo.server.core.infrastructure.network.VlanTagAvailabilityDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDeviceDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDevicesDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDevicesMetadataDto;
-import com.abiquo.server.core.infrastructure.storage.TiersDto;
-import com.google.common.base.Function;
-
-/**
- * Adds high level functionality to {@link DatacenterDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/DatacenterResource">
- *      http://community.abiquo.com/display/ABI20/DatacenterResource</a>
- */
-public class Datacenter extends DomainWrapper<DatacenterDto> {
-   /**
-    * IP address of the datacenter (used to create all remote services with the
-    * same ip).
-    */
-   private String ip;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Datacenter(final ApiContext<AbiquoApi> context, final DatacenterDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * Delete the datacenter.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-DeleteanexistingDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- DeleteanexistingDatacenter</a>
-    */
-   public void delete() {
-      context.getApi().getInfrastructureApi().deleteDatacenter(target);
-      target = null;
-   }
-
-   /**
-    * Create a datacenter in Abiquo. This method will perform several calls to
-    * the API if remote services have been defined in the builder. Different
-    * remote services will be created depending on the {@link AbiquoEdition}.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-CreateanewDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- CreateanewDatacenter</a>
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RemoteServiceResource#RemoteServiceResource-CreateaRemoteService"
-    *      > http://community.abiquo.com/display/ABI20/RemoteServiceResource#
-    *      RemoteServiceResource- CreateaRemoteService</a>
-    */
-   public void save() {
-      // Datacenter must be persisted first, so links get populated in the
-      // target object
-      target = context.getApi().getInfrastructureApi().createDatacenter(target);
-
-      // If remote services data is set, create remote services.
-      if (ip != null) {
-         createRemoteServices();
-      }
-   }
-
-   /**
-    * Update datacenter information in the server with the data from this
-    * datacenter.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Updateanexistingdatacenter"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Updateanexistingdatacenter </a>
-    */
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateDatacenter(target);
-   }
-
-   /**
-    * The cloud administrator will find it useful to know if a VLAN Tag is
-    * already assigned before creating a new Public or External Network. This
-    * method provides this functionality: Check if a tag is available inside the
-    * Datacenter. Please refer link for more information.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/PublicNetworkResource#PublicNetworkResource-Checkthetagavailability"
-    *      > http://community.abiquo.com/display/ABI20/PublicNetworkResource#
-    *      PublicNetworkResource- Checkthetagavailability</a>
-    * @return Availability state of the tag.
-    */
-   public VlanTagAvailabilityType checkTagAvailability(final int tag) {
-      VlanTagAvailabilityDto availability = context.getApi().getInfrastructureApi().checkTagAvailability(target, tag);
-
-      return availability.getAvailable();
-   }
-
-   // Children access
-
-   /**
-    * Retrieve the list of unmanaged racks in this datacenter.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RackResource#RackResource-RetrievealistofRacks"
-    *      > http://community.abiquo.com/display/ABI20/RackResource#RackResource
-    *      - RetrievealistofRacks</a>
-    * @return List of unmanaged racks in this datacenter.
-    */
-   public Iterable<Rack> listRacks() {
-      RacksDto racks = context.getApi().getInfrastructureApi().listRacks(target);
-      return wrap(context, Rack.class, racks.getCollection());
-   }
-
-   /**
-    * Retrieve a single unmanaged rack.
-    * 
-    * @param id
-    *           Unique ID of the rack in this datacenter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RackResource#RackResource-RetrieveaRack"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/RackResource#RackResource-
-    *      RetrieveaRack</a>
-    * @return Unmanaged rack with the given id or <code>null</code> if it does
-    *         not exist.
-    */
-   public Rack getRack(final Integer id) {
-      RackDto rack = context.getApi().getInfrastructureApi().getRack(target, id);
-      return wrap(context, Rack.class, rack);
-   }
-
-   /**
-    * Retrieve the list of supported storage devices.
-    * <p>
-    * This method will get the list of the storage devices that are supported in
-    * the datacenter.
-    * 
-    * @return List of supported storage devices. This list has only the default
-    *         information for the storage devices, such as the management and
-    *         iscsi ports, or the default credentials to access the device.
-    */
-   public Iterable<StorageDeviceMetadata> listSupportedStorageDevices() {
-      StorageDevicesMetadataDto devices = context.getApi().getInfrastructureApi().listSupportedStorageDevices(target);
-      return wrap(context, StorageDeviceMetadata.class, devices.getCollection());
-   }
-
-   /**
-    * Retrieve the list of storage devices in this datacenter.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StorageDeviceResource#StorageDeviceResource-Retrievethelistofstoragedevices"
-    *      > http://community.abiquo.com/display/ABI20/StorageDeviceResource#
-    *      StorageDeviceResource- Retrievethelistofstoragedevices</a>
-    * @return List of storage devices in this datacenter.
-    */
-   public Iterable<StorageDevice> listStorageDevices() {
-      StorageDevicesDto devices = context.getApi().getInfrastructureApi().listStorageDevices(target);
-      return wrap(context, StorageDevice.class, devices.getCollection());
-   }
-
-   /**
-    * Retrieve a single storage device.
-    * 
-    * @param id
-    *           Unique ID of the storage device in this datacenter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StorageDeviceResource#StorageDeviceResource-Retrieveastoragedevice"
-    *      > http://community.abiquo.com/display/ABI20/StorageDeviceResource#
-    *      StorageDeviceResource- Retrieveastoragedevice</a>
-    * @return Storage device with the given id or <code>null</code> if it does
-    *         not exist.
-    */
-   public StorageDevice getStorageDevice(final Integer id) {
-      StorageDeviceDto device = context.getApi().getInfrastructureApi().getStorageDevice(target, id);
-      return wrap(context, StorageDevice.class, device);
-   }
-
-   /**
-    * Return the list of Network Service Types defined in a datacenter. By
-    * default, a Network Service Type called 'Service Network' will be created
-    * with the datacenter.
-    * 
-    * @return List of network services in this datacenter.
-    */
-   public Iterable<NetworkServiceType> listNetworkServiceTypes() {
-      NetworkServiceTypesDto dtos = context.getApi().getInfrastructureApi().listNetworkServiceTypes(target);
-      return wrap(context, NetworkServiceType.class, dtos.getCollection());
-   }
-
-   /**
-    * Retrieve a single network service type.
-    * 
-    * @param id
-    *           Unique ID of the network service type in this datacenter.
-    * @return Network Service Type with the given id or <code>null</code> if it
-    *         does not exist.
-    */
-   public NetworkServiceType getNetworkServiceType(final Integer id) {
-      NetworkServiceTypeDto nst = context.getApi().getInfrastructureApi().getNetworkServiceType(target, id);
-      return wrap(context, NetworkServiceType.class, nst);
-   }
-
-   /**
-    * Return the default network service type used by the datacenter. This
-    * datacenter will be the one used by {@link PrivateNetwork}. Even it can not
-    * be deleted, it can be modified.
-    * 
-    * @return the defult {@link NetworkServiceType}
-    */
-   public NetworkServiceType defaultNetworkServiceType() {
-      return find(listNetworkServiceTypes(), NetworkServiceTypePredicates.isDefault());
-   }
-
-   /**
-    * Retrieve the list of remote services of this datacenter.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RemoteServiceResource#RemoteServiceResource-RetrievealistofRemoteServices"
-    *      > http://community.abiquo.com/display/ABI20/RemoteServiceResource#
-    *      RemoteServiceResource- RetrievealistofRemoteServices</a>
-    * @return List of remote services in this datacenter.
-    */
-   public Iterable<RemoteService> listRemoteServices() {
-      RemoteServicesDto remoteServices = context.getApi().getInfrastructureApi().listRemoteServices(target);
-      return wrap(context, RemoteService.class, remoteServices.getCollection());
-   }
-
-   private void createRemoteServices() {
-      createRemoteService(RemoteServiceType.BPM_SERVICE);
-      createRemoteService(RemoteServiceType.DHCP_SERVICE);
-      createRemoteService(RemoteServiceType.STORAGE_SYSTEM_MONITOR);
-      createRemoteService(RemoteServiceType.APPLIANCE_MANAGER);
-      createRemoteService(RemoteServiceType.VIRTUAL_SYSTEM_MONITOR);
-      createRemoteService(RemoteServiceType.NODE_COLLECTOR);
-      createRemoteService(RemoteServiceType.VIRTUAL_FACTORY);
-   }
-
-   private void createRemoteService(final RemoteServiceType type) {
-      RemoteService.builder(context, this).type(type).ip(this.ip).build().save();
-   }
-
-   /**
-    * Retrieve the list of datacenter limits by all enterprises. The Datacenter
-    * Limits resource allows you to assign datacenters and allocated resources
-    * in them to be used by an enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrievelimitsbydatacenter"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrievelimitsbydatacenter</a>
-    * @return List of datacenter limits by all enterprises.
-    */
-   public Iterable<Limits> listLimits() {
-      DatacentersLimitsDto dto = context.getApi().getInfrastructureApi().listLimits(this.unwrap());
-      return DomainWrapper.wrap(context, Limits.class, dto.getCollection());
-   }
-
-   /**
-    * Retrieve the list of tiers in ths datacenter.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/TierResource#TierResource-Retrievethelistoftiers"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/TierResource#TierResource-
-    *      Retrievethelistoftiers </a>
-    * @return List of tiers in this datacenter.
-    */
-   public Iterable<Tier> listTiers() {
-      TiersDto dto = context.getApi().getInfrastructureApi().listTiers(this.unwrap());
-      return DomainWrapper.wrap(context, Tier.class, dto.getCollection());
-   }
-
-   /**
-    * Retrieve the list of public, external and unmanaged networks in this
-    * datacenter.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/PublicNetworkResource#PublicNetworkResource-Getthelistofpublicnetworks"
-    *      > http://community.abiquo.com/display/ABI20/PublicNetworkResource#
-    *      PublicNetworkResource- Getthelistofpublicnetworks</a>
-    * @return List of public, external and unmanaged networks in this
-    *         datacenter.
-    */
-   public Iterable<Network<?>> listNetworks() {
-      VLANNetworksDto networks = context.getApi().getInfrastructureApi().listNetworks(target);
-      return Network.wrapNetworks(context, networks.getCollection());
-   }
-
-   /**
-    * Retrieve the list of networks of this datacenter matching the given type.
-    * 
-    * @param type
-    *           Network type filter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/PublicNetworkResource#PublicNetworkResource-Getthelistofpublicnetworks"
-    *      > http://community.abiquo.com/display/ABI20/PublicNetworkResource#
-    *      PublicNetworkResource- Getthelistofpublicnetworks</a>
-    * @return List of networks of this datacenter matching the given type.
-    */
-   public Iterable<Network<?>> listNetworks(final NetworkType type) {
-      NetworkOptions options = NetworkOptions.builder().type(type).build();
-      VLANNetworksDto networks = context.getApi().getInfrastructureApi().listNetworks(target, options);
-      return Network.wrapNetworks(context, networks.getCollection());
-   }
-
-   /**
-    * Retrieve a single public, external or unmanaged network from this
-    * datacenter.
-    * {@link org.jclouds.abiquo.domain.network.Network#toExternalNetwork},
-    * {@link org.jclouds.abiquo.domain.network.Network#toPublicNetwork} and
-    * {@link org.jclouds.abiquo.domain.network.Network#toUnmanagedNetwork} can
-    * be used to convert the Network into the appropriate domain object.
-    * 
-    * @param id
-    *           Unique ID of the network in this datacenter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/PublicNetworkResource#PublicNetworkResource-Getthelistofpublicnetworks"
-    *      > http://community.abiquo.com/display/ABI20/StorageDeviceResource#
-    *      PublicNetworkResource#
-    *      PublicNetworkResource-Getthelistofpublicnetworks</a>
-    * @return Network with the given id or <code>null</code> if it does not
-    *         exist.
-    */
-   public Network<?> getNetwork(final Integer id) {
-      VLANNetworkDto network = context.getApi().getInfrastructureApi().getNetwork(target, id);
-      return Network.wrapNetwork(context, network);
-   }
-
-   // Actions
-
-   /**
-    * Retrieve the hypervisor type from remote machine.
-    * 
-    * @param ip
-    *           IP address of the physical machine.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrievethehypervisortypefromremotemachine"
-    *      http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrievethehypervisortypefromremotemachine</a>
-    * @return Hypervisor type of the remote machine.
-    * @throws Exception
-    *            If the hypervisor type information cannot be retrieved.
-    */
-   public HypervisorType getHypervisorType(final String ip) {
-      DatacenterOptions options = DatacenterOptions.builder().ip(ip).build();
-
-      String type = context.getApi().getInfrastructureApi().getHypervisorTypeFromMachine(target, options);
-
-      return HypervisorType.valueOf(type);
-   }
-
-   /**
-    * Retrieve the list of available hypervisor types in the datacenter.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrieveavailablehypervisortypes"
-    *      http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrieveavailablehypervisortypes</a>
-    * @return List of available hypervisor types in the datacenter.
-    */
-   public Iterable<HypervisorType> listAvailableHypervisors() {
-      HypervisorTypesDto types = context.getApi().getInfrastructureApi().getHypervisorTypes(target);
-      return getHypervisorTypes(types);
-   }
-
-   private Iterable<HypervisorType> getHypervisorTypes(final HypervisorTypesDto dtos) {
-      return transform(dtos.getCollection(), new Function<HypervisorTypeDto, HypervisorType>() {
-         @Override
-         public HypervisorType apply(HypervisorTypeDto input) {
-            return HypervisorType.fromId(input.getId());
-         }
-      });
-   }
-
-   /**
-    * Searches a remote machine and retrieves an Machine object with its
-    * information.
-    * 
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @return A physical machine if found or <code>null</code>.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrieveremotemachineinformation"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrieveremotemachineinformation</a>
-    */
-   public Machine discoverSingleMachine(final String ip, final HypervisorType hypervisorType, final String user,
-         final String password) {
-      return discoverSingleMachine(ip, hypervisorType, user, password, hypervisorType.defaultPort);
-   }
-
-   /**
-    * Searches a remote machine and retrieves an Machine object with its
-    * information.
-    * 
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @param port
-    *           Port to connect.
-    * @return A physical machine if found or <code>null</code>.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrieveremotemachineinformation"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrieveremotemachineinformation</a>
-    */
-   public Machine discoverSingleMachine(final String ip, final HypervisorType hypervisorType, final String user,
-         final String password, final int port) {
-      MachineDto dto = context
-            .getApi()
-            .getInfrastructureApi()
-            .discoverSingleMachine(target, ip, hypervisorType, user, password,
-                  MachineOptions.builder().port(port).build());
-
-      // Credentials are not returned by the API
-      dto.setUser(user);
-      dto.setPassword(password);
-
-      return wrap(context, Machine.class, dto);
-   }
-
-   /**
-    * Searches multiple remote machines and retrieves an Machine list with its
-    * information.
-    * 
-    * @param ipFrom
-    *           IP address of the remote first hypervisor to check.
-    * @param ipTo
-    *           IP address of the remote last hypervisor to check.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @return The physical machine list.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrievealistofremotemachineinformation"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrievealistofremotemachineinformation</a>
-    */
-   public Iterable<Machine> discoverMultipleMachines(final String ipFrom, final String ipTo,
-         final HypervisorType hypervisorType, final String user, final String password) {
-      return discoverMultipleMachines(ipFrom, ipTo, hypervisorType, user, password, hypervisorType.defaultPort);
-   }
-
-   /**
-    * Searches multiple remote machines and retrieves an Machine list with its
-    * information.
-    * 
-    * @param ipFrom
-    *           IP address of the remote first hypervisor to check.
-    * @param ipTo
-    *           IP address of the remote last hypervisor to check.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @param port
-    *           Port to connect.
-    * @return The physical machine list.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrievealistofremotemachineinformation"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrievealistofremotemachineinformation</a>
-    */
-   public Iterable<Machine> discoverMultipleMachines(final String ipFrom, final String ipTo,
-         final HypervisorType hypervisorType, final String user, final String password, final int port) {
-      MachinesDto dto = context
-            .getApi()
-            .getInfrastructureApi()
-            .discoverMultipleMachines(target, ipFrom, ipTo, hypervisorType, user, password,
-                  MachineOptions.builder().port(port).build());
-
-      // Credentials are not returned by the API
-      for (MachineDto machine : dto.getCollection()) {
-         machine.setUser(user);
-         machine.setPassword(password);
-      }
-
-      return wrap(context, Machine.class, dto.getCollection());
-   }
-
-   /**
-    * Check the state of a remote machine. This feature is used to check the
-    * state from a remote machine giving its location, user, password and
-    * hypervisor type. This machine does not need to be managed by Abiquo.
-    * 
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @return The physical machine state if the machine is found or
-    *         <code>null</code>.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Checkthestatefromremotemachine"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Checkthestatefromremotemachine</a>
-    */
-   public MachineState checkMachineState(final String ip, final HypervisorType hypervisorType, final String user,
-         final String password) {
-      return checkMachineState(ip, hypervisorType, user, password,
-            MachineOptions.builder().port(hypervisorType.defaultPort).build());
-   }
-
-   /**
-    * Check the state of a remote machine. This feature is used to check the
-    * state from a remote machine giving its location, user, password and
-    * hypervisor type. This machine does not need to be managed by Abiquo.
-    * 
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @param options
-    *           .
-    * @return The physical machine state if the machine is found or
-    *         <code>null</code>.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Checkthestatefromremotemachine"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Checkthestatefromremotemachine</a>
-    */
-   public MachineState checkMachineState(final String ip, final HypervisorType hypervisorType, final String user,
-         final String password, final MachineOptions options) {
-      MachineStateDto dto = context.getApi().getInfrastructureApi()
-            .checkMachineState(target, ip, hypervisorType, user, password, options);
-
-      return dto.getState();
-   }
-
-   /**
-    * Check the ipmi configuration state of a remote machine. This feature is
-    * used to check the ipmi configuration state from a remote machine giving
-    * its location, user and password. This machine does not need to be managed
-    * by Abiquo.
-    * 
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @return The physical machine state if the machine is found or
-    *         <code>null</code>.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Checktheipmistatefromremotemachine"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Checktheipmistatefromremotemachine</a>
-    */
-   public MachineIpmiState checkMachineIpmiState(final String ip, final String user, final String password) {
-      MachineIpmiStateDto dto = context.getApi().getInfrastructureApi()
-            .checkMachineIpmiState(target, ip, user, password);
-      return dto.getState();
-   }
-
-   /**
-    * Check the ipmi configuration state of a remote machine. This feature is
-    * used to check the ipmi configuration state from a remote machine giving
-    * its location, user and password. This machine does not need to be managed
-    * by Abiquo.
-    * 
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @return The physical machine state if the machine is found or
-    *         <code>null</code>.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Checktheipmistatefromremotemachine"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Checktheipmistatefromremotemachine</a>
-    */
-   public MachineIpmiState checkMachineIpmiState(final String ip, final String user, final String password,
-         final IpmiOptions options) {
-      MachineIpmiStateDto dto = context.getApi().getInfrastructureApi()
-            .checkMachineIpmiState(target, ip, user, password, options);
-      return dto.getState();
-   }
-
-   /**
-    * Retrieve the list of virtual machine templates in the repository of this
-    * datacenter.
-    * 
-    * @param enterprise
-    *           Owner of the templates.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualMachineTemplateResource#VirtualMachineTemplateResource-Retrieveallvirtualmachinetemplates"
-    *      > http://community.abiquo.com/display/ABI20/
-    *      VirtualMachineTemplateResource#
-    *      VirtualMachineTemplateResource-Retrieveallvirtualmachinetemplates</a>
-    * @return List of virtual machine templates in the repository of this
-    *         datacenter.
-    */
-   public Iterable<VirtualMachineTemplate> listTemplatesInRepository(final Enterprise enterprise) {
-      PagedIterable<VirtualMachineTemplateDto> templates = context.getApi().getVirtualMachineTemplateApi()
-            .listVirtualMachineTemplates(enterprise.getId(), target.getId());
-      return wrap(context, VirtualMachineTemplate.class, templates.concat());
-   }
-
-   /**
-    * Retrieve a single virtual machine template in of this datacenter from the
-    * given enterprise.
-    * 
-    * @param enterprise
-    *           Owner of the templates.
-    * @param id
-    *           Unique ID of the template in the datacenter repository for the
-    *           given enterprise.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualMachineTemplateResource#VirtualMachineTemplateResource-Retrieveallvirtualmachinetemplates"
-    *      > http://community.abiquo.com/display/ABI20/
-    *      VirtualMachineTemplateResource#
-    *      VirtualMachineTemplateResource-Retrieveallvirtualmachinetemplates</a>
-    * @return Virtual machine template with the given id in the given enterprise
-    *         or <code>null</code> if it does not exist.
-    */
-   public VirtualMachineTemplate getTemplateInRepository(final Enterprise enterprise, final Integer id) {
-      VirtualMachineTemplateDto template = context.getApi().getVirtualMachineTemplateApi()
-            .getVirtualMachineTemplate(enterprise.getId(), target.getId(), id);
-      return wrap(context, VirtualMachineTemplate.class, template);
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context) {
-      return new Builder(context);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private String name;
-
-      private String location;
-
-      private String ip;
-
-      public Builder(final ApiContext<AbiquoApi> context) {
-         super();
-         this.context = context;
-      }
-
-      public Builder remoteServices(final String ip) {
-         this.ip = ip;
-         return this;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder location(final String location) {
-         this.location = location;
-         return this;
-      }
-
-      public Datacenter build() {
-         DatacenterDto dto = new DatacenterDto();
-         dto.setName(name);
-         dto.setLocation(location);
-         Datacenter datacenter = new Datacenter(context, dto);
-         datacenter.ip = ip;
-         return datacenter;
-      }
-
-      public static Builder fromDatacenter(final Datacenter in) {
-         return Datacenter.builder(in.context).name(in.getName()).location(in.getLocation());
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getLocation() {
-      return target.getLocation();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public void setLocation(final String location) {
-      target.setLocation(location);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public String getUUID() {
-      return target.getUuid();
-   }
-
-   @Override
-   public String toString() {
-      return "Datacenter [id=" + getId() + ", location=" + getLocation() + ", name=" + getName() + ", uuid="
-            + getUUID() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datastore.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datastore.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datastore.java
deleted file mode 100644
index b2c93a3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Datastore.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.infrastructure.DatastoreDto;
-
-/**
- * Adds high level functionality to {@link DatastoreDto}.
- */
-public class Datastore extends DomainWrapper<DatastoreDto> {
-   /**
-    * Constructor to be used only by the builder. This resource cannot be
-    * created.
-    */
-   private Datastore(final ApiContext<AbiquoApi> context, final DatastoreDto target) {
-      super(context, target);
-   }
-
-   // Delegate methods
-
-   public String getDatastoreUUID() {
-      return target.getDatastoreUUID();
-   }
-
-   public String getDirectory() {
-      return target.getDirectory();
-   }
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getRootPath() {
-      return target.getRootPath();
-   }
-
-   public long getSize() {
-      return target.getSize();
-   }
-
-   public long getUsedSize() {
-      return target.getUsedSize();
-   }
-
-   public boolean isEnabled() {
-      return target.isEnabled();
-   }
-
-   public void setEnabled(final boolean enabled) {
-      target.setEnabled(enabled);
-   }
-
-   @Override
-   public String toString() {
-      return "Datastore [id=" + getId() + ", uuid=" + getDatastoreUUID() + ", directory=" + getDirectory() + ", name="
-            + getName() + ", rootPath=" + getRootPath() + ", size=" + getSize() + ", usedSize=" + getUsedSize()
-            + ", enabled=" + isEnabled() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Machine.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Machine.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Machine.java
deleted file mode 100644
index 05e4a0a..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Machine.java
+++ /dev/null
@@ -1,626 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.ImmutableList.copyOf;
-
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.infrastructure.options.MachineOptions;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.enumerator.MachineIpmiState;
-import com.abiquo.model.enumerator.MachineState;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.infrastructure.DatastoresDto;
-import com.abiquo.server.core.infrastructure.MachineDto;
-import com.abiquo.server.core.infrastructure.MachineIpmiStateDto;
-import com.abiquo.server.core.infrastructure.MachineStateDto;
-import com.abiquo.server.core.infrastructure.RackDto;
-import com.abiquo.server.core.infrastructure.network.NetworkInterfacesDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds high level functionality to {@link MachineDto}. This resource allows you
- * to manage physical machines in the cloud infrastructure.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/MachineResource">
- *      http://community.abiquo.com/display/ABI20/MachineResource</a>
- */
-public class Machine extends DomainWrapper<MachineDto> {
-   /** The default virtual ram used in MB. */
-   protected static final int DEFAULT_VRAM_USED = 1;
-
-   /** The default virtual cpu used in MB. */
-   protected static final int DEFAULT_VCPU_USED = 1;
-
-   /** The rack where the machine belongs. */
-   protected Rack rack;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Machine(final ApiContext<AbiquoApi> context, final MachineDto target) {
-      super(context, target);
-   }
-
-   /**
-    * Create a new physical machine in Abiquo. The best way to create a machine
-    * if first calling {@link Datacenter#discoverSingleMachine} or
-    * {@link Datacenter#discoverMultipleMachines}. This will return a new
-    * {@link Machine}. The following steps are: enabling a datastore, selecting
-    * a virtual switch and choosing a rack. Refer link for more information.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrieveremotemachineinformation"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrieveremotemachineinformation</a>
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/MachineResource#MachineResource-Createamachine"
-    *      > http://community.abiquo.com/display/ABI20/MachineResource#
-    *      MachineResource- Createamachine</a>
-    */
-   public void save() {
-      target = context.getApi().getInfrastructureApi().createMachine(rack.unwrap(), target);
-   }
-
-   public void delete() {
-      context.getApi().getInfrastructureApi().deleteMachine(target);
-      target = null;
-   }
-
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateMachine(target);
-   }
-
-   public MachineState check() {
-      MachineStateDto dto = context.getApi().getInfrastructureApi().checkMachineState(target, true);
-      MachineState state = dto.getState();
-      target.setState(state);
-      return state;
-   }
-
-   public MachineIpmiState checkIpmi() {
-      MachineIpmiStateDto dto = context.getApi().getInfrastructureApi().checkMachineIpmiState(target);
-      return dto.getState();
-   }
-
-   // Parent access
-   /**
-    * Retrieve the unmanaged rack where the machine is.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RackResource#RackResource-RetrieveaRack"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/RackResource#RackResource-
-    *      RetrieveaRack</a>
-    */
-   public Rack getRack() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.RACK), ValidationErrors.MISSING_REQUIRED_LINK + " "
-            + ParentLinkName.RACK);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<RackDto> parser = new ParseXMLWithJAXB<RackDto>(context.utils().xml(),
-            TypeLiteral.get(RackDto.class));
-
-      return wrap(context, Rack.class, parser.apply(response));
-   }
-
-   // Children access
-
-   public Iterable<Datastore> getDatastores() {
-      return wrap(context, Datastore.class, target.getDatastores().getCollection());
-   }
-
-   public Iterable<NetworkInterface> getNetworkInterfaces() {
-      return wrap(context, NetworkInterface.class, target.getNetworkInterfaces().getCollection());
-   }
-
-   /**
-    * Gets the list of virtual machines in the physical machine.
-    * 
-    * @return The list of virtual machines in the physical machine.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Machine+Resource#MachineResource-Retrievethelistofvirtualmachinesbymachine'shypervisor"
-    *      > http://community.abiquo.com/display/ABI20/Machine+Resource#
-    *      MachineResource-
-    *      Retrievethelistofvirtualmachinesbymachine'shypervisor</a>
-    */
-   public Iterable<VirtualMachine> listVirtualMachines() {
-      MachineOptions options = MachineOptions.builder().sync(false).build();
-      VirtualMachinesWithNodeExtendedDto vms = context.getApi().getInfrastructureApi()
-            .listVirtualMachinesByMachine(target, options);
-      return wrap(context, VirtualMachine.class, vms.getCollection());
-   }
-
-   public VirtualMachine getVirtualMachine(final Integer virtualMachineId) {
-      VirtualMachineWithNodeExtendedDto vm = context.getApi().getInfrastructureApi()
-            .getVirtualMachine(target, virtualMachineId);
-      return wrap(context, VirtualMachine.class, vm);
-   }
-
-   /**
-    * Gets the list of virtual machines in the physical machine synchronizing
-    * virtual machines from remote hypervisor with abiquo's database.
-    * 
-    * @return The list of virtual machines in the physical machine.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Machine+Resource#MachineResource-Retrievethelistofvirtualmachinesbymachine'shypervisor"
-    *      > http://community.abiquo.com/display/ABI20/Machine+Resource#
-    *      MachineResource-
-    *      Retrievethelistofvirtualmachinesbymachine'shypervisor</a>
-    */
-   public Iterable<VirtualMachine> listRemoteVirtualMachines() {
-      MachineOptions options = MachineOptions.builder().sync(true).build();
-      VirtualMachinesWithNodeExtendedDto vms = context.getApi().getInfrastructureApi()
-            .listVirtualMachinesByMachine(target, options);
-      return wrap(context, VirtualMachine.class, vms.getCollection());
-   }
-
-   /**
-    * Reserve the machine for the given enterprise.
-    * <p>
-    * When a {@link Machine} is reserved for an {@link Enterprise}, only the
-    * users of that enterprise will be able to deploy {@link VirtualMachine}s in
-    * it.
-    * 
-    * @param enterprise
-    *           The enterprise reserving the machine.
-    */
-   public void reserveFor(final Enterprise enterprise) {
-      target = context.getApi().getInfrastructureApi().reserveMachine(enterprise.unwrap(), target);
-   }
-
-   /**
-    * Cancels the machine reservation for the given enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise to cancel reservation for.
-    */
-   public void cancelReservationFor(final Enterprise enterprise) {
-      context.getApi().getInfrastructureApi().cancelReservation(enterprise.unwrap(), target);
-      target.getLinks().remove(target.searchLink(ParentLinkName.ENTERPRISE));
-   }
-
-   /**
-    * Check if the machine is reserved.
-    * 
-    * @return Boolean indicating if the machine is reserved for an enterprise.
-    */
-   public boolean isReserved() {
-      return target.searchLink(ParentLinkName.ENTERPRISE) != null;
-   }
-
-   /**
-    * Get the enterprise that has reserved the machine or <code>null</code> if
-    * the machine is not reserved.
-    * 
-    * @return The enterprise that has reserved the machine or <code>null</code>
-    *         if the machine is not reserved.
-    */
-   public Enterprise getOwnerEnterprise() {
-      if (!isReserved()) {
-         return null;
-      }
-
-      EnterpriseDto enterprise = context.getApi().getEnterpriseApi()
-            .getEnterprise(target.getIdFromLink(ParentLinkName.ENTERPRISE));
-
-      return wrap(context, Enterprise.class, enterprise);
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Rack rack) {
-      return new Builder(context, rack);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private String name;
-
-      private String description;
-
-      private Integer virtualRamInMb;
-
-      private Integer virtualRamUsedInMb = DEFAULT_VRAM_USED;
-
-      private Integer virtualCpuCores;
-
-      private Integer virtualCpusUsed = DEFAULT_VCPU_USED;
-
-      private Integer port;
-
-      private String ip;
-
-      private MachineState state = MachineState.STOPPED;
-
-      private String ipService;
-
-      private HypervisorType type;
-
-      private String user;
-
-      private String password;
-
-      private Iterable<Datastore> datastores;
-
-      private Iterable<NetworkInterface> networkInterfaces;
-
-      private String ipmiIp;
-
-      private Integer ipmiPort;
-
-      private String ipmiUser;
-
-      private String ipmiPassword;
-
-      private Rack rack;
-
-      public Builder(final ApiContext<AbiquoApi> context, final Rack rack) {
-         super();
-         checkNotNull(rack, ValidationErrors.NULL_RESOURCE + Rack.class);
-         this.rack = rack;
-         this.context = context;
-      }
-
-      public Builder state(final MachineState state) {
-         this.state = state;
-         return this;
-      }
-
-      public Builder ipmiPassword(final String ipmiPassword) {
-         this.ipmiPassword = ipmiPassword;
-         return this;
-      }
-
-      public Builder ipmiUser(final String ipmiUser) {
-         this.ipmiUser = ipmiUser;
-         return this;
-      }
-
-      public Builder ipmiPort(final int ipmiPort) {
-         this.ipmiPort = ipmiPort;
-         return this;
-      }
-
-      public Builder ipmiIp(final String ipmiIp) {
-         this.ipmiIp = ipmiIp;
-         return this;
-      }
-
-      public Builder user(final String user) {
-         this.user = user;
-         return this;
-      }
-
-      public Builder ip(final String ip) {
-         this.ip = ip;
-         if (ipService == null) {
-            ipService = ip;
-         }
-         return this;
-      }
-
-      public Builder ipService(final String ipService) {
-         this.ipService = ipService;
-         return this;
-      }
-
-      public Builder password(final String password) {
-         this.password = password;
-         return this;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder description(final String description) {
-         this.description = description;
-         return this;
-      }
-
-      public Builder port(final int port) {
-         this.port = port;
-         return this;
-      }
-
-      public Builder datastores(final Iterable<Datastore> datastores) {
-         this.datastores = datastores;
-         return this;
-      }
-
-      public Builder networkInterfaces(final Iterable<NetworkInterface> networkInterfaces) {
-         this.networkInterfaces = networkInterfaces;
-         return this;
-      }
-
-      public Builder virtualRamInMb(final int virtualRamInMb) {
-         this.virtualRamInMb = virtualRamInMb;
-         return this;
-      }
-
-      public Builder virtualRamUsedInMb(final int virtualRamUsedInMb) {
-         this.virtualRamUsedInMb = virtualRamUsedInMb;
-         return this;
-      }
-
-      public Builder virtualCpuCores(final int virtualCpuCores) {
-         this.virtualCpuCores = virtualCpuCores;
-         return this;
-      }
-
-      public Builder virtualCpusUsed(final int virtualCpusUsed) {
-         this.virtualCpusUsed = virtualCpusUsed;
-         return this;
-      }
-
-      public Builder hypervisorType(final HypervisorType hypervisorType) {
-         this.type = hypervisorType;
-
-         // Sets default hypervisor port
-         if (this.port == null) {
-            this.port = hypervisorType.defaultPort;
-         }
-
-         return this;
-      }
-
-      public Builder rack(final Rack rack) {
-         checkNotNull(rack, ValidationErrors.NULL_RESOURCE + Datacenter.class);
-         this.rack = rack;
-         return this;
-      }
-
-      public Machine build() {
-         MachineDto dto = new MachineDto();
-         dto.setName(name);
-         dto.setDescription(description);
-         dto.setVirtualRamInMb(virtualRamInMb);
-         dto.setVirtualRamUsedInMb(virtualRamUsedInMb);
-         dto.setVirtualCpuCores(virtualCpuCores);
-         dto.setVirtualCpusUsed(virtualCpusUsed);
-         if (port != null) {
-            dto.setPort(port);
-         }
-         dto.setIp(ip);
-         dto.setIpService(ipService);
-         dto.setType(type);
-         dto.setUser(user);
-         dto.setPassword(password);
-         dto.setIpmiIP(ipmiIp);
-         dto.setIpmiPassword(ipmiPassword);
-         if (ipmiPort != null) {
-            dto.setIpmiPort(ipmiPort);
-         }
-         dto.setIpmiUser(ipmiUser);
-         dto.setState(state);
-
-         DatastoresDto datastoresDto = new DatastoresDto();
-         datastoresDto.getCollection().addAll(copyOf(unwrap(datastores)));
-         dto.setDatastores(datastoresDto);
-
-         NetworkInterfacesDto networkInterfacesDto = new NetworkInterfacesDto();
-         networkInterfacesDto.getCollection().addAll(copyOf(unwrap(networkInterfaces)));
-         dto.setNetworkInterfaces(networkInterfacesDto);
-
-         Machine machine = new Machine(context, dto);
-         machine.rack = rack;
-
-         return machine;
-      }
-
-      public static Builder fromMachine(final Machine in) {
-         Builder builder = Machine.builder(in.context, in.rack).name(in.getName()).description(in.getDescription())
-               .virtualCpuCores(in.getVirtualCpuCores()).virtualCpusUsed(in.getVirtualCpusUsed())
-               .virtualRamInMb(in.getVirtualRamInMb()).virtualRamUsedInMb(in.getVirtualRamUsedInMb())
-               .port(in.getPort()).ip(in.getIp()).ipService(in.getIpService()).hypervisorType(in.getType())
-               .user(in.getUser()).password(in.getPassword()).ipmiIp(in.getIpmiIp()).ipmiPassword(in.getIpmiPassword())
-               .ipmiUser(in.getIpmiUser()).state(in.getState()).datastores(in.getDatastores())
-               .networkInterfaces(in.getNetworkInterfaces());
-
-         // Parameters that can be null
-         if (in.getIpmiPort() != null) {
-            builder.ipmiPort(in.getIpmiPort());
-         }
-
-         return builder;
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getIp() {
-      return target.getIp();
-   }
-
-   public String getIpmiIp() {
-      return target.getIpmiIP();
-   }
-
-   public String getIpmiPassword() {
-      return target.getIpmiPassword();
-   }
-
-   public Integer getIpmiPort() {
-      return target.getIpmiPort();
-   }
-
-   public String getIpmiUser() {
-      return target.getIpmiUser();
-   }
-
-   public String getIpService() {
-      return target.getIpService();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getPassword() {
-      return target.getPassword();
-   }
-
-   public Integer getPort() {
-      return target.getPort();
-   }
-
-   public MachineState getState() {
-      return target.getState();
-   }
-
-   public HypervisorType getType() {
-      return target.getType();
-   }
-
-   public String getUser() {
-      return target.getUser();
-   }
-
-   public Integer getVirtualCpuCores() {
-      return target.getVirtualCpuCores();
-   }
-
-   public Integer getVirtualCpusUsed() {
-      return target.getVirtualCpusUsed();
-   }
-
-   public Integer getVirtualRamInMb() {
-      return target.getVirtualRamInMb();
-   }
-
-   public Integer getVirtualRamUsedInMb() {
-      return target.getVirtualRamUsedInMb();
-   }
-
-   public void setDatastores(final List<Datastore> datastores) {
-      DatastoresDto datastoresDto = new DatastoresDto();
-      datastoresDto.getCollection().addAll(copyOf(unwrap(datastores)));
-      target.setDatastores(datastoresDto);
-   }
-
-   public void setDescription(final String description) {
-      target.setDescription(description);
-   }
-
-   public void setIp(final String ip) {
-      target.setIp(ip);
-   }
-
-   public void setIpmiIp(final String ipmiIp) {
-      target.setIpmiIP(ipmiIp);
-   }
-
-   public void setIpmiPassword(final String ipmiPassword) {
-      target.setIpmiPassword(ipmiPassword);
-   }
-
-   public void setIpmiPort(final Integer ipmiPort) {
-      target.setIpmiPort(ipmiPort);
-   }
-
-   public void setIpmiUser(final String ipmiUser) {
-      target.setIpmiUser(ipmiUser);
-   }
-
-   public void setIpService(final String ipService) {
-      target.setIpService(ipService);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public void setPassword(final String password) {
-      target.setPassword(password);
-   }
-
-   public void setPort(final Integer port) {
-      target.setPort(port);
-   }
-
-   public void setState(final MachineState state) {
-      target.setState(state);
-   }
-
-   public void setType(final HypervisorType type) {
-      target.setType(type);
-   }
-
-   public void setUser(final String user) {
-      target.setUser(user);
-   }
-
-   public void setVirtualCpuCores(final Integer virtualCpuCores) {
-      target.setVirtualCpuCores(virtualCpuCores);
-   }
-
-   public void setVirtualCpusUsed(final Integer virtualCpusUsed) {
-      target.setVirtualCpusUsed(virtualCpusUsed);
-   }
-
-   public void setVirtualRamInMb(final Integer virtualRamInMb) {
-      target.setVirtualRamInMb(virtualRamInMb);
-   }
-
-   public void setVirtualRamUsedInMb(final Integer virtualRamUsedInMb) {
-      target.setVirtualRamUsedInMb(virtualRamUsedInMb);
-   }
-
-   public String getDescription() {
-      return target.getDescription();
-   }
-
-   public void setRack(final Rack rack) {
-      this.rack = rack;
-   }
-
-   @Override
-   public String toString() {
-      return "Machine [id=" + getId() + ", ip=" + getIp() + ", ipmiIp=" + getIpmiIp() + ", ipmiPassword="
-            + getIpmiPassword() + ", ipmiPort=" + getIpmiPort() + ", ipmiUser=" + getIpmiUser() + ", ipService="
-            + getIpService() + ", name=" + getName() + ", password=" + getPassword() + ", port=" + getPort()
-            + ", state=" + getState() + ", type=" + getType() + ", user=" + getUser() + ", virtualCpuCores="
-            + getVirtualCpuCores() + ", virtualCpusUsed=" + getVirtualCpusUsed() + ", getVirtualRamInMb()="
-            + getVirtualRamInMb() + ", virtualRamUsedInMb=" + getVirtualRamUsedInMb() + ", description="
-            + getDescription() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/NetworkInterface.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/NetworkInterface.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/NetworkInterface.java
deleted file mode 100644
index aec201b..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/NetworkInterface.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.network.NetworkServiceType;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.network.NetworkInterfaceDto;
-import com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Represents a physical attached NIC.
- * 
- * Allows to specify the {@link NetworkServiceType} for the network interface.
- * This way all network interfaces have the information of the kind of network
- * they are attached to.
- */
-public class NetworkInterface extends DomainWrapper<NetworkInterfaceDto> {
-   /**
-    * Constructor to be used only by the builder. This resource cannot be
-    * created.
-    */
-   protected NetworkInterface(final ApiContext<AbiquoApi> context, final NetworkInterfaceDto target) {
-      super(context, target);
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getMac() {
-      return target.getMac();
-   }
-
-   public void setNetworkServiceType(final NetworkServiceType type) {
-      checkNotNull(type, "network service type cannot be null");
-      target.setNetworkServiceTypeLink(type.unwrap().getEditLink().getHref());
-   }
-
-   public NetworkServiceType getNetworkServiceType() {
-      RESTLink link = target.getNetworkServiceTypeLink();
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<NetworkServiceTypeDto> parser = new ParseXMLWithJAXB<NetworkServiceTypeDto>(context.utils()
-            .xml(), TypeLiteral.get(NetworkServiceTypeDto.class));
-
-      return wrap(context, NetworkServiceType.class, parser.apply(response));
-   }
-}


[02/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/ConversionStatusMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/ConversionStatusMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/ConversionStatusMonitorTest.java
deleted file mode 100644
index 55efb73..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/ConversionStatusMonitorTest.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.domain.cloud.Conversion;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.ConversionState;
-import com.abiquo.server.core.appslibrary.ConversionDto;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link ConversionStatusMonitor} function.
- */
-@Test(groups = "unit", testName = "ConversionStatusMonitorTest")
-public class ConversionStatusMonitorTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullArgument() {
-      Function<Conversion, MonitorStatus> function = new ConversionStatusMonitor();
-      function.apply(null);
-   }
-
-   public void testReturnDone() {
-      ConversionState[] states = { ConversionState.FINISHED };
-
-      checkStatesReturn(new MockConversion(), new ConversionStatusMonitor(), states, MonitorStatus.DONE);
-   }
-
-   public void testReturnFail() {
-      ConversionState[] states = { ConversionState.FAILED };
-
-      checkStatesReturn(new MockConversion(), new ConversionStatusMonitor(), states, MonitorStatus.FAILED);
-   }
-
-   public void testReturnContinue() {
-      ConversionState[] states = { ConversionState.ENQUEUED };
-
-      checkStatesReturn(new MockConversion(), new ConversionStatusMonitor(), states, MonitorStatus.CONTINUE);
-
-      checkStatesReturn(new MockConversionFailing(), new ConversionStatusMonitor(), states, MonitorStatus.CONTINUE);
-   }
-
-   private void checkStatesReturn(final MockConversion task, final Function<Conversion, MonitorStatus> function,
-         final ConversionState[] states, final MonitorStatus expectedStatus) {
-      for (ConversionState state : states) {
-         task.setState(state);
-         assertEquals(function.apply(task), expectedStatus);
-      }
-   }
-
-   private static class MockConversion extends Conversion {
-      @SuppressWarnings("unchecked")
-      public MockConversion() {
-         super(EasyMock.createMock(ApiContext.class), new ConversionDto());
-      }
-
-      @Override
-      public void refresh() {
-         // Do not perform any API call
-      }
-
-      public void setState(final ConversionState state) {
-         target.setState(state);
-      }
-   }
-
-   private static class MockConversionFailing extends MockConversion {
-      @Override
-      public void refresh() {
-         throw new RuntimeException("This mock class always fails to refresh");
-      }
-
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceDeployMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceDeployMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceDeployMonitorTest.java
deleted file mode 100644
index 318cc26..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceDeployMonitorTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualApplianceState;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link VirtualApplianceDeployMonitor} function.
- */
-@Test(groups = "unit", testName = "VirtualApplianceDeployMonitorTest")
-public class VirtualApplianceDeployMonitorTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullArgument() {
-      Function<VirtualAppliance, MonitorStatus> function = new VirtualApplianceDeployMonitor();
-      function.apply(null);
-   }
-
-   public void testReturnDone() {
-      VirtualApplianceState[] states = { VirtualApplianceState.DEPLOYED };
-
-      checkStatesReturn(new MockVirtualAppliance(), new VirtualApplianceDeployMonitor(), states, MonitorStatus.DONE);
-   }
-
-   public void testReturnFail() {
-      VirtualApplianceState[] states = { VirtualApplianceState.NEEDS_SYNC, VirtualApplianceState.UNKNOWN,
-            VirtualApplianceState.NOT_DEPLOYED };
-
-      checkStatesReturn(new MockVirtualAppliance(), new VirtualApplianceDeployMonitor(), states, MonitorStatus.FAILED);
-   }
-
-   public void testReturnContinue() {
-      VirtualApplianceState[] states = { VirtualApplianceState.LOCKED };
-
-      checkStatesReturn(new MockVirtualAppliance(), new VirtualApplianceDeployMonitor(), states, MonitorStatus.CONTINUE);
-
-      checkStatesReturn(new MockVirtualApplianceFailing(), new VirtualApplianceDeployMonitor(), states,
-            MonitorStatus.CONTINUE);
-   }
-
-   private void checkStatesReturn(final MockVirtualAppliance vapp,
-         final Function<VirtualAppliance, MonitorStatus> function, final VirtualApplianceState[] states,
-         final MonitorStatus expectedStatus) {
-      for (VirtualApplianceState state : states) {
-         vapp.setState(state);
-         assertEquals(function.apply(vapp), expectedStatus);
-      }
-   }
-
-   private static class MockVirtualAppliance extends VirtualAppliance {
-      private VirtualApplianceState state;
-
-      @SuppressWarnings("unchecked")
-      public MockVirtualAppliance() {
-         super(EasyMock.createMock(ApiContext.class), new VirtualApplianceDto());
-      }
-
-      @Override
-      public VirtualApplianceState getState() {
-         return state;
-      }
-
-      public void setState(final VirtualApplianceState state) {
-         this.state = state;
-      }
-   }
-
-   private static class MockVirtualApplianceFailing extends MockVirtualAppliance {
-      @Override
-      public VirtualApplianceState getState() {
-         throw new RuntimeException("This mock class always fails to get the state");
-      }
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceUndeployMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceUndeployMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceUndeployMonitorTest.java
deleted file mode 100644
index 6de0867..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceUndeployMonitorTest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualApplianceState;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link VirtualApplianceUndeployMonitor} function.
- */
-@Test(groups = "unit", testName = "VirtualApplianceUndeployMonitorTest")
-public class VirtualApplianceUndeployMonitorTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullArgument() {
-      Function<VirtualAppliance, MonitorStatus> function = new VirtualApplianceUndeployMonitor();
-      function.apply(null);
-   }
-
-   public void testReturnDone() {
-      VirtualApplianceState[] states = { VirtualApplianceState.NOT_DEPLOYED };
-
-      checkStatesReturn(new MockVirtualAppliance(), new VirtualApplianceUndeployMonitor(), states, MonitorStatus.DONE);
-   }
-
-   public void testReturnFail() {
-      VirtualApplianceState[] states = { VirtualApplianceState.DEPLOYED, VirtualApplianceState.NEEDS_SYNC,
-            VirtualApplianceState.UNKNOWN };
-
-      checkStatesReturn(new MockVirtualAppliance(), new VirtualApplianceUndeployMonitor(), states, MonitorStatus.FAILED);
-   }
-
-   public void testReturnContinue() {
-      VirtualApplianceState[] states = { VirtualApplianceState.LOCKED };
-
-      checkStatesReturn(new MockVirtualAppliance(), new VirtualApplianceUndeployMonitor(), states,
-            MonitorStatus.CONTINUE);
-
-      checkStatesReturn(new MockVirtualApplianceFailing(), new VirtualApplianceUndeployMonitor(), states,
-            MonitorStatus.CONTINUE);
-   }
-
-   private void checkStatesReturn(final MockVirtualAppliance vapp,
-         final Function<VirtualAppliance, MonitorStatus> function, final VirtualApplianceState[] states,
-         final MonitorStatus expectedStatus) {
-      for (VirtualApplianceState state : states) {
-         vapp.setState(state);
-         assertEquals(function.apply(vapp), expectedStatus);
-      }
-   }
-
-   private static class MockVirtualAppliance extends VirtualAppliance {
-      private VirtualApplianceState state;
-
-      @SuppressWarnings("unchecked")
-      public MockVirtualAppliance() {
-         super(EasyMock.createMock(ApiContext.class), new VirtualApplianceDto());
-      }
-
-      @Override
-      public VirtualApplianceState getState() {
-         return state;
-      }
-
-      public void setState(final VirtualApplianceState state) {
-         this.state = state;
-      }
-   }
-
-   private static class MockVirtualApplianceFailing extends MockVirtualAppliance {
-      @Override
-      public VirtualApplianceState getState() {
-         throw new RuntimeException("This mock class always fails to get the state");
-      }
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineDeployMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineDeployMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineDeployMonitorTest.java
deleted file mode 100644
index d4386e9..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineDeployMonitorTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link VirtualMachineDeployMonitor} function.
- */
-@Test(groups = "unit", testName = "VirtualMachineDeployMonitorTest")
-public class VirtualMachineDeployMonitorTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullArgument() {
-      Function<VirtualMachine, MonitorStatus> function = new VirtualMachineDeployMonitor();
-      function.apply(null);
-   }
-
-   public void testReturnDone() {
-      VirtualMachineState[] states = { VirtualMachineState.ON };
-
-      checkStatesReturn(new MockVirtualMachine(), new VirtualMachineDeployMonitor(), states, MonitorStatus.DONE);
-   }
-
-   public void testReturnFail() {
-      VirtualMachineState[] states = { VirtualMachineState.NOT_ALLOCATED, VirtualMachineState.UNKNOWN };
-
-      checkStatesReturn(new MockVirtualMachine(), new VirtualMachineDeployMonitor(), states, MonitorStatus.FAILED);
-   }
-
-   public void testReturnContinue() {
-      VirtualMachineState[] states = { VirtualMachineState.ALLOCATED, VirtualMachineState.CONFIGURED,
-            VirtualMachineState.LOCKED, VirtualMachineState.OFF, VirtualMachineState.PAUSED };
-
-      checkStatesReturn(new MockVirtualMachine(), new VirtualMachineDeployMonitor(), states, MonitorStatus.CONTINUE);
-
-      checkStatesReturn(new MockVirtualMachineFailing(), new VirtualMachineDeployMonitor(), states,
-            MonitorStatus.CONTINUE);
-   }
-
-   private void checkStatesReturn(final MockVirtualMachine vm, final Function<VirtualMachine, MonitorStatus> function,
-         final VirtualMachineState[] states, final MonitorStatus expectedStatus) {
-      for (VirtualMachineState state : states) {
-         vm.setState(state);
-         assertEquals(function.apply(vm), expectedStatus);
-      }
-   }
-
-   private static class MockVirtualMachine extends VirtualMachine {
-      private VirtualMachineState state;
-
-      @SuppressWarnings("unchecked")
-      public MockVirtualMachine() {
-         super(EasyMock.createMock(ApiContext.class), new VirtualMachineWithNodeExtendedDto());
-      }
-
-      @Override
-      public VirtualMachineState getState() {
-         return state;
-      }
-
-      public void setState(final VirtualMachineState state) {
-         this.state = state;
-      }
-   }
-
-   private static class MockVirtualMachineFailing extends MockVirtualMachine {
-      @Override
-      public VirtualMachineState getState() {
-         throw new RuntimeException("This mock class always fails to get the state");
-      }
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineStateMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineStateMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineStateMonitorTest.java
deleted file mode 100644
index c41cd7c..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineStateMonitorTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link VirtualMachineStateMonitor} function.
- */
-@Test(groups = "unit", testName = "VirtualMachineStateMonitorTest")
-public class VirtualMachineStateMonitorTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullState() {
-      new VirtualMachineStateMonitor(null);
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullArgument() {
-      Function<VirtualMachine, MonitorStatus> function = new VirtualMachineStateMonitor(VirtualMachineState.ON);
-      function.apply(null);
-   }
-
-   public void testReturnDone() {
-      VirtualMachineState[] states = { VirtualMachineState.ON };
-
-      checkStatesReturn(new MockVirtualMachine(), new VirtualMachineStateMonitor(VirtualMachineState.ON), states,
-            MonitorStatus.DONE);
-   }
-
-   public void testReturnContinue() {
-      VirtualMachineState[] states = { VirtualMachineState.ALLOCATED, VirtualMachineState.CONFIGURED,
-            VirtualMachineState.LOCKED, VirtualMachineState.OFF, VirtualMachineState.PAUSED,
-            VirtualMachineState.NOT_ALLOCATED, VirtualMachineState.UNKNOWN };
-
-      checkStatesReturn(new MockVirtualMachine(), new VirtualMachineStateMonitor(VirtualMachineState.ON), states,
-            MonitorStatus.CONTINUE);
-
-      checkStatesReturn(new MockVirtualMachineFailing(), new VirtualMachineStateMonitor(VirtualMachineState.ON),
-            states, MonitorStatus.CONTINUE);
-   }
-
-   private void checkStatesReturn(final MockVirtualMachine vm, final Function<VirtualMachine, MonitorStatus> function,
-         final VirtualMachineState[] states, final MonitorStatus expectedStatus) {
-      for (VirtualMachineState state : states) {
-         vm.setState(state);
-         assertEquals(function.apply(vm), expectedStatus);
-      }
-   }
-
-   private static class MockVirtualMachine extends VirtualMachine {
-      private VirtualMachineState state;
-
-      @SuppressWarnings("unchecked")
-      public MockVirtualMachine() {
-         super(EasyMock.createMock(ApiContext.class), new VirtualMachineWithNodeExtendedDto());
-      }
-
-      @Override
-      public VirtualMachineState getState() {
-         return state;
-      }
-
-      public void setState(final VirtualMachineState state) {
-         this.state = state;
-      }
-   }
-
-   private static class MockVirtualMachineFailing extends MockVirtualMachine {
-      @Override
-      public VirtualMachineState getState() {
-         throw new RuntimeException("This mock class always fails to get the state");
-      }
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineUndeployMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineUndeployMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineUndeployMonitorTest.java
deleted file mode 100644
index 5163c59..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/VirtualMachineUndeployMonitorTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link VirtualMachineUndeployMonitor} function.
- */
-@Test(groups = "unit", testName = "VirtualMachineUndeployMonitorTest")
-public class VirtualMachineUndeployMonitorTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullArgument() {
-      Function<VirtualMachine, MonitorStatus> function = new VirtualMachineUndeployMonitor();
-      function.apply(null);
-   }
-
-   public void testReturnDone() {
-      VirtualMachineState[] states = { VirtualMachineState.NOT_ALLOCATED };
-
-      checkStatesReturn(new MockVirtualMachine(), new VirtualMachineUndeployMonitor(), states, MonitorStatus.DONE);
-   }
-
-   public void testReturnFail() {
-      VirtualMachineState[] states = { VirtualMachineState.ON, VirtualMachineState.CONFIGURED, VirtualMachineState.OFF,
-            VirtualMachineState.PAUSED, VirtualMachineState.UNKNOWN };
-
-      checkStatesReturn(new MockVirtualMachine(), new VirtualMachineUndeployMonitor(), states, MonitorStatus.FAILED);
-   }
-
-   public void testReturnContinue() {
-      VirtualMachineState[] states = { VirtualMachineState.ALLOCATED, VirtualMachineState.LOCKED };
-
-      checkStatesReturn(new MockVirtualMachine(), new VirtualMachineUndeployMonitor(), states, MonitorStatus.CONTINUE);
-
-      checkStatesReturn(new MockVirtualMachineFailing(), new VirtualMachineUndeployMonitor(), states,
-            MonitorStatus.CONTINUE);
-   }
-
-   private void checkStatesReturn(final MockVirtualMachine vm, final Function<VirtualMachine, MonitorStatus> function,
-         final VirtualMachineState[] states, final MonitorStatus expectedStatus) {
-      for (VirtualMachineState state : states) {
-         vm.setState(state);
-         assertEquals(function.apply(vm), expectedStatus);
-      }
-   }
-
-   private static class MockVirtualMachine extends VirtualMachine {
-      private VirtualMachineState state;
-
-      @SuppressWarnings("unchecked")
-      public MockVirtualMachine() {
-         super(EasyMock.createMock(ApiContext.class), new VirtualMachineWithNodeExtendedDto());
-      }
-
-      @Override
-      public VirtualMachineState getState() {
-         return state;
-      }
-
-      public void setState(final VirtualMachineState state) {
-         this.state = state;
-      }
-   }
-
-   private static class MockVirtualMachineFailing extends MockVirtualMachine {
-      @Override
-      public VirtualMachineState getState() {
-         throw new RuntimeException("This mock class always fails to get the state");
-      }
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/handlers/BlockingEventHandlerTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/handlers/BlockingEventHandlerTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/handlers/BlockingEventHandlerTest.java
deleted file mode 100644
index 52bdccc..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/handlers/BlockingEventHandlerTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.handlers;
-
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import org.jclouds.abiquo.monitor.events.MonitorEvent;
-import org.jclouds.abiquo.monitor.events.MonitorEvent.Type;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link BlockingEventHandler} handler.
- */
-@Test(groups = "unit", testName = "BlockingEventHandlerTest")
-public class BlockingEventHandlerTest {
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testConstructorWithoutObjects() {
-      new BlockingEventHandler<Object>();
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testConstructorWithNullObjects() {
-      new BlockingEventHandler<Object>((Object[]) null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testConstructorWithtEmptyObjects() {
-      new BlockingEventHandler<Object>(new Object[] {});
-   }
-
-   public void testHandles() {
-      Object object = new Object();
-      BlockingEventHandler<Object> handler = new BlockingEventHandler<Object>(object);
-
-      assertTrue(handler.handles(new MonitorEvent<Object>(Type.COMPLETED, object)));
-      assertFalse(handler.handles(new MonitorEvent<Object>(Type.COMPLETED, new Object())));
-   }
-
-   public void testReleaseDoesNothingIfNotLocked() {
-      Object object = new Object();
-      BlockingEventHandler<Object> handler = new BlockingEventHandler<Object>(object);
-      handler.release(object);
-   }
-
-   public void testRelease() {
-      final Object object = new Object();
-      final BlockingEventHandler<Object> handler = new BlockingEventHandler<Object>(object);
-
-      // Unlock the handler (in a separate thread) after a certain delay
-      Executors.newSingleThreadScheduledExecutor().schedule(new Runnable() {
-         @Override
-         public void run() {
-            handler.release(object);
-            assertTrue(handler.lockedObjects.isEmpty());
-         }
-
-      }, 500L, TimeUnit.MILLISECONDS);
-
-      handler.lock();
-   }
-
-   public void testHandle() {
-      final Object object = new Object();
-      final BlockingEventHandler<Object> handler = new BlockingEventHandler<Object>(object);
-
-      // Unlock the handler (in a separate thread) after a certain delay
-      Executors.newSingleThreadScheduledExecutor().schedule(new Runnable() {
-         @Override
-         public void run() {
-            handler.handle(new MonitorEvent<Object>(Type.COMPLETED, object));
-            assertTrue(handler.lockedObjects.isEmpty());
-         }
-
-      }, 500L, TimeUnit.MILLISECONDS);
-
-      handler.lock();
-   }
-
-   public void testLockDoesNothingIfNoObjects() {
-      Object object = new Object();
-      BlockingEventHandler<Object> handler = new BlockingEventHandler<Object>(object);
-      handler.lockedObjects.clear();
-
-      handler.lock(); // Lock should do nothing
-
-      assertNull(handler.completeSignal);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitorTest.java
deleted file mode 100644
index 5dc1051..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitorTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.internal;
-
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.abiquo.internal.BaseInjectionTest;
-import org.jclouds.abiquo.monitor.AsyncTaskMonitor;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link BaseAsyncTaskMonitor} class.
- */
-@Test(groups = "unit", testName = "BaseAsyncTaskMonitorTest")
-public class BaseAsyncTaskMonitorTest extends BaseInjectionTest {
-
-   public void testAllPropertiesInjected() {
-      BaseAsyncTaskMonitor monitor = (BaseAsyncTaskMonitor) injector.getInstance(AsyncTaskMonitor.class);
-
-      assertNotNull(monitor.taskMonitor);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitorTest.java
deleted file mode 100644
index e03f017..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitorTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.internal;
-
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.abiquo.internal.BaseInjectionTest;
-import org.jclouds.abiquo.monitor.VirtualApplianceMonitor;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link BaseVirtualApplianceMonitor} class.
- */
-@Test(groups = "unit", testName = "BaseVirtualApplianceMonitorTest")
-public class BaseVirtualApplianceMonitorTest extends BaseInjectionTest {
-
-   public void testAllPropertiesInjected() {
-      BaseVirtualApplianceMonitor monitor = (BaseVirtualApplianceMonitor) injector
-            .getInstance(VirtualApplianceMonitor.class);
-
-      assertNotNull(monitor.deployMonitor);
-      assertNotNull(monitor.undeployMonitor);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitorTest.java
deleted file mode 100644
index cf1d3b2..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitorTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.internal;
-
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.abiquo.internal.BaseInjectionTest;
-import org.jclouds.abiquo.monitor.VirtualMachineMonitor;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link BaseVirtualMachineMonitor} class.
- */
-@Test(groups = "unit", testName = "BaseVirtualMachineMonitorTest")
-public class BaseVirtualMachineMonitorTest extends BaseInjectionTest {
-
-   public void testAllPropertiesInjected() {
-      BaseVirtualMachineMonitor monitor = (BaseVirtualMachineMonitor) injector.getInstance(VirtualMachineMonitor.class);
-
-      assertNotNull(monitor.deployMonitor);
-      assertNotNull(monitor.undeployMonitor);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/reference/AbiquoTestConstants.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/reference/AbiquoTestConstants.java b/abiquo/src/test/java/org/jclouds/abiquo/reference/AbiquoTestConstants.java
deleted file mode 100644
index 8de7421..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/reference/AbiquoTestConstants.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.reference;
-
-/**
- * Configuration constants and properties used in Abiquo tests.
- */
-public final class AbiquoTestConstants {
-   /** The prefix for test object names. */
-   public static final String PREFIX = "JC-";
-
-   private AbiquoTestConstants() {
-      throw new AssertionError("intentionally unimplemented");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/strategy/BaseAbiquoStrategyLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/strategy/BaseAbiquoStrategyLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/strategy/BaseAbiquoStrategyLiveApiTest.java
deleted file mode 100644
index 9fa7234..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/strategy/BaseAbiquoStrategyLiveApiTest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.BeforeClass;
-
-/**
- * Base class for strategy live tests.
- */
-public abstract class BaseAbiquoStrategyLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   @BeforeClass(groups = "api")
-   protected abstract void setupStrategy();
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListAttachedNicsLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListAttachedNicsLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListAttachedNicsLiveApiTest.java
deleted file mode 100644
index 6c5e01e..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListAttachedNicsLiveApiTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy.cloud;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.getLast;
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.abiquo.domain.network.ExternalIp;
-import org.jclouds.abiquo.domain.network.Ip;
-import org.jclouds.abiquo.domain.network.PrivateIp;
-import org.jclouds.abiquo.domain.network.PublicIp;
-import org.jclouds.abiquo.domain.network.UnmanagedNetwork;
-import org.jclouds.abiquo.strategy.BaseAbiquoStrategyLiveApiTest;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.Lists;
-
-/**
- * Live tests for the {@link ListAttachedNics} strategy.
- */
-@Test(groups = "api", testName = "ListAttachedNicsLiveApiTest")
-public class ListAttachedNicsLiveApiTest extends BaseAbiquoStrategyLiveApiTest {
-   private ListAttachedNics strategy;
-
-   private PrivateIp privateIp;
-
-   private ExternalIp externalIp;
-
-   private PublicIp publicIp;
-
-   @Override
-   @BeforeClass(groups = "api")
-   protected void setupStrategy() {
-      this.strategy = env.context.utils().injector().getInstance(ListAttachedNics.class);
-
-      privateIp = getLast(env.privateNetwork.listUnusedIps());
-      externalIp = getLast(env.externalNetwork.listUnusedIps());
-
-      publicIp = getLast(env.virtualDatacenter.listAvailablePublicIps());
-      env.virtualDatacenter.purchasePublicIp(publicIp);
-      publicIp = find(env.virtualDatacenter.listPurchasedPublicIps(), new Predicate<PublicIp>() {
-         @Override
-         public boolean apply(PublicIp input) {
-            return input.getIp().equals(publicIp.getIp());
-         }
-      });
-
-      env.virtualMachine.setNics(Lists.<Ip<?, ?>> newArrayList(privateIp, externalIp, publicIp),
-            Lists.<UnmanagedNetwork> newArrayList(env.unmanagedNetwork));
-   }
-
-   @AfterClass(groups = "api")
-   protected void tearDownStrategy() {
-      env.virtualMachine.setNics(Lists.<Ip<?, ?>> newArrayList(privateIp));
-      final String address = publicIp.getIp();
-      env.virtualDatacenter.releasePublicIp(publicIp);
-      assertNull(find(env.virtualDatacenter.listPurchasedPublicIps(), new Predicate<PublicIp>() {
-         @Override
-         public boolean apply(PublicIp input) {
-            return input.getIp().equals(address);
-         }
-      }, null));
-   }
-
-   public void testExecute() {
-      Iterable<Ip<?, ?>> vapps = strategy.execute(env.virtualMachine);
-      assertNotNull(vapps);
-      assertEquals(4, size(vapps));
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListVirtualAppliancesLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListVirtualAppliancesLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListVirtualAppliancesLiveApiTest.java
deleted file mode 100644
index 6a6d1ef..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListVirtualAppliancesLiveApiTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy.cloud;
-
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.strategy.BaseAbiquoStrategyLiveApiTest;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-/**
- * Live tests for the {@link ListVirtualAppliances} strategy.
- */
-@Test(groups = "api", testName = "ListVirtualAppliancesLiveApiTest")
-public class ListVirtualAppliancesLiveApiTest extends BaseAbiquoStrategyLiveApiTest {
-   private ListVirtualAppliances strategy;
-
-   @Override
-   @BeforeClass(groups = "api")
-   protected void setupStrategy() {
-      this.strategy = env.context.utils().injector().getInstance(ListVirtualAppliances.class);
-   }
-
-   public void testExecute() {
-      Iterable<VirtualAppliance> vapps = strategy.execute();
-      assertNotNull(vapps);
-      assertTrue(size(vapps) > 0);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListVirtualDatacentersLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListVirtualDatacentersLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListVirtualDatacentersLiveApiTest.java
deleted file mode 100644
index 75c116b..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/strategy/cloud/ListVirtualDatacentersLiveApiTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy.cloud;
-
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.options.VirtualDatacenterOptions;
-import org.jclouds.abiquo.strategy.BaseAbiquoStrategyLiveApiTest;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-/**
- * Live tests for the {@link ListVirtualDatacenters} strategy.
- */
-@Test(groups = "api", testName = "ListVirtualDatacentersLiveApiTest")
-public class ListVirtualDatacentersLiveApiTest extends BaseAbiquoStrategyLiveApiTest {
-   private ListVirtualDatacenters strategy;
-
-   @Override
-   @BeforeClass(groups = "api")
-   protected void setupStrategy() {
-      this.strategy = env.context.utils().injector().getInstance(ListVirtualDatacenters.class);
-   }
-
-   public void testExecute() {
-      Iterable<VirtualDatacenter> vdcs = strategy.execute();
-      assertNotNull(vdcs);
-      assertTrue(size(vdcs) > 0);
-   }
-
-   public void testExecuteOptionsWithResults() {
-      Iterable<VirtualDatacenter> vdcs = strategy.execute(VirtualDatacenterOptions.builder()
-            .datacenterId(env.datacenter.getId()).enterpriseId(env.defaultEnterprise.getId()).build());
-      assertNotNull(vdcs);
-      assertEquals(size(vdcs), 1);
-   }
-
-   public void testExecuteOptionsWithoutResults() {
-      Iterable<VirtualDatacenter> vdcs = strategy.execute(VirtualDatacenterOptions.builder()
-            .enterpriseId(env.enterprise.getId()).build());
-      assertNotNull(vdcs);
-      assertEquals(size(vdcs), 0);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/strategy/enterprise/ListVirtualMachineTemplatesLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/strategy/enterprise/ListVirtualMachineTemplatesLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/strategy/enterprise/ListVirtualMachineTemplatesLiveApiTest.java
deleted file mode 100644
index 3470e7d..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/strategy/enterprise/ListVirtualMachineTemplatesLiveApiTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy.enterprise;
-
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.strategy.BaseAbiquoStrategyLiveApiTest;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-/**
- * Live tests for the {@link ListVirtualAppliances} strategy.
- */
-@Test(groups = "api", testName = "ListVirtualMachineTemplatesLiveApiTest")
-public class ListVirtualMachineTemplatesLiveApiTest extends BaseAbiquoStrategyLiveApiTest {
-   private ListVirtualMachineTemplates strategy;
-
-   @Override
-   @BeforeClass(groups = "api")
-   protected void setupStrategy() {
-      this.strategy = env.context.utils().injector().getInstance(ListVirtualMachineTemplates.class);
-   }
-
-   public void testExecute() {
-      Iterable<VirtualMachineTemplate> templates = strategy.execute(env.defaultEnterprise);
-      assertNotNull(templates);
-      assertTrue(size(templates) > 0);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/strategy/infrastructure/ListMachinesLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/strategy/infrastructure/ListMachinesLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/strategy/infrastructure/ListMachinesLiveApiTest.java
deleted file mode 100644
index b66712d..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/strategy/infrastructure/ListMachinesLiveApiTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy.infrastructure;
-
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.abiquo.domain.infrastructure.Machine;
-import org.jclouds.abiquo.strategy.BaseAbiquoStrategyLiveApiTest;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-/**
- * Live tests for the {@link ListMachines} strategy.
- */
-@Test(groups = "api", testName = "ListMachinesLiveApiTest")
-public class ListMachinesLiveApiTest extends BaseAbiquoStrategyLiveApiTest {
-   private ListMachines strategy;
-
-   @Override
-   @BeforeClass(groups = "api")
-   protected void setupStrategy() {
-      this.strategy = env.context.utils().injector().getInstance(ListMachines.class);
-   }
-
-   public void testExecute() {
-      Iterable<Machine> machines = strategy.execute();
-      assertNotNull(machines);
-      assertTrue(size(machines) > 0);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/util/Assert.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/util/Assert.java b/abiquo/src/test/java/org/jclouds/abiquo/util/Assert.java
deleted file mode 100644
index 7f0384a..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/util/Assert.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.util;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.io.IOException;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.io.Payload;
-import org.jclouds.xml.XMLParser;
-import org.jclouds.xml.internal.JAXBParser;
-
-import com.abiquo.model.transport.SingleResourceTransportDto;
-import com.abiquo.model.transport.error.ErrorDto;
-
-/**
- * Assertion utilities.
- */
-public class Assert {
-   /**
-    * Assert that the exception contains the given error.
-    * 
-    * @param exception
-    *           The exception.
-    * @param expectedHttpStatus
-    *           The expected HTTP status code.
-    * @param expectedErrorCode
-    *           The expected error code.
-    */
-   public static void assertHasError(final AbiquoException exception, final Status expectedHttpStatus,
-         final String expectedErrorCode) {
-      assertEquals(exception.getHttpStatus(), expectedHttpStatus);
-      ErrorDto error = exception.findError(expectedErrorCode);
-      assertNotNull(error);
-   }
-
-   /**
-    * Assert that the given payload matches the given string.
-    * 
-    * @param payload
-    *           The payload to check.
-    * @param expected
-    *           The expected string.
-    * @param entityClass
-    *           The entity class for the payload.
-    * @throws IOException
-    *            If there is an error during serialization.
-    */
-   public static void assertPayloadEquals(final Payload payload, final String expected,
-         final Class<? extends SingleResourceTransportDto> entityClass) throws IOException {
-      // Serialize and deserialize to avoid formatting issues
-      XMLParser xml = new JAXBParser("false");
-      SingleResourceTransportDto entity = xml.fromXML(expected, entityClass);
-      String toMatch = xml.toXML(entity, entityClass);
-
-      assertEquals(payload.getRawContent(), toMatch);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/util/Config.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/util/Config.java b/abiquo/src/test/java/org/jclouds/abiquo/util/Config.java
deleted file mode 100644
index 73470b4..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/util/Config.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.util;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.io.IOException;
-import java.util.Properties;
-
-/**
- * Test configuration.
- */
-public class Config {
-   /** The main configuration file. */
-   private static final String CONFIG_FILE = "api-live.properties";
-
-   /** The configuration properties */
-   private Properties config;
-
-   /** The singleton configuration instance. */
-   private static Config instance;
-
-   public Config(final String config) {
-      ClassLoader cl = Thread.currentThread().getContextClassLoader();
-      this.config = new Properties();
-
-      try {
-         this.config.load(cl.getResourceAsStream(config));
-      } catch (IOException ex) {
-         throw new RuntimeException("Could not load test configuration file", ex);
-      }
-   }
-
-   public Config(final Properties config) {
-      this.config = config;
-   }
-
-   public static String get(final String property) {
-      return get(property, null);
-   }
-
-   public static String get(final String property, final String defaultValue) {
-      if (instance == null) {
-         String configFile = System.getProperty("abiquo.live.config", CONFIG_FILE);
-         instance = new Config(configFile);
-      }
-
-      return checkNotNull(instance.config.getProperty(property, defaultValue));
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/api-live.properties
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/api-live.properties b/abiquo/src/test/resources/api-live.properties
deleted file mode 100644
index dfaa959..0000000
--- a/abiquo/src/test/resources/api-live.properties
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-# Hypervisor configuration
-abiquo.hypervisor.type = ${abiquo.hypervisor.type}
-abiquo.hypervisor.address = ${abiquo.hypervisor.address}
-abiquo.hypervisor.user = ${abiquo.hypervisor.user}
-abiquo.hypervisor.pass = ${abiquo.hypervisor.pass}
-abiquo.hypervisor.vswitch = ${abiquo.hypervisor.vswitch}
-abiquo.hypervisor.datastore = ${abiquo.hypervisor.datastore}
-
-# Storage configuration
-abiquo.storage.type = ${abiquo.storage.type}
-abiquo.storage.address = ${abiquo.storage.address}
-abiquo.storage.pass = ${abiquo.storage.pass}
-abiquo.storage.user = ${abiquo.storage.user}
-abiquo.storage.pool = ${abiquo.storage.pool}
-
-# UCS Rack configuration
-abiquo.ucs.address = ${abiquo.ucs.address}
-abiquo.ucs.port = ${abiquo.ucs.port}
-abiquo.ucs.pass = ${abiquo.ucs.pass}
-abiquo.ucs.user = ${abiquo.ucs.user}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/filters/filters.properties
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/filters/filters.properties b/abiquo/src/test/resources/filters/filters.properties
deleted file mode 100644
index 48f4cab..0000000
--- a/abiquo/src/test/resources/filters/filters.properties
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-# Hypervisor configuration
-# This is the Tarantino IT hypervisor.
-# Should be replaced with a dedicated ESX asap!
-
-abiquo.hypervisor.pass=tarantino
-abiquo.hypervisor.address=10.60.1.132
-abiquo.hypervisor.datastore=nfs-ds
-abiquo.hypervisor.type=VMX_04
-#abiquo.hypervisor.address=10.60.20.62
-#abiquo.hypervisor.pass=temporal
-abiquo.hypervisor.user=root
-abiquo.hypervisor.vswitch=vSwitch0
-#abiquo.hypervisor.datastore=datastore1
-
-# Storage configuration
-abiquo.storage.type=LVM
-abiquo.storage.address=10.60.12.177
-#abiquo.storage.user=
-#abiquo.storage.pass=
-abiquo.storage.pool=abiquo
-
-# UCS Rack configuration
-abiquo.ucs.address=10.60.1.45
-abiquo.ucs.port=80
-abiquo.ucs.pass=config
-abiquo.ucs.user=config

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/license/expired
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/license/expired b/abiquo/src/test/resources/license/expired
deleted file mode 100644
index 6e56ec7..0000000
--- a/abiquo/src/test/resources/license/expired
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-R48/Z+e2HzLPtsHHJG/uJeF6Vn2jMseyPYeQQN/WVpYjGGsGNWWTcnbWcXg75Qk2rxDwU9TOiyFPUWOIJ1gUoiqQKLoy6OpN3TNqTHb56WFropU1wwefgoqEL/ZI2AJm+H9aCj6hf3agL8nlpkemBYeYbx1QgJ1g7g3exxmFZHPcLe+KBukkRBHoxB8TlbqupB2lWQ3hUWzMwcb0ayQAA7pt+O3XSZ4eML1fNyzgTLG82nO1SnSHj1dpLb4g3xzjZxt4SZFZ1Dq4X+2TVU4XEVmwO1mQYksYRy3KqtOdmvIA4z0sSDxAXQPds+qncp2jCiuXgyOyencbeSg4duwKBnl/v+dceFIALxsl2Y8wdJrdPibC4I4q1e5fKA8LowT7RRogbRJ8Fhwqw8VURG/MlhOKkb7zMFLR/wzjl1dM1itE3uxyg+Y3bY4K8aWCv0xZIJdRb3s2Cl1bzn6E7bg54UGhIGKxCnsLgXy+GLZTsdhOmxqs0a9HudJEGcDcqRiaa7/OFYfcyyVCxDxg6qS4M5goXMRxI7pMFhxlQvuxoKSOuijrTmXAFxMjQ6TCbYNogh454k+IwpreHDF67ey07rS9KyygyyflvO2bNCP6ng93drsGqY4ZWR4D9AeEPvCytkMNyzO4siWKmjIy8PcwzRYUSbt/6bat7E1RNj3d9/c=

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/logback-test.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/logback-test.xml b/abiquo/src/test/resources/logback-test.xml
deleted file mode 100644
index ebdf6c0..0000000
--- a/abiquo/src/test/resources/logback-test.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<configuration>
-    <appender name="HEADERSFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>target/test-data/jclouds-headers.log</file>
-        <append>true</append>
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>TRACE</level>
-        </filter>
-        <encoder>
-            <pattern>%date %level [%logger] \(%thread\) %msg%n</pattern>
-        </encoder>
-        <!-- Rollover at midnight each day -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>target/test-data/jclouds-headers.log.%d</fileNamePattern>
-            <maxHistory>5</maxHistory>
-        </rollingPolicy>
-    </appender>
-    <appender name="WIREFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>target/test-data/jclouds-wire.log</file>
-        <append>true</append>
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>TRACE</level>
-        </filter>
-        <encoder>
-            <pattern>%date %level [%logger] \(%thread\) %msg%n</pattern>
-        </encoder>
-        <!-- Rollover at midnight each day -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>target/test-data/jclouds-payloads.log.%d</fileNamePattern>
-            <maxHistory>5</maxHistory>
-        </rollingPolicy>
-    </appender>
-    <appender name="COMPUTEFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>target/test-data/jclouds-compute.log</file>
-        <append>true</append>
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>TRACE</level>
-        </filter>
-        <encoder>
-            <pattern>%date %level [%logger] \(%thread\) %msg%n</pattern>
-        </encoder>
-        <!-- Rollover at midnight each day -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>target/test-data/jclouds-compute.log.%d</fileNamePattern>
-            <maxHistory>5</maxHistory>
-        </rollingPolicy>
-    </appender>
-    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>target/test-data/jclouds.log</file>
-        <append>true</append>
-        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
-            <level>TRACE</level>
-        </filter>
-        <encoder>
-            <pattern>%date %level [%logger] \(%thread\) %msg%n</pattern>
-        </encoder>
-        <!-- Rollover at midnight each day -->
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>target/test-data/jclouds.log.%d</fileNamePattern>
-            <maxHistory>5</maxHistory>
-        </rollingPolicy>
-    </appender>
-    
-    <!-- ============= -->
-    <!-- Limit loggers -->
-    <!-- ============= -->
-    
-    <logger name="org.jclouds">
-        <level value="DEBUG" />
-        <appender-ref ref="FILE" />
-    </logger>
-    <logger name="jclouds.headers">
-        <level value="DEBUG" />
-        <appender-ref ref="HEADERSFILE" />
-        <appender-ref ref="WIREFILE" />
-    </logger>
-    <logger name="jclouds.wire">
-        <level value="DEBUG" />
-        <appender-ref ref="WIREFILE" />
-    </logger>
-    <logger name="jclouds.compute">
-        <level value="DEBUG" />
-        <appender-ref ref="COMPUTEFILE" />
-    </logger>
-
-    <!-- ===================== -->
-    <!-- Setup the root logger -->
-    <!-- ===================== -->
-    
-    <root>
-        <level value="WARN" />
-    </root>
-    
-</configuration>

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/all-vms-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/all-vms-lastpage.xml b/abiquo/src/test/resources/payloads/all-vms-lastpage.xml
deleted file mode 100644
index 05ae6eb..0000000
--- a/abiquo/src/test/resources/payloads/all-vms-lastpage.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<virtualmachineswithnodeextended>
-    <link href="http://localhost/api/cloud/virtualmachines" rel="first" />
-    <link href="http://localhost/api/cloud/virtualmachines?startwith=0" rel="previous" />
-    <link href="http://localhost/api/cloud/virtualmachines?startwith=2" rel="last" />
-    <totalSize>2</totalSize>
-    <virtualmachinewithnodeextended>
-        <link rel="deploy" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/deploy" />
-        <link rel="disks" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/disks" />
-        <link rel="edit" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1" />
-        <link rel="state" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/state" />
-        <link rel="reset" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/reset" />
-        <link rel="tasks" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/tasks" />
-        <link rel="undeploy" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/undeploy" />
-        <link rel="persistent" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/persistent" />
-        <link rel="virtualappliance" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1" />
-        <link rel="virtualmachinetemplate" href="/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1" />
-        <link rel="nics" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/nics" />
-        <link rel="volumes" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/volumes" />
-        <link rel="configurations" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/configurations" />
-        <cpu>0</cpu>
-        <hdInBytes>0</hdInBytes>
-        <highDisponibility>0</highDisponibility>
-        <id>2</id>
-        <idState>0</idState>
-        <idType>0</idType>
-        <name>VM</name>
-        <ram>0</ram>
-        <vdrpPort>0</vdrpPort>
-    </virtualmachinewithnodeextended>
-</virtualmachineswithnodeextended>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/all-vms.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/all-vms.xml b/abiquo/src/test/resources/payloads/all-vms.xml
deleted file mode 100644
index 007fe11..0000000
--- a/abiquo/src/test/resources/payloads/all-vms.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<virtualmachineswithnodeextended>
-    <link href="http://localhost/api/cloud/virtualmachines" rel="first" />
-    <link href="http://localhost/api/cloud/virtualmachines?startwith=2" rel="next" />
-    <link href="http://localhost/api/cloud/virtualmachines?startwith=2" rel="last" />
-    <totalSize>2</totalSize>
-    <virtualmachinewithnodeextended>
-        <link rel="deploy" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/deploy" />
-        <link rel="disks" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/disks" />
-        <link rel="edit" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1" />
-        <link rel="state" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/state" />
-        <link rel="reset" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/reset" />
-        <link rel="tasks" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/tasks" />
-        <link rel="undeploy" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/undeploy" />
-        <link rel="persistent" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/persistent" />
-        <link rel="virtualappliance" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1" />
-        <link rel="virtualmachinetemplate" href="/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1" />
-        <link rel="nics" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/nics" />
-        <link rel="volumes" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/volumes" />
-        <link rel="configurations" href="http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/configurations" />
-        <cpu>0</cpu>
-        <hdInBytes>0</hdInBytes>
-        <highDisponibility>0</highDisponibility>
-        <id>1</id>
-        <idState>0</idState>
-        <idType>0</idType>
-        <name>VM</name>
-        <ram>0</ram>
-        <vdrpPort>0</vdrpPort>
-    </virtualmachinewithnodeextended>
-</virtualmachineswithnodeextended>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/available-templates-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/available-templates-lastpage.xml b/abiquo/src/test/resources/payloads/available-templates-lastpage.xml
deleted file mode 100644
index 4e8b2f7..0000000
--- a/abiquo/src/test/resources/payloads/available-templates-lastpage.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<virtualMachineTemplates>
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/action/templates" rel="first" />
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/action/templates?startwith=0" rel="previous" />
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/action/templates?startwith=1" rel="last" />
-    <totalSize>2</totalSize>
-    <virtualMachineTemplate>
-        <link href="http://example.com/api/config/categories/1" rel="category" title="Others" type="application/vnd.abiquo.category+xml" />
-        <link href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/16/conversions" rel="conversions" type="application/vnd.abiquo.conversions+xml" />
-        <link href="http://example.com/api/admin/datacenters/1" rel="datacenter" type="application/vnd.abiquo.datacenter+xml" />
-        <link href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1" rel="datacenterrepository" type="application/vnd.abiquo.datacenterrepository+xml" />
-        <link href="http://example.com/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F71%252Fdesc.ovf?format=diskFile" rel="diskfile" />
-        <link href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/16" rel="edit" title="Abiquo KVM" type="application/vnd.abiquo.virtualmachinetemplate+xml" />
-        <link href="http://example.com/api/admin/enterprises/1" rel="enterprise" type="application/vnd.abiquo.enterprise+xml" />
-        <link href="http://example.com/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F71%252Fdesc.ovf?format=envelope" rel="ovfdocument" />
-        <link href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/16/tasks" rel="tasks" type="application/vnd.abiquo.tasks+xml" />
-        <link href="http://example.com/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F71%252Fdesc.ovf" rel="template" />
-        <link href="http://rs.bcn.abiquo.com:9000/ovf/71/desc.ovf" rel="templatedefinition" />
-        <link href="http://example.com/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F71%252Fdesc.ovf?format=status" rel="templatestatus" />
-        <id>16</id>
-        <name>Abiquo KVM</name>
-        <description />
-        <osType>UNRECOGNIZED</osType>
-        <osVersion />
-        <path>1/rs.bcn.abiquo.com/abiport9000/ovf/71/KVM-Recursion.qcow2</path>
-        <diskFormatType>QCOW2_SPARSE</diskFormatType>
-        <diskFileSize>320798720</diskFileSize>
-        <cpuRequired>1</cpuRequired>
-        <ramRequired>1024</ramRequired>
-        <hdRequired>4294967296</hdRequired>
-        <shared>false</shared>
-        <state>DONE</state>
-        <costCode>0</costCode>
-        <creationDate>2013-01-16T15:06:14+01:00</creationDate>
-        <creationUser>SYSTEM</creationUser>
-        <chefEnabled>false</chefEnabled>
-        <iconUrl>http://rs.bcn.abiquo.com:9000/public/icons/q.png</iconUrl>
-        <loginUser>user</loginUser>
-        <loginPassword>password</loginPassword>
-        <ethernetDriverType>E1000</ethernetDriverType>
-        <diskControllerType>SCSI</diskControllerType>
-    </virtualMachineTemplate>
-</virtualMachineTemplates>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/available-templates-page.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/available-templates-page.xml b/abiquo/src/test/resources/payloads/available-templates-page.xml
deleted file mode 100644
index 886d364..0000000
--- a/abiquo/src/test/resources/payloads/available-templates-page.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<virtualMachineTemplates>
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/action/templates" rel="first" />
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/action/templates?startwith=1" rel="next" />
-    <link href="http://example.com/api/cloud/virtualdatacenters/1/action/templates?startwith=1" rel="last" />
-    <totalSize>2</totalSize>
-    <virtualMachineTemplate>
-        <link href="http://example.com/api/config/categories/1" rel="category" title="Others" type="application/vnd.abiquo.category+xml" />
-        <link href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/15/conversions" rel="conversions" type="application/vnd.abiquo.conversions+xml" />
-        <link href="http://example.com/api/admin/datacenters/1" rel="datacenter" type="application/vnd.abiquo.datacenter+xml" />
-        <link href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1" rel="datacenterrepository" type="application/vnd.abiquo.datacenterrepository+xml" />
-        <link href="http://example.com/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F71%252Fdesc.ovf?format=diskFile" rel="diskfile" />
-        <link href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/15" rel="edit" title="Abiquo KVM" type="application/vnd.abiquo.virtualmachinetemplate+xml" />
-        <link href="http://example.com/api/admin/enterprises/1" rel="enterprise" type="application/vnd.abiquo.enterprise+xml" />
-        <link href="http://example.com/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F71%252Fdesc.ovf?format=envelope" rel="ovfdocument" />
-        <link href="http://example.com/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/15/tasks" rel="tasks" type="application/vnd.abiquo.tasks+xml" />
-        <link href="http://example.com/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F71%252Fdesc.ovf" rel="template" />
-        <link href="http://rs.bcn.abiquo.com:9000/ovf/71/desc.ovf" rel="templatedefinition" />
-        <link href="http://example.com/am/erepos/1/templates/rs.bcn.abiquo.com%253A9000%252Fovf%252F71%252Fdesc.ovf?format=status" rel="templatestatus" />
-        <id>15</id>
-        <name>Abiquo KVM</name>
-        <description />
-        <osType>UNRECOGNIZED</osType>
-        <osVersion />
-        <path>1/rs.bcn.abiquo.com/abiport9000/ovf/71/KVM-Recursion.qcow2</path>
-        <diskFormatType>QCOW2_SPARSE</diskFormatType>
-        <diskFileSize>320798720</diskFileSize>
-        <cpuRequired>1</cpuRequired>
-        <ramRequired>1024</ramRequired>
-        <hdRequired>4294967296</hdRequired>
-        <shared>false</shared>
-        <state>DONE</state>
-        <costCode>0</costCode>
-        <creationDate>2013-01-16T15:06:14+01:00</creationDate>
-        <creationUser>SYSTEM</creationUser>
-        <chefEnabled>false</chefEnabled>
-        <iconUrl>http://rs.bcn.abiquo.com:9000/public/icons/q.png</iconUrl>
-        <loginUser>user</loginUser>
-        <loginPassword>password</loginPassword>
-        <ethernetDriverType>E1000</ethernetDriverType>
-        <diskControllerType>SCSI</diskControllerType>
-    </virtualMachineTemplate>
-</virtualMachineTemplates>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/resources/payloads/enterprises-lastpage.xml
----------------------------------------------------------------------
diff --git a/abiquo/src/test/resources/payloads/enterprises-lastpage.xml b/abiquo/src/test/resources/payloads/enterprises-lastpage.xml
deleted file mode 100644
index 77654c9..0000000
--- a/abiquo/src/test/resources/payloads/enterprises-lastpage.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<enterprises>
-    <link rel="first" href="http://localhost/api/admin/enterprises" />
-    <link rel="previous" href="http://localhost/api/admin/enterprises?startwith=0"/>
-    <link rel="last" href="http://localhost/api/admin/enterprises?startwith=1"/>
-    <totalSize>2</totalSize>
-    <enterprise>
-        <link rel="appslib/templateDefinitionLists" type="application/vnd.abiquo.templatedefinitionlists+xml" href="http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists"/>
-        <link rel="appslib/templateDefinitions" type="application/vnd.abiquo.templatedefinitions+xml" href="http://localhost/api/admin/enterprises/1/appslib/templateDefinitions"/>
-        <link rel="cloud/virtualdatacenters" type="application/vnd.abiquo.virtualdatacenters+xml" href="http://localhost/api/admin/enterprises/1/action/virtualdatacenters"/>
-        <link rel="datacenterrepositories" type="application/vnd.abiquo.datacenterrepositories+xml" href="http://localhost/api/admin/enterprises/1/datacenterrepositories"/>
-        <link rel="edit" type="application/vnd.abiquo.enterprise+xml" href="http://localhost/api/admin/enterprises/1"/>
-        <link rel="externalnetworks" type="application/vnd.abiquo.vlans+xml" href="http://localhost/api/admin/enterprises/1/action/externalnetworks"/>
-        <link rel="ips" href="http://localhost/api/admin/enterprises/1/action/ips"/>
-        <link rel="limits" type="application/vnd.abiquo.limits+xml" href="http://localhost/api/admin/enterprises/1/limits"/>
-        <link rel="properties" type="application/vnd.abiquo.enterpriseproperties+xml" href="http://localhost/api/admin/enterprises/1/properties"/>
-        <link rel="reservedmachines" type="application/vnd.abiquo.machines+xml" href="http://localhost/api/admin/enterprises/1/reservedmachines"/>
-        <link rel="users" type="application/vnd.abiquo.users+xml" href="http://localhost/api/admin/enterprises/1/users"/>
-        <link rel="virtualappliances" type="application/vnd.abiquo.virtualappliances+xml" href="http://localhost/api/admin/enterprises/1/action/virtualappliances"/>
-        <link rel="virtualmachines" type="application/vnd.abiquo.virtualmachines+xml" href="http://localhost/api/admin/enterprises/1/action/virtualmachines"/>
-        <link rel="volumes" type="application/vnd.abiquo.iscsivolumes+xml" href="http://localhost/api/admin/enterprises/1/action/volumes"/>
-        <cpuHard>0</cpuHard>
-        <cpuSoft>0</cpuSoft>
-        <hdHard>0</hdHard>
-        <hdSoft>0</hdSoft>
-        <publicIpsHard>0</publicIpsHard>
-        <publicIpsSoft>0</publicIpsSoft>
-        <ramHard>0</ramHard>
-        <ramSoft>0</ramSoft>
-        <storageHard>0</storageHard>
-        <storageSoft>0</storageSoft>
-        <vlansHard>0</vlansHard>
-        <vlansSoft>0</vlansSoft>
-        <id>2</id>
-        <isReservationRestricted>false</isReservationRestricted>
-        <name>Abiquo</name>
-        <repositoryHard>0</repositoryHard>
-        <repositorySoft>0</repositorySoft>
-    </enterprise>
-</enterprises>
\ No newline at end of file


[20/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/config/SystemProperty.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/SystemProperty.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/config/SystemProperty.java
deleted file mode 100644
index 5189216..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/SystemProperty.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.config;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.config.SystemPropertyDto;
-
-/**
- * Adds high level functionality to {@link SystemPropertyDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/System+Property+resource"
- *      > http://community.abiquo.com/display/ABI20/System+Property+resource</a>
- */
-
-public class SystemProperty extends DomainWrapper<SystemPropertyDto> {
-   /**
-    * Constructor to be used only by the builder. This resource cannot be
-    * created.
-    */
-   private SystemProperty(final ApiContext<AbiquoApi> context, final SystemPropertyDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/System+Property+resource#SystemPropertyresource-ModifyanexistingSystemProperty"
-    *      > http://community.abiquo.com/display/ABI20/System+Property+resource#
-    *      SystemPropertyresource-ModifyanexistingSystemProperty</a>
-    */
-   public void update() {
-      target = context.getApi().getConfigApi().updateSystemProperty(target);
-   }
-
-   // Delegate methods
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getValue() {
-      return target.getValue();
-   }
-
-   public void setValue(final String value) {
-      target.setValue(value);
-   }
-
-   @Override
-   public String toString() {
-      return "SystemProperty [getName()=" + getName() + ", getValue()=" + getValue() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/IconOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/IconOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/IconOptions.java
deleted file mode 100644
index 0bd6015..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/IconOptions.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.config.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query icons.
- */
-public class IconOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      IconOptions options = new IconOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-      private String path;
-
-      public Builder path(final String path) {
-         this.path = path;
-         return this;
-      }
-
-      public IconOptions build() {
-         IconOptions options = new IconOptions();
-         if (path != null) {
-            options.queryParameters.put("path", path);
-         }
-
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/LicenseOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/LicenseOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/LicenseOptions.java
deleted file mode 100644
index 84786ac..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/LicenseOptions.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.config.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query licenses.
- */
-public class LicenseOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      LicenseOptions options = new LicenseOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-      private Boolean active;
-
-      /**
-       * Search active licenses
-       */
-      public Builder active(final boolean active) {
-         this.active = active;
-         return this;
-      }
-
-      /**
-       * Search inactive licenses
-       */
-      public Builder inactive(final boolean inactive) {
-         this.active = !inactive;
-         return this;
-      }
-
-      public LicenseOptions build() {
-         LicenseOptions options = new LicenseOptions();
-         if (active != null) {
-            options.queryParameters.put("active", active.toString());
-         }
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/PropertyOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/PropertyOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/PropertyOptions.java
deleted file mode 100644
index 2a47979..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/options/PropertyOptions.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.config.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query system properties.
- */
-public class PropertyOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      PropertyOptions options = new PropertyOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-      private String component;
-
-      private String name;
-
-      public Builder component(final String component) {
-         this.component = component;
-         return this;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public PropertyOptions build() {
-         PropertyOptions options = new PropertyOptions();
-         if (component != null) {
-            options.queryParameters.put("component", component.toString());
-         }
-
-         if (name != null) {
-            options.queryParameters.put("name", name.toString());
-         }
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Enterprise.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Enterprise.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Enterprise.java
deleted file mode 100644
index 8752f5a..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Enterprise.java
+++ /dev/null
@@ -1,645 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWithLimitsWrapper;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.builder.LimitsBuilder;
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.enterprise.options.UserOptions;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.infrastructure.Machine;
-import org.jclouds.abiquo.domain.network.ExternalNetwork;
-import org.jclouds.abiquo.domain.network.UnmanagedNetwork;
-import org.jclouds.abiquo.strategy.enterprise.ListVirtualMachineTemplates;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.appslibrary.TemplateDefinitionListDto;
-import com.abiquo.server.core.appslibrary.TemplateDefinitionListsDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.cloud.VirtualAppliancesDto;
-import com.abiquo.server.core.cloud.VirtualDatacentersDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.DatacenterLimitsDto;
-import com.abiquo.server.core.enterprise.DatacentersLimitsDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.enterprise.EnterprisePropertiesDto;
-import com.abiquo.server.core.enterprise.RolesDto;
-import com.abiquo.server.core.enterprise.UserDto;
-import com.abiquo.server.core.enterprise.UsersDto;
-import com.abiquo.server.core.infrastructure.DatacentersDto;
-import com.abiquo.server.core.infrastructure.MachinesDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworksDto;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.inject.TypeLiteral;
-
-/**
- * Represents a tenant.
- * <p>
- * Each tenant has a set of available locations, and a set of compute,
- * networking and storage resources that can be consumed in the assigned
- * locations.
- */
-public class Enterprise extends DomainWithLimitsWrapper<EnterpriseDto> {
-   /** The default value for the reservation restricted flag. */
-   private static final boolean DEFAULT_RESERVATION_RESTRICTED = false;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Enterprise(final ApiContext<AbiquoApi> context, final EnterpriseDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * Delete the enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/EnterpriseResource#EnterpriseResource-DeleteanexistingEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/EnterpriseResource#
-    *      EnterpriseResource- DeleteanexistingEnterprise</a>
-    */
-   public void delete() {
-      context.getApi().getEnterpriseApi().deleteEnterprise(target);
-      target = null;
-   }
-
-   /**
-    * Create a new enterprise in Abiquo.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/EnterpriseResource#EnterpriseResource-CreatesanewEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/EnterpriseResource#
-    *      EnterpriseResource- CreatesanewEnterprise</a>
-    */
-   public void save() {
-      target = context.getApi().getEnterpriseApi().createEnterprise(target);
-   }
-
-   /**
-    * Update enterprise information in the server with the data from this
-    * enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/EnterpriseResource#EnterpriseResource-Updateanexistingenterprise"
-    *      > http://community.abiquo.com/display/ABI20/EnterpriseResource#
-    *      EnterpriseResource- Updateanexistingenterprise</a>
-    */
-   public void update() {
-      target = context.getApi().getEnterpriseApi().updateEnterprise(target);
-   }
-
-   // Children access
-
-   /**
-    * Retrieve the list of virtual datacenters by this enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/EnterpriseResource#EnterpriseResource-RetrievealistofvitualdatacentersbyanEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/EnterpriseResource#
-    *      EnterpriseResource-
-    *      RetrievealistofvitualdatacentersbyanEnterprise</a>
-    * @return List of virtual datacenters in this enterprise.
-    */
-   public Iterable<VirtualDatacenter> listVirtualDatacenters() {
-      VirtualDatacentersDto dto = context.getApi().getEnterpriseApi().listVirtualDatacenters(target);
-      return wrap(context, VirtualDatacenter.class, dto.getCollection());
-   }
-
-   /**
-    * Retrieve the list of template definition lists of the enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/TemplateDefinitionListResource#TemplateDefinitionListResource-Retrievealltemplatedefinitionlists"
-    *      > http://community.abiquo.com/display/ABI20/
-    *      TemplateDefinitionListResource#
-    *      TemplateDefinitionListResource-Retrievealltemplatedefinitionlists</a>
-    * @return List of template definition lists of the enterprise.
-    */
-   public Iterable<TemplateDefinitionList> listTemplateDefinitionLists() {
-      TemplateDefinitionListsDto dto = context.getApi().getEnterpriseApi().listTemplateDefinitionLists(target);
-      return wrap(context, TemplateDefinitionList.class, dto.getCollection());
-   }
-
-   /**
-    * Retrieve a single template definition list.
-    * 
-    * @param id
-    *           Unique ID of the template definition list for this enterprise.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/TemplateDefinitionListResource#TemplateDefinitionListResource-Retrieveatemplatedefinitionlist"
-    *      > http://community.abiquo.com/display/ABI20/
-    *      TemplateDefinitionListResource#
-    *      TemplateDefinitionListResource-Retrieveatemplatedefinitionlist</a>
-    * @return Template definition with the given id or <code>null</code> if it
-    *         does not exist.
-    */
-   public TemplateDefinitionList getTemplateDefinitionList(final Integer id) {
-      TemplateDefinitionListDto templateList = context.getApi().getEnterpriseApi()
-            .getTemplateDefinitionList(target, id);
-      return wrap(context, TemplateDefinitionList.class, templateList);
-   }
-
-   /**
-    * Retrieve the list of datacenter limits by enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterLimitsResource#DatacenterLimitsResource-Retrievelimitsbyenterprise"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterLimitsResource#
-    *      DatacenterLimitsResource-Retrievelimitsbyenterprise</a>
-    * @return List of datacenter limits by enterprise.
-    */
-   public Iterable<Limits> listLimits() {
-      DatacentersLimitsDto dto = context.getApi().getEnterpriseApi().listLimits(this.unwrap());
-      return wrap(context, Limits.class, dto.getCollection());
-   }
-
-   /**
-    * Retrieve the defined properties of the given enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/EnterprisePropertiesResource#EnterprisePropertiesResource-Retrievethepropertiesforanenterprise"
-    *      > http://community.abiquo.com/display/ABI20/
-    *      EnterprisePropertiesResource#
-    *      EnterprisePropertiesResource-Retrievethepropertiesforanenterprise</a>
-    * @return The defined properties of the given enterprise.
-    */
-   public EnterpriseProperties getEnterpriseProperties() {
-      EnterprisePropertiesDto dto = context.getApi().getEnterpriseApi().getEnterpriseProperties(this.unwrap());
-      return wrap(context, EnterpriseProperties.class, dto);
-   }
-
-   /**
-    * Retrieve the list of users of this enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/UserResource#UserResource-Retrievealistofusers"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/UserResource#UserResource-
-    *      Retrievealistofusers</a>
-    * @return List of users of this enterprise.
-    */
-   public Iterable<User> listUsers() {
-      PagedIterable<UserDto> dto = context.getApi().getEnterpriseApi().listUsers(target);
-      return wrap(context, User.class, dto.concat());
-   }
-
-   /**
-    * Retrieve the list of users of this enterprise, allowing pagination
-    * 
-    * @param options
-    *           User options
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/UserResource#UserResource-Retrievealistofusers"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/UserResource#UserResource-
-    *      Retrievealistofusers</a>
-    * @return List of users of this enterprise, according to the specified
-    *         pagination options
-    */
-   public Iterable<User> listUsers(final UserOptions options) {
-      PaginatedCollection<UserDto, UsersDto> dto = context.getApi().getEnterpriseApi().listUsers(target, options);
-      return wrap(context, User.class, dto.toPagedIterable().concat());
-   }
-
-   /**
-    * Retrieve a single user.
-    * 
-    * @param id
-    *           Unique ID of the user in this enterprise.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/UserResource#UserResource-Retrieveauser"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/UserResource#UserResource-
-    *      Retrieveauser</a>
-    * @return User with the given id or <code>null</code> if it does not exist.
-    */
-   public User getUser(final Integer id) {
-      UserDto user = context.getApi().getEnterpriseApi().getUser(target, id);
-      return wrap(context, User.class, user);
-   }
-
-   /**
-    * Retrieve the list of roles defined by this enterprise.
-    * 
-    * @return List of roles by this enterprise.
-    */
-   public Iterable<Role> listRoles() {
-      RolesDto dto = context.getApi().getAdminApi().listRoles(target);
-      return wrap(context, Role.class, dto.getCollection());
-   }
-
-   public Iterable<VirtualMachineTemplate> listTemplatesInRepository(final Datacenter datacenter) {
-      PagedIterable<VirtualMachineTemplateDto> templates = context.getApi().getVirtualMachineTemplateApi()
-            .listVirtualMachineTemplates(target.getId(), datacenter.getId());
-      return wrap(context, VirtualMachineTemplate.class, templates.concat());
-   }
-
-   public VirtualMachineTemplate getTemplateInRepository(final Datacenter datacenter, final Integer id) {
-      VirtualMachineTemplateDto template = context.getApi().getVirtualMachineTemplateApi()
-            .getVirtualMachineTemplate(target.getId(), datacenter.getId(), id);
-      return wrap(context, VirtualMachineTemplate.class, template);
-   }
-
-   public Iterable<VirtualMachineTemplate> listTemplates() {
-      ListVirtualMachineTemplates strategy = context.utils().injector().getInstance(ListVirtualMachineTemplates.class);
-      return strategy.execute(this);
-   }
-
-   public Iterable<Datacenter> listAllowedDatacenters() {
-      DatacentersDto datacenters = context.getApi().getEnterpriseApi().listAllowedDatacenters(target.getId());
-      return wrap(context, Datacenter.class, datacenters.getCollection());
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Enterprise+Resource#EnterpriseResource-Getthelistofexternalnetworks"
-    *      > http://community.abiquo.com/display/ABI20/Enterprise+Resource#
-    *      EnterpriseResource- Getthelistofexternalnetworks</a>
-    */
-   public Iterable<ExternalNetwork> listExternalNetworks(final Datacenter datacenter) {
-      DatacenterLimitsDto limitForDatacenter = getLimits(datacenter);
-
-      HttpResponse response = context.getApi().get(limitForDatacenter.searchLink("externalnetworks"));
-
-      ParseXMLWithJAXB<VLANNetworksDto> parser = new ParseXMLWithJAXB<VLANNetworksDto>(context.utils().xml(),
-            TypeLiteral.get(VLANNetworksDto.class));
-
-      return wrap(context, ExternalNetwork.class, parser.apply(response).getCollection());
-   }
-
-   public Iterable<UnmanagedNetwork> listUnmanagedNetworks(final Datacenter datacenter) {
-      DatacenterLimitsDto limitForDatacenter = getLimits(datacenter);
-
-      // The "rel" for the unmanaged networks is the same than the one used for
-      // external networks
-      HttpResponse response = context.getApi().get(limitForDatacenter.searchLink("externalnetworks"));
-
-      ParseXMLWithJAXB<VLANNetworksDto> parser = new ParseXMLWithJAXB<VLANNetworksDto>(context.utils().xml(),
-            TypeLiteral.get(VLANNetworksDto.class));
-
-      return wrap(context, UnmanagedNetwork.class, parser.apply(response).getCollection());
-   }
-
-   /**
-    * Retrieve the list of virtual appliances by this enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/EnterpriseResource#EnterpriseResource-RetrievethelistofvirtualappliancesbyanEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/EnterpriseResource#
-    *      EnterpriseResource-
-    *      RetrievethelistofvirtualappliancesbyanEnterprise</a>
-    * @return List of virtual appliances by this enterprise.
-    */
-   public Iterable<VirtualAppliance> listVirtualAppliances() {
-      VirtualAppliancesDto virtualAppliances = context.getApi().getEnterpriseApi().listVirtualAppliances(target);
-      return wrap(context, VirtualAppliance.class, virtualAppliances.getCollection());
-   }
-
-   /**
-    * Retrieve the list of virtual machines by this enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/EnterpriseResource#EnterpriseResource-RetrievealistofvirtualmachinesbyanEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/EnterpriseResource#
-    *      EnterpriseResource- RetrievealistofvirtualmachinesbyanEnterprise</a>
-    * @return List of virtual machines by this enterprise.
-    */
-   public Iterable<VirtualMachine> listVirtualMachines() {
-      VirtualMachinesWithNodeExtendedDto machines = context.getApi().getEnterpriseApi().listVirtualMachines(target);
-      return wrap(context, VirtualMachine.class, machines.getCollection());
-   }
-
-   public Iterable<Machine> listReservedMachines() {
-      MachinesDto machines = context.getApi().getEnterpriseApi().listReservedMachines(target);
-      return wrap(context, Machine.class, machines.getCollection());
-   }
-
-   // Actions
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Datacenter+Repository+Resource#DatacenterRepositoryResource-SynchronizetheDatacenterRepositorywiththerepository"
-    *      > http://community.abiquo.com/display/ABI20/Datacenter+Repository+
-    *      Resource# DatacenterRepositoryResource-
-    *      SynchronizetheDatacenterRepositorywiththerepository</a>
-    */
-   public void refreshTemplateRepository(final Datacenter datacenter) {
-      context.getApi().getEnterpriseApi().refreshTemplateRepository(target.getId(), datacenter.getId());
-   }
-
-   /**
-    * Allows the given datacenter to be used by this enterprise. Creates a
-    * {@link Limits} object if not exists.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @return Default datacenter limits of the enterprise for the given
-    *         datacenter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Datacenter+Limits+Resource#DatacenterLimitsResource-CreateanewLimitforanenterpriseinadatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Datacenter+Limits+
-    *      Resource#
-    *      DatacenterLimitsResource-CreateanewLimitforanenterpriseinadatacenter
-    *      </a>
-    */
-   public Limits allowDatacenter(final Datacenter datacenter) {
-      DatacenterLimitsDto dto;
-
-      try {
-         // Create new limits
-         Limits limits = Limits.builder(context, datacenter).build();
-
-         // Save new limits
-         dto = context.getApi().getEnterpriseApi().createLimits(target, datacenter.unwrap(), limits.unwrap());
-      } catch (AbiquoException ex) {
-         // Controlled error to allow duplicated authorizations
-         if (ex.hasError("LIMIT-7")) {
-            DatacentersLimitsDto limits = context.getApi().getEnterpriseApi().getLimits(target, datacenter.unwrap());
-            // Should be only one limit
-            dto = limits.getCollection().get(0);
-         } else {
-            throw ex;
-         }
-      }
-
-      return wrap(context, Limits.class, dto);
-   }
-
-   /**
-    * Prohibit the given datacenter to be used by this enterprise. Deletes a
-    * {@link Limits} object.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @return Default datacenter limits of the enterprise for the given
-    *         datacenter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Datacenter+Limits+Resource#DatacenterLimitsResource-Deleteanexistinglimitforanenterpriseinadatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Datacenter+Limits+
-    *      Resource# DatacenterLimitsResource-
-    *      Deleteanexistinglimitforanenterpriseinadatacenter</a>
-    */
-   public void prohibitDatacenter(final Datacenter datacenter) {
-      // Get limits
-      DatacentersLimitsDto dto = context.getApi().getEnterpriseApi().getLimits(target, datacenter.unwrap());
-
-      // Delete limits (if any)
-      if (dto != null && !dto.isEmpty()) {
-         // Should be only one limit
-         context.getApi().getEnterpriseApi().deleteLimits(dto.getCollection().get(0));
-      }
-   }
-
-   /**
-    * Disables chef in the enterprise.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Enterprise+Resource#EnterpriseResource-DisableChefinanexistingEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/Enterprise+Resource#
-    *      EnterpriseResource- DisableChefinanexistingEnterprise</a>
-    */
-   public void disableChef() {
-      target.setChefClient(null);
-      target.setChefClientCertificate(null);
-      target.setChefURL(null);
-      target.setChefValidator(null);
-      target.setChefValidatorCertificate(null);
-      update();
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context) {
-      return new Builder(context);
-   }
-
-   public static class Builder extends LimitsBuilder<Builder> {
-      private ApiContext<AbiquoApi> context;
-
-      private String name;
-
-      protected Long repositorySoft = Long.valueOf(DEFAULT_LIMITS);
-
-      protected Long repositoryHard = Long.valueOf(DEFAULT_LIMITS);
-
-      private Boolean isReservationRestricted = DEFAULT_RESERVATION_RESTRICTED;
-
-      private String chefURL;
-
-      private String chefClient;
-
-      private String chefValidator;
-
-      private String chefApiCertificate;
-
-      private String chefValidatorCertificate;
-
-      public Builder(final ApiContext<AbiquoApi> context) {
-         super();
-         this.context = context;
-      }
-
-      public Builder isReservationRestricted(final boolean isReservationRestricted) {
-         this.isReservationRestricted = isReservationRestricted;
-         return this;
-      }
-
-      public Builder chefURL(final String chefURL) {
-         this.chefURL = chefURL;
-         return this;
-      }
-
-      public Builder chefClient(final String chefClient) {
-         this.chefClient = chefClient;
-         return this;
-      }
-
-      public Builder chefApiCertificate(final String chefApiCertificate) {
-         this.chefApiCertificate = chefApiCertificate;
-         return this;
-      }
-
-      public Builder chefValidator(final String chefValidator) {
-         this.chefValidator = chefValidator;
-         return this;
-      }
-
-      public Builder chefValidatorCertificate(final String chefValidatorCertificate) {
-         this.chefValidatorCertificate = chefValidatorCertificate;
-         return this;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder repositoryLimits(final long soft, final long hard) {
-         this.repositorySoft = soft;
-         this.repositoryHard = hard;
-         return this;
-      }
-
-      public Enterprise build() {
-         EnterpriseDto dto = new EnterpriseDto();
-         dto.setName(name);
-         dto.setRamLimitsInMb(ramSoftLimitInMb, ramHardLimitInMb);
-         dto.setCpuCountLimits(cpuCountSoftLimit, cpuCountHardLimit);
-         dto.setHdLimitsInMb(hdSoftLimitInMb, hdHardLimitInMb);
-         dto.setStorageLimits(storageSoft, storageHard);
-         dto.setVlansLimits(vlansSoft, vlansHard);
-         dto.setPublicIPLimits(publicIpsSoft, publicIpsHard);
-         dto.setRepositoryLimits(repositorySoft, repositoryHard);
-         dto.setIsReservationRestricted(isReservationRestricted);
-         dto.setChefClient(chefClient);
-         dto.setChefClientCertificate(chefApiCertificate);
-         dto.setChefURL(chefURL);
-         dto.setChefValidator(chefValidator);
-         dto.setChefValidatorCertificate(chefValidatorCertificate);
-
-         return new Enterprise(context, dto);
-      }
-
-      public static Builder fromEnterprise(final Enterprise in) {
-         return Enterprise.builder(in.context).name(in.getName())
-               .ramLimits(in.getRamSoftLimitInMb(), in.getRamHardLimitInMb())
-               .cpuCountLimits(in.getCpuCountSoftLimit(), in.getCpuCountHardLimit())
-               .hdLimitsInMb(in.getHdSoftLimitInBytes(), in.getHdHardLimitInBytes())
-               .storageLimits(in.getStorageSoft(), in.getStorageHard())
-               .vlansLimits(in.getVlansSoft(), in.getVlansHard())
-               .publicIpsLimits(in.getPublicIpsSoft(), in.getPublicIpsHard())
-               .repositoryLimits(in.getRepositorySoft(), in.getRepositoryHard())
-               .isReservationRestricted(in.getIsReservationRestricted()).chefClient(in.getChefClient())
-               .chefApiCertificate(in.getChefApiCertificate()).chefURL(in.getChefURL())
-               .chefValidator(in.getChefValidator()).chefValidatorCertificate(in.getChefValidatorCertificate());
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public boolean getIsReservationRestricted() {
-      return target.getIsReservationRestricted();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public long getRepositoryHard() {
-      return target.getRepositoryHard();
-   }
-
-   public long getRepositorySoft() {
-      return target.getRepositorySoft();
-   }
-
-   public void setIsReservationRestricted(final boolean isReservationRestricted) {
-      target.setIsReservationRestricted(isReservationRestricted);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public void setRepositoryHard(final long repositoryHard) {
-      target.setRepositoryHard(repositoryHard);
-   }
-
-   public void setRepositoryLimits(final long soft, final long hard) {
-      target.setRepositoryLimits(soft, hard);
-   }
-
-   public void setRepositorySoft(final long repositorySoft) {
-      target.setRepositorySoft(repositorySoft);
-   }
-
-   public String getChefClient() {
-      return target.getChefClient();
-   }
-
-   public String getChefApiCertificate() {
-      return target.getChefClientCertificate();
-   }
-
-   public String getChefURL() {
-      return target.getChefURL();
-   }
-
-   public String getChefValidator() {
-      return target.getChefValidator();
-   }
-
-   public String getChefValidatorCertificate() {
-      return target.getChefValidatorCertificate();
-   }
-
-   public void setChefClient(final String chefClient) {
-      target.setChefClient(chefClient);
-   }
-
-   public void setChefClientCertificate(final String chefClientCertificate) {
-      target.setChefClientCertificate(chefClientCertificate);
-   }
-
-   public void setChefURL(final String chefURL) {
-      target.setChefURL(chefURL);
-   }
-
-   public void setChefValidator(final String chefValidator) {
-      target.setChefValidator(chefValidator);
-   }
-
-   public void setChefValidatorCertificate(final String chefValidatorCertificate) {
-      target.setChefValidatorCertificate(chefValidatorCertificate);
-   }
-
-   @Override
-   public String toString() {
-      return "Enterprise [id=" + getId() + ", isReservationRestricted=" + getIsReservationRestricted() + ", name="
-            + getName() + "]";
-   }
-
-   private DatacenterLimitsDto getLimits(final Datacenter datacenter) {
-      DatacentersLimitsDto limits = context.getApi().getEnterpriseApi().listLimits(target);
-
-      return Iterables.find(limits.getCollection(), new Predicate<DatacenterLimitsDto>() {
-         @Override
-         public boolean apply(final DatacenterLimitsDto input) {
-            RESTLink datacenterLink = input.searchLink("datacenter");
-            return datacenterLink != null
-                  && datacenterLink.getHref().equals(datacenter.unwrap().getEditLink().getHref());
-         }
-      });
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/EnterpriseProperties.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/EnterpriseProperties.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/EnterpriseProperties.java
deleted file mode 100644
index 31c6e48..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/EnterpriseProperties.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import java.util.Map;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.enterprise.EnterprisePropertiesDto;
-
-/**
- * Adds high level functionality to {@link EnterprisePropertiesDto}.
- * 
- * @see API: <a href=
- *      "http://community.abiquo.com/display/ABI20/Enterprise+Properties+Resource"
- *      >
- *      http://community.abiquo.com/display/ABI20/Enterprise+Properties+Resource
- *      </a>
- */
-public class EnterpriseProperties extends DomainWrapper<EnterprisePropertiesDto> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected EnterpriseProperties(final ApiContext<AbiquoApi> context, final EnterprisePropertiesDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Enterprise+Properties+Resource#EnterprisePropertiesResource-UpdatesthepropertiesforanEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/Enterprise+Properties+
-    *      Resource#
-    *      EnterprisePropertiesResource-UpdatesthepropertiesforanEnterprise</a>
-    */
-   public void update() {
-      target = context.getApi().getEnterpriseApi().updateEnterpriseProperties(target);
-   }
-
-   // Parent access
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Enterprise+Resource#EnterpriseResource-RetrieveaEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/Enterprise+Resource#
-    *      EnterpriseResource- RetrieveaEnterprise</a>
-    */
-   public Enterprise getEnterprise() {
-      Integer enterpriseId = target.getIdFromLink(ParentLinkName.ENTERPRISE);
-      return wrap(context, Enterprise.class, context.getApi().getEnterpriseApi().getEnterprise(enterpriseId));
-   }
-
-   // Delegate methods
-   public Map<String, String> getProperties() {
-      return target.getProperties();
-   }
-
-   public void setProperties(final Map<String, String> properties) {
-      target.setProperties(properties);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Limits.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Limits.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Limits.java
deleted file mode 100644
index 083c513..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Limits.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWithLimitsWrapper;
-import org.jclouds.abiquo.domain.builder.LimitsBuilder;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.enterprise.DatacenterLimitsDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-
-/**
- * Adds high level functionality to {@link DatacenterLimitsDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/Datacenter+Limits+Resource"
- *      >
- *      http://community.abiquo.com/display/ABI20/Datacenter+Limits+Resource</a>
- */
-public class Limits extends DomainWithLimitsWrapper<DatacenterLimitsDto> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Limits(final ApiContext<AbiquoApi> context, final DatacenterLimitsDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Datacenter+Limits+Resource#DatacenterLimitsResource-UpdatesanexistingLimitforanenterpriseinadatacenter"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/Datacenter+Limits+Resource
-    *      #DatacenterLimitsResource
-    *      -UpdatesanexistingLimitforanenterpriseinadatacenter</a>
-    */
-   public void update() {
-      target = context.getApi().getEnterpriseApi().updateLimits(target);
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, Datacenter datacenter) {
-      return new Builder(context, datacenter);
-   }
-
-   public static class Builder extends LimitsBuilder<Builder> {
-      private ApiContext<AbiquoApi> context;
-
-      protected Long repositorySoft = Long.valueOf(DEFAULT_LIMITS);
-
-      protected Long repositoryHard = Long.valueOf(DEFAULT_LIMITS);
-
-      protected Datacenter datacenter;
-
-      public Builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-         this.context = checkNotNull(context, "missing context object");
-         this.datacenter = checkNotNull(datacenter, "missing datacenter object");
-      }
-
-      public Builder repositoryLimits(final long soft, final long hard) {
-         this.repositorySoft = soft;
-         this.repositoryHard = hard;
-         return this;
-      }
-
-      public Limits build() {
-         DatacenterLimitsDto dto = new DatacenterLimitsDto();
-         dto.setRamLimitsInMb(ramSoftLimitInMb, ramHardLimitInMb);
-         dto.setCpuCountLimits(cpuCountSoftLimit, cpuCountHardLimit);
-         dto.setHdLimitsInMb(hdSoftLimitInMb, hdHardLimitInMb);
-         dto.setStorageLimits(storageSoft, storageHard);
-         dto.setVlansLimits(vlansSoft, vlansHard);
-         dto.setPublicIPLimits(publicIpsSoft, publicIpsHard);
-         dto.setRepositoryHardLimitsInMb(repositoryHard);
-         dto.setRepositorySoftLimitsInMb(repositorySoft);
-
-         // Establish the relation with the physical datacenter
-         dto.addLink(new RESTLink(ParentLinkName.DATACENTER, checkNotNull(datacenter.unwrap().getEditLink(),
-                 "missing edit link").getHref()));
-
-         Limits limits = new Limits(context, dto);
-
-         return limits;
-      }
-
-      public static Builder fromEnterprise(final Limits in) {
-         return Limits.builder(in.context, in.getDatacenter())
-               .ramLimits(in.getRamSoftLimitInMb(), in.getRamHardLimitInMb())
-               .cpuCountLimits(in.getCpuCountSoftLimit(), in.getCpuCountHardLimit())
-               .hdLimitsInMb(in.getHdSoftLimitInBytes(), in.getHdHardLimitInBytes())
-               .storageLimits(in.getStorageSoft(), in.getStorageHard())
-               .vlansLimits(in.getVlansSoft(), in.getVlansHard())
-               .publicIpsLimits(in.getPublicIpsSoft(), in.getPublicIpsHard())
-               .repositoryLimits(in.getRepositorySoft(), in.getRepositoryHard());
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public long getRepositoryHard() {
-      return target.getRepositoryHardLimitsInMb();
-   }
-
-   public long getRepositorySoft() {
-      return target.getRepositorySoftLimitsInMb();
-   }
-
-   public void setRepositoryHard(final long repositoryHard) {
-      target.setRepositoryHardLimitsInMb(repositoryHard);
-   }
-
-   public void setRepositoryLimits(final long soft, final long hard) {
-      target.setRepositoryHardLimitsInMb(hard);
-      target.setRepositorySoftLimitsInMb(soft);
-   }
-
-   public void setRepositorySoft(final long repositorySoft) {
-      target.setRepositorySoftLimitsInMb(repositorySoft);
-   }
-
-   public Datacenter getDatacenter() {
-      Integer datacenterId = target.getIdFromLink(ParentLinkName.DATACENTER);
-      checkNotNull(datacenterId, ValidationErrors.MISSING_REQUIRED_LINK);
-      DatacenterDto dto = context.getApi().getInfrastructureApi().getDatacenter(datacenterId);
-      return wrap(context, Datacenter.class, dto);
-   }
-
-   @Override
-   public String toString() {
-      return "Limits [id=" + getId() + ", repositoryHard=" + getRepositoryHard() + ", repositorySoft="
-            + getRepositorySoft() + ", cpuCountHard=" + getCpuCountHardLimit() + ", cpuCountSoft="
-            + getCpuCountSoftLimit() + ", hdHardInBytes=" + getHdHardLimitInBytes() + ", hdSoftInBytes=" + getHdSoftLimitInBytes()
-            + ", publicIPsHard=" + getPublicIpsHard() + ", publicIpsSoft=" + getPublicIpsSoft() + ", ramHardInMB="
-            + getRamHardLimitInMb() + ", ramSoftInMB=" + getRamSoftLimitInMb() + ", storageHard=" + getStorageHard()
-            + ", storageSoft=" + getStorageSoft() + ", vlansHard=" + getVlansHard() + ", vlansSoft=" + getVlansSoft()
-            + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Role.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Role.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Role.java
deleted file mode 100644
index c1c4b22..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/Role.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.config.Privilege;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.enterprise.PrivilegesDto;
-import com.abiquo.server.core.enterprise.RoleDto;
-
-/**
- * Adds high level functionality to {@link RoleDto}.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/Roles+Resource">
- *      http://community.abiquo.com/display/ABI20/Roles+Resource</a>
- */
-public class Role extends DomainWrapper<RoleDto> {
-   /** Default active value of the user */
-   private static final boolean DEFAULT_BLOCKED = false;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Role(final ApiContext<AbiquoApi> context, final RoleDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Roles+Resource#RolesResource-DeleteanexistingRole"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/Roles+Resource#RolesResource
-    *      -DeleteanexistingRole </a>
-    */
-   public void delete() {
-      context.getApi().getAdminApi().deleteRole(target);
-      target = null;
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Roles+Resource#RolesResource-CreateanewRole"
-    *      > http
-    *      ://community.abiquo.com/display/ABI20/Roles+Resource#RolesResource
-    *      -CreateanewRole</a>
-    */
-   public void save() {
-      target = context.getApi().getAdminApi().createRole(target);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Roles+Resource#RolesResource-UpdateanexistingRole"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/Roles+Resource#RolesResource
-    *      -UpdateanexistingRole </a>
-    */
-   public void update() {
-      target = context.getApi().getAdminApi().updateRole(target);
-   }
-
-   public void setEnterprise(final Enterprise enterprise) {
-      checkNotNull(enterprise, ValidationErrors.NULL_RESOURCE + Enterprise.class);
-      checkNotNull(enterprise.getId(), ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + Enterprise.class);
-
-      RESTLink link = enterprise.unwrap().searchLink("edit");
-
-      checkNotNull(link, ValidationErrors.MISSING_REQUIRED_LINK);
-
-      target.addLink(new RESTLink("enterprise", link.getHref()));
-   }
-
-   public void setPrivileges(final List<Privilege> privileges) {
-      for (Privilege privilege : privileges) {
-         addPrivilege(privilege);
-      }
-   }
-
-   private void addPrivilege(final Privilege privilege) {
-      checkNotNull(privilege, ValidationErrors.NULL_RESOURCE + Privilege.class);
-      checkNotNull(privilege.getId(), ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + Privilege.class);
-
-      RESTLink link = privilege.unwrap().searchLink("self");
-
-      // rel would be "privilege" if the object is coming from a privilege list.
-      if (link == null) {
-         link = privilege.unwrap().searchLink("privilege");
-      }
-
-      checkNotNull(link, ValidationErrors.MISSING_REQUIRED_LINK);
-
-      target.addLink(new RESTLink("privilege" + privilege.getId(), link.getHref()));
-   }
-
-   // Children access
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Roles+Resource#RolesResource-RetrievealistofprivilegesfromaRole"
-    *      > http://community.abiquo.com/display/ABI20/Roles+Resource#
-    *      RolesResource- RetrievealistofprivilegesfromaRole</a>
-    */
-   public Iterable<Privilege> listPrivileges() {
-      PrivilegesDto dto = context.getApi().getAdminApi().listPrivileges(target);
-      return wrap(context, Privilege.class, dto.getCollection());
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context) {
-      return new Builder(context);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private String name;
-
-      private boolean blocked = DEFAULT_BLOCKED;
-
-      public Builder(final ApiContext<AbiquoApi> context) {
-         super();
-         this.context = context;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder blocked(final boolean blocked) {
-         this.blocked = blocked;
-         return this;
-      }
-
-      public Role build() {
-         RoleDto dto = new RoleDto();
-         dto.setName(name);
-         dto.setBlocked(blocked);
-         Role role = new Role(context, dto);
-
-         return role;
-      }
-
-      public static Builder fromRole(final Role in) {
-         return Role.builder(in.context).blocked(in.isBlocked()).name(in.getName());
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public boolean isBlocked() {
-      return target.isBlocked();
-   }
-
-   public void setBlocked(final boolean blocked) {
-      target.setBlocked(blocked);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   @Override
-   public String toString() {
-      return "Role [id=" + getId() + ", name=" + getName() + ", blocked=" + isBlocked() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/TemplateDefinitionList.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/TemplateDefinitionList.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/TemplateDefinitionList.java
deleted file mode 100644
index cf1ca3b..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/TemplateDefinitionList.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import static com.google.common.collect.Iterables.filter;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.am.model.TemplatesStateDto;
-import com.abiquo.server.core.appslibrary.TemplateDefinitionListDto;
-import com.google.common.base.Predicate;
-
-/**
- * Adds high level functionality to {@link TemplateDefinitionListDto}. A
- * Template Definition List provides a way to organize multiple Template
- * Definitions. A single Template Definition can be shared by many lists. Its
- * compatible with ovfindex.xml format.
- */
-public class TemplateDefinitionList extends DomainWrapper<TemplateDefinitionListDto> {
-   /** The enterprise where the list belongs. */
-   private Enterprise enterprise;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected TemplateDefinitionList(final ApiContext<AbiquoApi> context, final TemplateDefinitionListDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * Delete the template definition list. Deleting the list doesn't delete the
-    * containing Template Definitions.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/TemplateDefinitionListResource#TemplateDefinitionListResource-Deleteatemplatedefinitionlist"
-    *      > http://community.abiquo.com/display/ABI20/
-    *      TemplateDefinitionListResource#
-    *      TemplateDefinitionListResource-Deleteatemplatedefinitionlist</a>
-    */
-   public void delete() {
-      context.getApi().getEnterpriseApi().deleteTemplateDefinitionList(target);
-      target = null;
-   }
-
-   /**
-    * Create a template definition list. All the contained Template Definitions
-    * will also be created.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/TemplateDefinitionListResource#TemplateDefinitionListResource-Createatemplatedefinitionlist"
-    *      > http://community.abiquo.com/display/ABI20/
-    *      TemplateDefinitionListResource#
-    *      TemplateDefinitionListResource-Createatemplatedefinitionlistr</a>
-    */
-   public void save() {
-      target = context.getApi().getEnterpriseApi().createTemplateDefinitionList(enterprise.unwrap(), target);
-   }
-
-   /**
-    * Update a template definition list with the data from this template
-    * definition list.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/TemplateDefinitionListResource#TemplateDefinitionListResource-Modifyatemplatedefinitionlist"
-    *      > http://community.abiquo.com/display/ABI20/
-    *      TemplateDefinitionListResource#
-    *      TemplateDefinitionListResource-Modifyatemplatedefinitionlist</a>
-    */
-   public void update() {
-      target = context.getApi().getEnterpriseApi().updateTemplateDefinitionList(target);
-   }
-
-   // Children access
-
-   /**
-    * Retrieve the list of states of the templates in the template definition
-    * list in the repository of the given datacenter. Template Definition are
-    * available sources, but in order to create a Virtual Machine the Definition
-    * should be downloaded into the Datacenter Repository (NFS filesystem).
-    * 
-    * @param The
-    *           datacenter in which repository search.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/TemplateDefinitionListResource#TemplateDefinitionListResource-Retrievealistofthestatusofalltemplatestatuslist"
-    *      > http://community.abiquo.com/display/ABI20/
-    *      TemplateDefinitionListResource# TemplateDefinitionListResource-
-    *      Retrievealistofthestatusofalltemplatestatuslist</a>
-    */
-   public Iterable<TemplateState> listStatus(final Datacenter datacenter) {
-      TemplatesStateDto states = context.getApi().getEnterpriseApi()
-            .listTemplateListStatus(target, datacenter.unwrap());
-      return wrap(context, TemplateState.class, states.getCollection());
-   }
-
-   /**
-    * Retrieve a filtered list of states of the templates in the template
-    * definition list in the repository of the given datacenter. Template
-    * Definition are available sources, but in order to create a Virtual Machine
-    * the Definition should be downloaded into the Datacenter Repository (NFS
-    * filesystem).
-    * 
-    * @param filter
-    *           Filter to be applied to the list.
-    * @param The
-    *           datacenter in which repository search.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/TemplateDefinitionListResource#TemplateDefinitionListResource-Retrievealistofthestatusofalltemplatestatuslist"
-    *      > http://community.abiquo.com/display/ABI20/
-    *      TemplateDefinitionListResource# TemplateDefinitionListResource-
-    *      Retrievealistofthestatusofalltemplatestatuslist</a>
-    */
-   public Iterable<TemplateState> listStatus(final Predicate<TemplateState> filter, final Datacenter datacenter) {
-      return filter(listStatus(datacenter), filter);
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Enterprise enterprise) {
-      return new Builder(context, enterprise);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private Enterprise enterprise;
-
-      private String name;
-
-      private String url;
-
-      public Builder(final ApiContext<AbiquoApi> context, final Enterprise enterprise) {
-         super();
-         this.context = context;
-         this.enterprise = enterprise;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder url(final String url) {
-         this.url = url;
-         return this;
-      }
-
-      public TemplateDefinitionList build() {
-         TemplateDefinitionListDto dto = new TemplateDefinitionListDto();
-         dto.setName(name);
-         dto.setUrl(url);
-
-         TemplateDefinitionList templateList = new TemplateDefinitionList(context, dto);
-         templateList.enterprise = enterprise;
-         return templateList;
-
-      }
-
-      public static Builder fromTemplateDefinitionList(final TemplateDefinitionList in) {
-         return TemplateDefinitionList.builder(in.context, in.enterprise).name(in.getName()).url(in.getUrl());
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getUrl() {
-      return target.getUrl();
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public void setUrl(final String url) {
-      target.setUrl(url);
-   }
-
-   @Override
-   public String toString() {
-      return "TemplateDefinitionList [getId()=" + getId() + ", getName()=" + getName() + ", getUrl()=" + getUrl() + "]";
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/TemplateState.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/TemplateState.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/TemplateState.java
deleted file mode 100644
index 0bf35d2..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/TemplateState.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.am.model.TemplateStateDto;
-import com.abiquo.am.model.TemplateStatusEnumType;
-
-/**
- * Adds high level functionality to {@link TemplateStateDto}.
- */
-public class TemplateState extends DomainWrapper<TemplateStateDto> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected TemplateState(final ApiContext<AbiquoApi> context, final TemplateStateDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   public Double getDownloadingProgress() {
-      return target.getDownloadingProgress();
-   }
-
-   public String getErrorCause() {
-      return target.getErrorCause();
-   }
-
-   public String getMasterOvf() {
-      return target.getMasterOvf();
-   }
-
-   public String getOvfId() {
-      return target.getOvfId();
-   }
-
-   public TemplateStatusEnumType getStatus() {
-      return target.getStatus();
-   }
-
-   @Override
-   public String toString() {
-      return "TemplateState [getDownloadingProgress()=" + getDownloadingProgress() + ", getErrorCause()="
-            + getErrorCause() + ", getMasterOvf()=" + getMasterOvf() + ", getOvfId()=" + getOvfId() + ", getStatus()="
-            + getStatus() + "]";
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/User.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/User.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/User.java
deleted file mode 100644
index 2dd1130..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/User.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.abiquo.strategy.cloud.ListVirtualDatacenters;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.RoleDto;
-import com.abiquo.server.core.enterprise.UserDto;
-import com.google.common.base.Joiner;
-import com.google.common.collect.Lists;
-
-/**
- * Adds high level functionality to {@link UserDto}.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/Users+Resource">
- *      http://community.abiquo.com/display/ABI20/Users+Resource</a>
- */
-public class User extends DomainWrapper<UserDto> {
-   /** Default active value of the user */
-   private static final boolean DEFAULT_ACTIVE = true;
-
-   /** The default authentication type. */
-   private static final String DEFAULT_AUTH_TYPE = "ABIQUO";
-
-   /** The default locale for the user. */
-   private static final String DEFAULT_LOCALE = "en_US";
-
-   /** The enterprise where the user belongs. */
-   private Enterprise enterprise;
-
-   /** Role of the user. */
-   private Role role;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected User(final ApiContext<AbiquoApi> context, final UserDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/User+resource#Userresource-Deleteanexistinguser"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/User+resource#Userresource
-    *      -Deleteanexistinguser </a>
-    */
-   public void delete() {
-      context.getApi().getEnterpriseApi().deleteUser(target);
-      target = null;
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/User+resource#Userresource-Createanewuser"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/User+resource#Userresource
-    *      -Createanewuser</a>
-    */
-   public void save() {
-      // set role link
-      target.addLink(new RESTLink("role", role.unwrap().getEditLink().getHref()));
-      target = context.getApi().getEnterpriseApi().createUser(enterprise.unwrap(), target);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/User+resource#Userresource-Updatesanexistinguser"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/User+resource#Userresource
-    *      -Updatesanexistinguser </a>
-    */
-   public void update() {
-      // update role link (if exists)
-      if (role != null) {
-         target.searchLink("role").setHref(role.unwrap().getEditLink().getHref());
-      }
-
-      target = context.getApi().getEnterpriseApi().updateUser(target);
-   }
-
-   public Iterable<VirtualDatacenter> listPermittedVirtualDatacenters() {
-      List<Integer> ids = extractAvailableDatacenters();
-
-      // null value means all virtual datacenters all allowed
-      if (ids.size() == 0) {
-         return this.getEnterprise().listVirtualDatacenters();
-      }
-
-      ListVirtualDatacenters listVirtualDatacenters = context.utils().injector()
-            .getInstance(ListVirtualDatacenters.class);
-      return listVirtualDatacenters.execute(ids);
-   }
-
-   /**
-    * Give access to all virtualdatacenters in the enterprise (requires update).
-    */
-   public void permitAllVirtualDatacenters() {
-      setAvailableVirtualDatacenters(null);
-   }
-
-   /**
-    * Limits user access ONLY to the virtual datacenters in the list. If the
-    * list is empty, user will get access to all virtual datacenters.
-    * 
-    * @param vdc
-    *           List of virtual datacenters from the user's enterprise.
-    */
-   public void setPermittedVirtualDatacenters(final List<VirtualDatacenter> vdcs) {
-      List<Integer> ids = Lists.newArrayList();
-
-      for (VirtualDatacenter vdc : vdcs) {
-         checkNotNull(vdc.getId(), ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + VirtualDatacenter.class);
-         ids.add(vdc.getId());
-      }
-
-      setAvailableVirtualDatacenters(ids);
-   }
-
-   // Parent access
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Enterprise+Resource#EnterpriseResource-RetrieveaEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/Enterprise+Resource#
-    *      EnterpriseResource- RetrieveaEnterprise</a>
-    */
-   public Enterprise getEnterprise() {
-      Integer enterpriseId = target.getIdFromLink(ParentLinkName.ENTERPRISE);
-      return wrap(context, Enterprise.class, context.getApi().getEnterpriseApi().getEnterprise(enterpriseId));
-   }
-
-   // Children access
-
-   public Role getRole() {
-      RoleDto role = context.getApi().getAdminApi().getRole(target);
-      return wrap(context, Role.class, role);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/User+resource#Userresource-Retrievethelistofvirtualmachinesbyuser"
-    *      > http://community.abiquo.com/display/ABI20/User+resource#
-    *      Userresource- Retrievethelistofvirtualmachinesbyuser</a>
-    */
-   public Iterable<VirtualMachine> listMachines() {
-      VirtualMachinesWithNodeExtendedDto machines = context.getApi().getEnterpriseApi().listVirtualMachines(target);
-      return wrap(context, VirtualMachine.class, machines.getCollection());
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Enterprise enterprise, final Role role) {
-      return new Builder(context, enterprise, role);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private Enterprise enterprise;
-
-      private Role role;
-
-      private String name;
-
-      private String nick;
-
-      private String locale = DEFAULT_LOCALE;
-
-      private String password;
-
-      private String surname;
-
-      private boolean active = DEFAULT_ACTIVE;
-
-      private String email;
-
-      private String description;
-
-      private String authType = DEFAULT_AUTH_TYPE;
-
-      public Builder(final ApiContext<AbiquoApi> context, final Enterprise enterprise, final Role role) {
-         super();
-         checkNotNull(enterprise, ValidationErrors.NULL_RESOURCE + Enterprise.class);
-         checkNotNull(role, ValidationErrors.NULL_RESOURCE + Role.class);
-         this.context = context;
-         this.enterprise = enterprise;
-         this.role = role;
-      }
-
-      public Builder enterprise(final Enterprise enterprise) {
-         checkNotNull(enterprise, ValidationErrors.NULL_RESOURCE + Enterprise.class);
-         this.enterprise = enterprise;
-         return this;
-      }
-
-      public Builder role(final Role role) {
-         this.role = role;
-         return this;
-      }
-
-      public Builder name(final String name, final String surname) {
-         this.name = name;
-         this.surname = surname;
-         return this;
-      }
-
-      public Builder nick(final String nick) {
-         this.nick = nick;
-         return this;
-      }
-
-      public Builder locale(final String locale) {
-         this.locale = locale;
-         return this;
-      }
-
-      public Builder password(final String password) {
-         this.password = password;
-         return this;
-      }
-
-      public Builder active(final boolean active) {
-         this.active = active;
-         return this;
-      }
-
-      public Builder email(final String email) {
-         this.email = email;
-         return this;
-      }
-
-      public Builder description(final String description) {
-         this.description = description;
-         return this;
-      }
-
-      public Builder authType(final String authType) {
-         this.authType = authType;
-         return this;
-      }
-
-      public User build() {
-         UserDto dto = new UserDto();
-         dto.setActive(active);
-         dto.setAuthType(authType);
-         dto.setDescription(description);
-         dto.setEmail(email);
-         dto.setLocale(locale);
-         dto.setName(name);
-         dto.setNick(nick);
-         dto.setPassword(password);
-         dto.setSurname(surname);
-         User user = new User(context, dto);
-         user.enterprise = enterprise;
-         user.role = role;
-
-         return user;
-      }
-
-      public static Builder fromUser(final User in) {
-         return User.builder(in.context, in.enterprise, in.role).active(in.isActive()).authType(in.getAuthType())
-               .description(in.getDescription()).email(in.getEmail()).locale(in.getLocale())
-               .name(in.getName(), in.getSurname()).nick(in.getNick()).password(in.getPassword());
-      }
-   }
-
-   // Delegate methods
-
-   public String getAuthType() {
-      return target.getAuthType();
-   }
-
-   public String getDescription() {
-      return target.getDescription();
-   }
-
-   public String getEmail() {
-      return target.getEmail();
-   }
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getLocale() {
-      return target.getLocale();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getNick() {
-      return target.getNick();
-   }
-
-   public String getPassword() {
-      return target.getPassword();
-   }
-
-   public String getSurname() {
-      return target.getSurname();
-   }
-
-   public boolean isActive() {
-      return target.isActive();
-   }
-
-   public void setActive(final boolean active) {
-      target.setActive(active);
-   }
-
-   public void setAuthType(final String authType) {
-      target.setAuthType(authType);
-   }
-
-   public void setDescription(final String description) {
-      target.setDescription(description);
-   }
-
-   public void setEmail(final String email) {
-      target.setEmail(email);
-   }
-
-   public void setLocale(final String locale) {
-      target.setLocale(locale);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public void setNick(final String nick) {
-      target.setNick(nick);
-   }
-
-   public void setPassword(final String password) {
-      target.setPassword(password);
-   }
-
-   public void setSurname(final String surname) {
-      target.setSurname(surname);
-   }
-
-   public void setRole(final Role role) {
-      this.role = role;
-   }
-
-   // Aux operations
-
-   /**
-    * Converts the tokenized String of available virtual datacenters provided in
-    * the userDto to a list of ids.
-    */
-   private List<Integer> extractAvailableDatacenters() {
-      List<Integer> ids = Lists.newArrayList();
-
-      if (target.getAvailableVirtualDatacenters() != null) {
-
-         StringTokenizer st = new StringTokenizer(target.getAvailableVirtualDatacenters(), ",");
-
-         while (st.hasMoreTokens()) {
-            ids.add(Integer.parseInt(st.nextToken()));
-         }
-      }
-
-      return ids;
-   }
-
-   private void setAvailableVirtualDatacenters(final List<Integer> ids) {
-      if (ids == null || ids.size() == 0) {
-         target.setAvailableVirtualDatacenters("");
-      } else {
-         Joiner joiner = Joiner.on(",").skipNulls();
-         target.setAvailableVirtualDatacenters(joiner.join(ids));
-      }
-   }
-
-   @Override
-   public String toString() {
-      return "User [id=" + getId() + ", role=" + getRole() + ", authType=" + getAuthType() + ", description="
-            + getDescription() + ", email=" + getEmail() + ", locale=" + getLocale() + ", name=" + getName()
-            + ", nick=" + getNick() + ", password=" + getPassword() + ", surname=" + getSurname() + ", active="
-            + isActive() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/options/EnterpriseOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/options/EnterpriseOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/options/EnterpriseOptions.java
deleted file mode 100644
index 858c662..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/options/EnterpriseOptions.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise.options;
-
-import org.jclouds.abiquo.domain.options.FilterOptions.BaseFilterOptionsBuilder;
-import org.jclouds.http.options.BaseHttpRequestOptions;
-import org.jclouds.rest.annotations.SinceApiVersion;
-
-/**
- * Available options to query enterprises.
- */
-public class EnterpriseOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      EnterpriseOptions options = new EnterpriseOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder extends BaseFilterOptionsBuilder<Builder> {
-      private String idPricingTemplate;
-
-      private String idScope;
-
-      private Boolean included;
-
-      public Builder pricingTemplate(final String idPricingTemplate) {
-         this.idPricingTemplate = idPricingTemplate;
-         return this;
-      }
-
-      @SinceApiVersion("2.3")
-      public Builder scope(final String scope) {
-         this.idScope = scope;
-         return this;
-      }
-
-      public Builder included(final boolean included) {
-         this.included = included;
-         return this;
-      }
-
-      public EnterpriseOptions build() {
-         EnterpriseOptions options = new EnterpriseOptions();
-
-         if (idPricingTemplate != null) {
-            options.queryParameters.put("idPricingTemplate", String.valueOf(idPricingTemplate));
-         }
-
-         if (idScope != null) {
-            options.queryParameters.put("idScope", String.valueOf(idScope));
-         }
-
-         if (included != null) {
-            options.queryParameters.put("included", String.valueOf(included));
-         }
-
-         return addFilterOptions(options);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/options/UserOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/options/UserOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/options/UserOptions.java
deleted file mode 100644
index 1e07210..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/enterprise/options/UserOptions.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise.options;
-
-import org.jclouds.abiquo.domain.options.FilterOptions.BaseFilterOptionsBuilder;
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query users.
- */
-public class UserOptions extends BaseHttpRequestOptions implements Cloneable {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      UserOptions options = new UserOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder extends BaseFilterOptionsBuilder<Builder> {
-
-      private final UserOptions options = new UserOptions();
-
-      public Builder page(int page) {
-         this.options.queryParameters.put("page", String.valueOf(page));
-         return this;
-      }
-
-      @Override
-      public Builder limit(int limit) {
-         this.options.queryParameters.put("numResults", String.valueOf(limit));
-         return this;
-      }
-
-      public UserOptions build() {
-         return addFilterOptions(this.options);
-      }
-   }
-}


[14/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/auth/GetTokenFromApi.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/auth/GetTokenFromApi.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/auth/GetTokenFromApi.java
index a3ac09d..f38f0b3 100644
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/auth/GetTokenFromApi.java
+++ b/abiquo/src/main/java/org/jclouds/abiquo/functions/auth/GetTokenFromApi.java
@@ -17,20 +17,20 @@
 package org.jclouds.abiquo.functions.auth;
 
 import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.transform;
 import static com.google.common.collect.Iterables.tryFind;
 import static com.google.common.net.HttpHeaders.AUTHORIZATION;
 import static org.jclouds.abiquo.config.AbiquoAuthenticationModule.AUTH_TOKEN_NAME;
 import static org.jclouds.http.filters.BasicAuthentication.basic;
 
+import java.net.HttpCookie;
 import java.net.URI;
 import java.util.Collection;
+import java.util.List;
 
 import javax.annotation.Resource;
 import javax.inject.Inject;
 import javax.inject.Named;
 import javax.inject.Singleton;
-import javax.ws.rs.core.Cookie;
 
 import org.jclouds.abiquo.config.AbiquoProperties;
 import org.jclouds.domain.Credentials;
@@ -64,13 +64,13 @@ public class GetTokenFromApi implements Function<Credentials, String> {
    protected Logger logger = Logger.NULL;
 
    @Inject
-   public GetTokenFromApi(ProviderMetadata provider, HttpClient http) {
+   GetTokenFromApi(final ProviderMetadata provider, final HttpClient http) {
       this.provider = checkNotNull(provider, "provider must not be null");
       this.http = checkNotNull(http, "http must not be null");
    }
 
    @Override
-   public String apply(Credentials input) {
+   public String apply(final Credentials input) {
       logger.info(">> Requesting an authentication token for user: %s...", input.identity);
 
       HttpResponse response = http.invoke(HttpRequest.builder() //
@@ -79,7 +79,7 @@ public class GetTokenFromApi implements Function<Credentials, String> {
             .addHeader(AUTHORIZATION, basic(input.identity, input.credential)) //
             .build());
 
-      Optional<Cookie> token = readAuthenticationToken(response);
+      Optional<HttpCookie> token = readAuthenticationToken(response);
       if (!token.isPresent()) {
          throw new AuthorizationException("Could not obtain a new authentication token");
       }
@@ -88,24 +88,18 @@ public class GetTokenFromApi implements Function<Credentials, String> {
    }
 
    @VisibleForTesting
-   static Optional<Cookie> readAuthenticationToken(final HttpResponse response) {
-      Collection<String> cookies = response.getHeaders().get(HttpHeaders.SET_COOKIE);
-      return tryFind(transform(cookies, cookie()), new Predicate<Cookie>() {
-         @Override
-         public boolean apply(Cookie input) {
-            return input.getName().equals(AUTH_TOKEN_NAME);
-         }
-      });
-
-   }
+   static Optional<HttpCookie> readAuthenticationToken(final HttpResponse response) {
+      Collection<String> headers = response.getHeaders().get(HttpHeaders.SET_COOKIE);
+      for (String header : headers) {
+         List<HttpCookie> cookies = HttpCookie.parse(header);
+         return tryFind(cookies, new Predicate<HttpCookie>() {
+            @Override
+            public boolean apply(final HttpCookie input) {
+               return input.getName().equals(AUTH_TOKEN_NAME);
+            }
+         });
+      }
 
-   private static Function<String, Cookie> cookie() {
-      return new Function<String, Cookie>() {
-         @Override
-         public Cookie apply(String input) {
-            return Cookie.valueOf(input);
-         }
-      };
+      return Optional.absent();
    }
-
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/enterprise/ParseEnterpriseId.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/enterprise/ParseEnterpriseId.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/enterprise/ParseEnterpriseId.java
deleted file mode 100644
index 98ca896..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/enterprise/ParseEnterpriseId.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.enterprise;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Singleton;
-
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.google.common.base.Function;
-
-/**
- * Parses a {@link EnterpriseDto} object to extract its id.
- */
-@Singleton
-public class ParseEnterpriseId implements Function<Object, String> {
-   @Override
-   public String apply(final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof EnterpriseDto,
-            "This parser is only valid for EnterpriseDto objects");
-
-      return ((EnterpriseDto) input).getId().toString();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseDatacenterId.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseDatacenterId.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseDatacenterId.java
deleted file mode 100644
index 2c97eb3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseDatacenterId.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.infrastructure;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Singleton;
-
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.google.common.base.Function;
-
-/**
- * Parses a {@link DatacenterDto} object to extract its id.
- */
-@Singleton
-public class ParseDatacenterId implements Function<Object, String> {
-   @Override
-   public String apply(final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof DatacenterDto,
-            "This parser is only valid for DatacenterDto objects");
-
-      return ((DatacenterDto) input).getId().toString();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseMachineId.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseMachineId.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseMachineId.java
deleted file mode 100644
index 1bf0e47..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseMachineId.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.infrastructure;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Singleton;
-
-import com.abiquo.server.core.infrastructure.MachineDto;
-import com.google.common.base.Function;
-
-/**
- * Parses a {@link MachineDto} object to extract its id.
- */
-@Singleton
-public class ParseMachineId implements Function<Object, String> {
-   @Override
-   public String apply(final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof MachineDto,
-            "This parser is only valid for MachineDto objects");
-
-      return ((MachineDto) input).getId().toString();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseRemoteServiceType.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseRemoteServiceType.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseRemoteServiceType.java
deleted file mode 100644
index 5ba0ade..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/infrastructure/ParseRemoteServiceType.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.infrastructure;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Singleton;
-
-import com.abiquo.model.enumerator.RemoteServiceType;
-import com.google.common.base.Function;
-
-/**
- * Parses a {@link ParseRemoteServiceType} object to extract its type in the
- * format that the API expects it.
- */
-@Singleton
-public class ParseRemoteServiceType implements Function<Object, String> {
-   @Override
-   public String apply(final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof RemoteServiceType,
-            "This parser is only valid for RemoteServiceType objects");
-
-      return ((RemoteServiceType) input).name().replaceAll("_", "").toLowerCase();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/BasePaginationParser.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/BasePaginationParser.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/BasePaginationParser.java
deleted file mode 100644
index 0ee1b1e..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/BasePaginationParser.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.model.transport.WrapperDto;
-import com.google.common.base.Function;
-
-/**
- * Base class for all pagination response parsers.
- * <p>
- * Parses the response with the given parser, and wraps the results in a
- * {@link PaginatedCollection} so it can be properly iterated.
- * 
- * 
- * @see PaginatedCollection
- * @see PagedIterable
- */
-public abstract class BasePaginationParser<T, W extends WrapperDto<T>> implements
-      Function<HttpResponse, PaginatedCollection<T, W>> {
-   protected final AbiquoApi api;
-   protected final ParseXMLWithJAXB<W> parser;
-
-   public BasePaginationParser(AbiquoApi api, ParseXMLWithJAXB<W> parser) {
-      this.api = checkNotNull(api, "api must not be null");
-      this.parser = checkNotNull(parser, "parser must not be null");
-   }
-
-   @Override
-   public PaginatedCollection<T, W> apply(HttpResponse input) {
-      return new PaginatedCollection<T, W>(api, parser.apply(input), parser);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseEnterprises.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseEnterprises.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseEnterprises.java
deleted file mode 100644
index 2539420..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseEnterprises.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.enterprise.EnterprisesDto;
-
-/**
- * Parses a paginated enterprise list.
- */
-@Singleton
-public class ParseEnterprises extends BasePaginationParser<EnterpriseDto, EnterprisesDto> {
-   @Inject
-   public ParseEnterprises(AbiquoApi api, ParseXMLWithJAXB<EnterprisesDto> parser) {
-      super(api, parser);
-   }
-
-   @Singleton
-   public static class ToPagedIterable extends PaginatedCollection.ToPagedIterable<EnterpriseDto, EnterprisesDto> {
-      @Inject
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<EnterprisesDto> parser) {
-         super(api, parser);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseEvents.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseEvents.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseEvents.java
deleted file mode 100644
index 81f3a5f..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseEvents.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.server.core.event.EventDto;
-import com.abiquo.server.core.event.EventsDto;
-
-/**
- * Parses a paginated event list.
- */
-@Singleton
-public class ParseEvents extends BasePaginationParser<EventDto, EventsDto> {
-   @Inject
-   public ParseEvents(AbiquoApi api, ParseXMLWithJAXB<EventsDto> parser) {
-      super(api, parser);
-   }
-
-   @Singleton
-   public static class ToPagedIterable extends PaginatedCollection.ToPagedIterable<EventDto, EventsDto> {
-      @Inject
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<EventsDto> parser) {
-         super(api, parser);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseExternalIps.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseExternalIps.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseExternalIps.java
deleted file mode 100644
index b10a922..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseExternalIps.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.server.core.infrastructure.network.ExternalIpDto;
-import com.abiquo.server.core.infrastructure.network.ExternalIpsDto;
-
-/**
- * Parses a paginated external ip list.
- */
-@Singleton
-public class ParseExternalIps extends BasePaginationParser<ExternalIpDto, ExternalIpsDto> {
-   @Inject
-   public ParseExternalIps(AbiquoApi api, ParseXMLWithJAXB<ExternalIpsDto> parser) {
-      super(api, parser);
-   }
-
-   @Singleton
-   public static class ToPagedIterable extends PaginatedCollection.ToPagedIterable<ExternalIpDto, ExternalIpsDto> {
-      @Inject
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<ExternalIpsDto> parser) {
-         super(api, parser);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParsePrivateIps.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParsePrivateIps.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParsePrivateIps.java
deleted file mode 100644
index e10c9f0..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParsePrivateIps.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpsDto;
-
-/**
- * Parses a paginated private ip list.
- */
-@Singleton
-public class ParsePrivateIps extends BasePaginationParser<PrivateIpDto, PrivateIpsDto> {
-   @Inject
-   public ParsePrivateIps(AbiquoApi api, ParseXMLWithJAXB<PrivateIpsDto> parser) {
-      super(api, parser);
-   }
-
-   @Singleton
-   public static class ToPagedIterable extends PaginatedCollection.ToPagedIterable<PrivateIpDto, PrivateIpsDto> {
-      @Inject
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<PrivateIpsDto> parser) {
-         super(api, parser);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParsePublicIps.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParsePublicIps.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParsePublicIps.java
deleted file mode 100644
index a3eb3b8..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParsePublicIps.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpsDto;
-
-/**
- * Parses a paginated public ip list.
- */
-@Singleton
-public class ParsePublicIps extends BasePaginationParser<PublicIpDto, PublicIpsDto> {
-   @Inject
-   public ParsePublicIps(AbiquoApi api, ParseXMLWithJAXB<PublicIpsDto> parser) {
-      super(api, parser);
-   }
-
-   @Singleton
-   public static class ToPagedIterable extends PaginatedCollection.ToPagedIterable<PublicIpDto, PublicIpsDto> {
-      @Inject
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<PublicIpsDto> parser) {
-         super(api, parser);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseUnmanagedIps.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseUnmanagedIps.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseUnmanagedIps.java
deleted file mode 100644
index 415d288..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseUnmanagedIps.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpsDto;
-
-/**
- * Parses a paginated unmnaged ip list.
- */
-@Singleton
-public class ParseUnmanagedIps extends BasePaginationParser<UnmanagedIpDto, UnmanagedIpsDto> {
-   @Inject
-   public ParseUnmanagedIps(AbiquoApi api, ParseXMLWithJAXB<UnmanagedIpsDto> parser) {
-      super(api, parser);
-   }
-
-   @Singleton
-   public static class ToPagedIterable extends PaginatedCollection.ToPagedIterable<UnmanagedIpDto, UnmanagedIpsDto> {
-      @Inject
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<UnmanagedIpsDto> parser) {
-         super(api, parser);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseUsers.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseUsers.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseUsers.java
deleted file mode 100644
index eba0031..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseUsers.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.collect.Iterables.getFirst;
-import static org.jclouds.http.utils.Queries.encodeQueryLine;
-import static org.jclouds.http.utils.Queries.queryParser;
-
-import java.net.URI;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.collect.IterableWithMarker;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.enterprise.UserDto;
-import com.abiquo.server.core.enterprise.UsersDto;
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.collect.Multimap;
-
-/**
- * Parses a paginated user list.
- */
-@Singleton
-public class ParseUsers extends BasePaginationParser<UserDto, UsersDto> {
-   @Inject
-   public ParseUsers(AbiquoApi api, ParseXMLWithJAXB<UsersDto> parser) {
-      super(api, parser);
-   }
-
-   // Return a custom class to bypass
-   // http://jira.abiquo.com/browse/ABICLOUDPREMIUM-5927
-   // Remove once the fix has been deployed to production
-   @Override
-   public PaginatedCollection<UserDto, UsersDto> apply(HttpResponse input) {
-      return new UserPaginatedCollection(api, parser.apply(input), parser);
-   }
-
-   @Singleton
-   public static class ToPagedIterable extends PaginatedCollection.ToPagedIterable<UserDto, UsersDto> {
-      @Inject
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<UsersDto> parser) {
-         super(api, parser);
-      }
-
-      // Overwrite to return a custom class and bypass
-      // http://jira.abiquo.com/browse/ABICLOUDPREMIUM-5927
-      // Remove once the fix has been deployed to production
-      @Override
-      protected Function<Object, IterableWithMarker<UserDto>> nextPage(PaginatedCollection<UserDto, UsersDto> input) {
-         return new Function<Object, IterableWithMarker<UserDto>>() {
-            @Override
-            public IterableWithMarker<UserDto> apply(Object marker) {
-               checkArgument(marker instanceof RESTLink, "Marker must be a RESTLink");
-               RESTLink next = RESTLink.class.cast(marker);
-
-               // The Abiquo API does not provide the media types in the
-               // pagination links, but it will be the same type than the
-               // current page, so just set it.
-               next.setType(UsersDto.BASE_MEDIA_TYPE);
-
-               UsersDto nextPage = parser.apply(api.get(next));
-               return new UserPaginatedCollection(api, nextPage, parser);
-            }
-         };
-      }
-   }
-
-   /**
-    * This class is used to bypass
-    * http://jira.abiquo.com/browse/ABICLOUDPREMIUM-5927
-    * <p>
-    * The issue has already been fixed but still not been deployed in
-    * production. Once that is done, this class should be removed.
-    * 
-    */
-   private static class UserPaginatedCollection extends PaginatedCollection<UserDto, UsersDto> {
-      public UserPaginatedCollection(AbiquoApi api, UsersDto delegate, ParseXMLWithJAXB<UsersDto> parser) {
-         super(api, delegate, parser);
-      }
-
-      @Override
-      public Optional<Object> nextMarker() {
-         Optional<Object> next = super.nextMarker();
-         // Pagination links are not consistent and a "next" link can be
-         // returned even if there are no more pages. Overwrite the
-         // default behavior to handle this, and to adapt the query
-         // parameters returned in the pagination links to what the api
-         // expects in the GET requests
-         if (next.isPresent()) {
-            checkArgument(next.get() instanceof RESTLink, "Marker must be a RESTLink");
-            RESTLink link = RESTLink.class.cast(next.get());
-
-            // Get the conflicting query parameters and remove them from the
-            // query parameter map
-            Multimap<String, String> params = queryParser().apply(URI.create(link.getHref()).getRawQuery());
-            String limit = getFirst(params.removeAll("limit"), null);
-            String startwith = getFirst(params.removeAll("startwith"), null);
-
-            // Next page links always have both query parameters. Otherwise
-            // assume there is no next page
-            if (limit != null && startwith != null) {
-               int resultsPerPage = Integer.parseInt(limit);
-               int totalResults = delegate.getTotalSize();
-               int pageNumber = Integer.parseInt(startwith) - resultsPerPage;
-
-               // Check if there is really a next page, and then return the
-               // marker with the appropriate values
-               if (totalResults / (double) resultsPerPage > pageNumber + 1) {
-                  params.put("numResults", limit);
-                  params.put("page", String.valueOf(pageNumber + 1));
-
-                  // Build the new URI stripping the existing query
-                  // parameters and using the new ones
-                  String uri = link.getHref().substring(0, link.getHref().indexOf('?') + 1);
-                  uri += encodeQueryLine(params);
-
-                  return Optional.<Object> of(new RESTLink(link.getRel(), uri));
-               }
-            }
-         }
-
-         return Optional.absent();
-      }
-
-      @Override
-      public PagedIterable<UserDto> toPagedIterable() {
-         return new ParseUsers.ToPagedIterable(api, parser).apply(this);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVirtualMachineTemplates.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVirtualMachineTemplates.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVirtualMachineTemplates.java
deleted file mode 100644
index 7663c3d..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVirtualMachineTemplates.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplatesDto;
-
-/**
- * Parses a paginated virtual machine template list.
- */
-@Singleton
-public class ParseVirtualMachineTemplates extends
-      BasePaginationParser<VirtualMachineTemplateDto, VirtualMachineTemplatesDto> {
-   @Inject
-   public ParseVirtualMachineTemplates(AbiquoApi api, ParseXMLWithJAXB<VirtualMachineTemplatesDto> parser) {
-      super(api, parser);
-   }
-
-   @Singleton
-   public static class ToPagedIterable extends
-         PaginatedCollection.ToPagedIterable<VirtualMachineTemplateDto, VirtualMachineTemplatesDto> {
-      @Inject
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<VirtualMachineTemplatesDto> parser) {
-         super(api, parser);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVirtualMachines.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVirtualMachines.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVirtualMachines.java
deleted file mode 100644
index 4041793..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVirtualMachines.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-
-/**
- * Parses a paginated virtual machine list.
- */
-@Singleton
-public class ParseVirtualMachines extends
-      BasePaginationParser<VirtualMachineWithNodeExtendedDto, VirtualMachinesWithNodeExtendedDto> {
-   @Inject
-   public ParseVirtualMachines(AbiquoApi api, ParseXMLWithJAXB<VirtualMachinesWithNodeExtendedDto> parser) {
-      super(api, parser);
-   }
-
-   @Singleton
-   public static class ToPagedIterable extends
-         PaginatedCollection.ToPagedIterable<VirtualMachineWithNodeExtendedDto, VirtualMachinesWithNodeExtendedDto> {
-      @Inject
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<VirtualMachinesWithNodeExtendedDto> parser) {
-         super(api, parser);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVolumes.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVolumes.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVolumes.java
deleted file mode 100644
index ea6bab6..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/pagination/ParseVolumes.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.pagination;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.abiquo.server.core.infrastructure.storage.VolumesManagementDto;
-
-/**
- * Parses a paginated volume list.
- */
-@Singleton
-public class ParseVolumes extends BasePaginationParser<VolumeManagementDto, VolumesManagementDto> {
-   @Inject
-   public ParseVolumes(AbiquoApi api, ParseXMLWithJAXB<VolumesManagementDto> parser) {
-      super(api, parser);
-   }
-
-   @Singleton
-   public static class ToPagedIterable extends
-         PaginatedCollection.ToPagedIterable<VolumeManagementDto, VolumesManagementDto> {
-      @Inject
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<VolumesManagementDto> parser) {
-         super(api, parser);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/handlers/AbiquoErrorHandler.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/handlers/AbiquoErrorHandler.java b/abiquo/src/main/java/org/jclouds/abiquo/handlers/AbiquoErrorHandler.java
index e82910e..da45966 100644
--- a/abiquo/src/main/java/org/jclouds/abiquo/handlers/AbiquoErrorHandler.java
+++ b/abiquo/src/main/java/org/jclouds/abiquo/handlers/AbiquoErrorHandler.java
@@ -16,14 +16,10 @@
  */
 package org.jclouds.abiquo.handlers;
 
-import static javax.ws.rs.core.Response.Status.fromStatusCode;
 import static org.jclouds.util.Closeables2.closeQuietly;
 
-import javax.inject.Inject;
 import javax.inject.Singleton;
 
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.functions.ParseErrors;
 import org.jclouds.http.HttpCommand;
 import org.jclouds.http.HttpErrorHandler;
 import org.jclouds.http.HttpResponse;
@@ -31,21 +27,11 @@ import org.jclouds.http.HttpResponseException;
 import org.jclouds.rest.AuthorizationException;
 import org.jclouds.rest.ResourceNotFoundException;
 
-import com.abiquo.model.transport.error.ErrorsDto;
-
 /**
  * Parse Abiquo API errors and set the appropriate exception.
  */
 @Singleton
 public class AbiquoErrorHandler implements HttpErrorHandler {
-   /** The error parser. */
-   private ParseErrors errorParser;
-
-   @Inject
-   AbiquoErrorHandler(final ParseErrors errorParser) {
-      super();
-      this.errorParser = errorParser;
-   }
 
    @Override
    public void handleError(final HttpCommand command, final HttpResponse response) {
@@ -58,23 +44,25 @@ public class AbiquoErrorHandler implements HttpErrorHandler {
             case 401:
             case 403:
                // Authorization exceptions do not return an errors DTO, so we
-               // encapsulate a
-               // generic exception
+               // encapsulate a generic exception
                exception = new AuthorizationException(defaultMessage, new HttpResponseException(command, response,
                      defaultMessage));
                break;
             case 404:
-               exception = new ResourceNotFoundException(defaultMessage, getExceptionToPropagate(command, response,
-                     defaultMessage));
+               // TODO: get the exception to encapsulate from the returned error
+               // object
+               exception = new ResourceNotFoundException(defaultMessage);
                break;
             case 301:
                // Moved resources in Abiquo should be handled with the
-               // ReturnMovedResource
-               // exception parser to return the moved entity.
+               // ReturnMovedResource exception parser to return the moved
+               // entity.
                exception = new HttpResponseException(command, response, defaultMessage);
                break;
             default:
-               exception = getExceptionToPropagate(command, response, defaultMessage);
+               // TODO: get the exception to encapsulate from the returned error
+               // object
+               exception = new HttpResponseException(response.getMessage(), command, response);
                break;
          }
       } finally {
@@ -82,34 +70,4 @@ public class AbiquoErrorHandler implements HttpErrorHandler {
          command.setException(exception);
       }
    }
-
-   private Exception getExceptionToPropagate(final HttpCommand command, final HttpResponse response,
-         final String defaultMessage) {
-      Exception exception = null;
-
-      if (hasPayload(response)) {
-         try {
-            ErrorsDto errors = errorParser.apply(response);
-            exception = new AbiquoException(fromStatusCode(response.getStatusCode()), errors);
-         } catch (Exception ex) {
-            // If it is not an Abiquo Exception (can not be unmarshalled),
-            // propagate a standard
-            // HttpResponseException
-            exception = new HttpResponseException(command, response, defaultMessage);
-         }
-      } else {
-         // If it is not an Abiquo Exception (there is not an errors xml in the
-         // payload)
-         // propagate a standard HttpResponseException
-         exception = new HttpResponseException(command, response, defaultMessage);
-      }
-
-      return exception;
-   }
-
-   private static boolean hasPayload(final HttpResponse response) {
-      return response.getPayload() != null && response.getPayload().getContentMetadata() != null
-            && response.getPayload().getContentMetadata().getContentLength() != null
-            && response.getPayload().getContentMetadata().getContentLength() > 0L;
-   }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AbiquoAuthentication.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AbiquoAuthentication.java b/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AbiquoAuthentication.java
index f18b333..3edcec8 100644
--- a/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AbiquoAuthentication.java
+++ b/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AbiquoAuthentication.java
@@ -39,7 +39,7 @@ public class AbiquoAuthentication implements HttpRequestFilter {
    private final Supplier<String> authTokenProvider;
 
    @Inject
-   public AbiquoAuthentication(@Authentication Supplier<String> authTokenProvider) {
+   AbiquoAuthentication(@Authentication Supplier<String> authTokenProvider) {
       this.authTokenProvider = checkNotNull(authTokenProvider, "authTokenProvider must not be null");
    }
 

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AppendApiVersionToMediaType.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AppendApiVersionToMediaType.java b/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AppendApiVersionToMediaType.java
index ba4cb86..0c6244b 100644
--- a/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AppendApiVersionToMediaType.java
+++ b/abiquo/src/main/java/org/jclouds/abiquo/http/filters/AppendApiVersionToMediaType.java
@@ -40,8 +40,7 @@ public class AppendApiVersionToMediaType implements HttpRequestFilter {
    private AppendApiVersionToAbiquoMimeType versionAppender;
 
    @Inject
-   public AppendApiVersionToMediaType(final AppendApiVersionToAbiquoMimeType versionAppender) {
-      super();
+   AppendApiVersionToMediaType(final AppendApiVersionToAbiquoMimeType versionAppender) {
       this.versionAppender = versionAppender;
    }
 

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/internal/AbiquoContextImpl.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/internal/AbiquoContextImpl.java b/abiquo/src/main/java/org/jclouds/abiquo/internal/AbiquoContextImpl.java
deleted file mode 100644
index c91618a..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/internal/AbiquoContextImpl.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.Context;
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.AbiquoContext;
-import org.jclouds.abiquo.features.services.AdministrationService;
-import org.jclouds.abiquo.features.services.CloudService;
-import org.jclouds.abiquo.features.services.EventService;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.compute.ComputeService;
-import org.jclouds.compute.Utils;
-import org.jclouds.compute.internal.ComputeServiceContextImpl;
-import org.jclouds.location.Provider;
-import org.jclouds.rest.ApiContext;
-
-import com.google.common.reflect.TypeToken;
-
-/**
- * Abiquo {@link ApiContext} implementation to expose high level Abiquo
- * functionalities.
- */
-@Singleton
-public class AbiquoContextImpl extends ComputeServiceContextImpl implements AbiquoContext {
-   private final AdministrationService administrationService;
-
-   private final CloudService cloudService;
-
-   private final MonitoringService monitoringService;
-
-   private final EventService eventService;
-
-   @Inject
-   public AbiquoContextImpl(@Provider final Context wrapped, @Provider final TypeToken<? extends Context> wrappedType,
-         final ComputeService computeService, final Utils utils, final ApiContext<AbiquoApi> providerSpecificContext,
-         final AdministrationService administrationService, final CloudService cloudService,
-         final MonitoringService monitoringService, final EventService eventService) {
-      super(wrapped, wrappedType, computeService, utils);
-      this.administrationService = checkNotNull(administrationService, "administrationService");
-      this.cloudService = checkNotNull(cloudService, "cloudService");
-      this.monitoringService = checkNotNull(monitoringService, "monitoringService");
-      this.eventService = checkNotNull(eventService, "eventService");
-   }
-
-   @Override
-   public ApiContext<AbiquoApi> getApiContext() {
-      return unwrap();
-   }
-
-   @Override
-   public AdministrationService getAdministrationService() {
-      return administrationService;
-   }
-
-   @Override
-   public CloudService getCloudService() {
-      return cloudService;
-   }
-
-   @Override
-   public MonitoringService getMonitoringService() {
-      return monitoringService;
-   }
-
-   @Override
-   public EventService getEventService() {
-      return eventService;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseAdministrationService.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseAdministrationService.java b/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseAdministrationService.java
deleted file mode 100644
index 4e8b5b3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseAdministrationService.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.getFirst;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.config.Category;
-import org.jclouds.abiquo.domain.config.License;
-import org.jclouds.abiquo.domain.config.Privilege;
-import org.jclouds.abiquo.domain.config.SystemProperty;
-import org.jclouds.abiquo.domain.config.options.LicenseOptions;
-import org.jclouds.abiquo.domain.config.options.PropertyOptions;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.enterprise.EnterpriseProperties;
-import org.jclouds.abiquo.domain.enterprise.Role;
-import org.jclouds.abiquo.domain.enterprise.User;
-import org.jclouds.abiquo.domain.enterprise.options.EnterpriseOptions;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.infrastructure.Machine;
-import org.jclouds.abiquo.features.services.AdministrationService;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.strategy.infrastructure.ListMachines;
-import org.jclouds.collect.Memoized;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.appslibrary.CategoriesDto;
-import com.abiquo.server.core.appslibrary.CategoryDto;
-import com.abiquo.server.core.config.LicensesDto;
-import com.abiquo.server.core.config.SystemPropertiesDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.enterprise.EnterprisePropertiesDto;
-import com.abiquo.server.core.enterprise.EnterprisesDto;
-import com.abiquo.server.core.enterprise.PrivilegeDto;
-import com.abiquo.server.core.enterprise.PrivilegesDto;
-import com.abiquo.server.core.enterprise.RoleDto;
-import com.abiquo.server.core.enterprise.RolesDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.DatacentersDto;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Supplier;
-
-/**
- * Provides high level Abiquo administration operations.
- */
-@Singleton
-public class BaseAdministrationService implements AdministrationService {
-   @VisibleForTesting
-   protected ApiContext<AbiquoApi> context;
-
-   @VisibleForTesting
-   protected final ListMachines listMachines;
-
-   @VisibleForTesting
-   protected final Supplier<User> currentUser;
-
-   @VisibleForTesting
-   protected final Supplier<Enterprise> currentEnterprise;
-
-   @Inject
-   protected BaseAdministrationService(final ApiContext<AbiquoApi> context, final ListMachines listMachines,
-         @Memoized final Supplier<User> currentUser, @Memoized final Supplier<Enterprise> currentEnterprise) {
-      this.context = checkNotNull(context, "context");
-      this.listMachines = checkNotNull(listMachines, "listMachines");
-      this.currentUser = checkNotNull(currentUser, "currentUser");
-      this.currentEnterprise = checkNotNull(currentEnterprise, "currentEnterprise");
-   }
-
-   /*********************** Datacenter ********************** */
-
-   @Override
-   public Iterable<Datacenter> listDatacenters() {
-      DatacentersDto result = context.getApi().getInfrastructureApi().listDatacenters();
-      return wrap(context, Datacenter.class, result.getCollection());
-   }
-
-   @Override
-   public Datacenter getDatacenter(final Integer datacenterId) {
-      DatacenterDto datacenter = context.getApi().getInfrastructureApi().getDatacenter(datacenterId);
-      return wrap(context, Datacenter.class, datacenter);
-   }
-
-   /*********************** Machine ***********************/
-
-   @Override
-   public Iterable<Machine> listMachines() {
-      return listMachines.execute();
-   }
-
-   /*********************** Enterprise ***********************/
-
-   @Override
-   public Iterable<Enterprise> listEnterprises() {
-      PagedIterable<EnterpriseDto> result = context.getApi().getEnterpriseApi().listEnterprises();
-      return wrap(context, Enterprise.class, result.concat());
-   }
-
-   @Override
-   public Iterable<Enterprise> listEnterprises(EnterpriseOptions options) {
-      PaginatedCollection<EnterpriseDto, EnterprisesDto> result = context.getApi().getEnterpriseApi()
-            .listEnterprises(options);
-      return wrap(context, Enterprise.class, result.toPagedIterable().concat());
-   }
-
-   @Override
-   public Enterprise getEnterprise(final Integer enterpriseId) {
-      EnterpriseDto enterprise = context.getApi().getEnterpriseApi().getEnterprise(enterpriseId);
-      return wrap(context, Enterprise.class, enterprise);
-   }
-
-   /*********************** Enterprise Properties ***********************/
-
-   @Override
-   public EnterpriseProperties getEnterpriseProperties(final Enterprise enterprise) {
-      checkNotNull(enterprise.getId(), ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + Enterprise.class);
-
-      EnterprisePropertiesDto properties = context.getApi().getEnterpriseApi()
-            .getEnterpriseProperties(enterprise.unwrap());
-      return wrap(context, EnterpriseProperties.class, properties);
-   }
-
-   /*********************** Role ********************** */
-
-   @Override
-   public Iterable<Role> listRoles() {
-      RolesDto result = context.getApi().getAdminApi().listRoles();
-      return wrap(context, Role.class, result.getCollection());
-   }
-
-   @Override
-   public Role getRole(final Integer roleId) {
-      RoleDto role = context.getApi().getAdminApi().getRole(roleId);
-      return wrap(context, Role.class, role);
-   }
-
-   /*********************** Privilege ***********************/
-
-   @Override
-   public Iterable<Privilege> listPrivileges() {
-      PrivilegesDto result = context.getApi().getConfigApi().listPrivileges();
-      return wrap(context, Privilege.class, result.getCollection());
-   }
-
-   @Override
-   public Privilege getPrivilege(Integer privilegeId) {
-      PrivilegeDto result = context.getApi().getConfigApi().getPrivilege(privilegeId);
-      return wrap(context, Privilege.class, result);
-   }
-
-   /*********************** User ***********************/
-
-   @Override
-   public User getCurrentUser() {
-      return currentUser.get();
-   }
-
-   @Override
-   public Enterprise getCurrentEnterprise() {
-      return currentEnterprise.get();
-   }
-
-   /*********************** License ***********************/
-
-   @Override
-   public Iterable<License> listLicenses() {
-      LicensesDto result = context.getApi().getConfigApi().listLicenses();
-      return wrap(context, License.class, result.getCollection());
-   }
-
-   @Override
-   public Iterable<License> listLicenses(final boolean active) {
-      LicenseOptions options = LicenseOptions.builder().active(active).build();
-      LicensesDto result = context.getApi().getConfigApi().listLicenses(options);
-      return wrap(context, License.class, result.getCollection());
-   }
-
-   /*********************** System Properties ***********************/
-
-   @Override
-   public Iterable<SystemProperty> listSystemProperties() {
-      SystemPropertiesDto result = context.getApi().getConfigApi().listSystemProperties();
-      return wrap(context, SystemProperty.class, result.getCollection());
-   }
-
-   @Override
-   public SystemProperty getSystemProperty(final String name) {
-      PropertyOptions options = PropertyOptions.builder().name(name).build();
-      SystemPropertiesDto result = context.getApi().getConfigApi().listSystemProperties(options);
-      return getFirst(wrap(context, SystemProperty.class, result.getCollection()), null);
-   }
-
-   @Override
-   public Iterable<SystemProperty> listSystemProperties(final String component) {
-      PropertyOptions options = PropertyOptions.builder().component(component).build();
-      SystemPropertiesDto result = context.getApi().getConfigApi().listSystemProperties(options);
-      return wrap(context, SystemProperty.class, result.getCollection());
-   }
-
-   @Override
-   public Iterable<Category> listCategories() {
-      CategoriesDto result = context.getApi().getConfigApi().listCategories();
-      return wrap(context, Category.class, result.getCollection());
-   }
-
-   @Override
-   public Category getCategory(Integer categoryId) {
-      CategoryDto result = context.getApi().getConfigApi().getCategory(categoryId);
-      return wrap(context, Category.class, result);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseCloudService.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseCloudService.java b/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseCloudService.java
deleted file mode 100644
index af38612..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseCloudService.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-
-import java.util.List;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.cloud.options.VirtualDatacenterOptions;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineOptions;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.features.services.CloudService;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.strategy.cloud.ListVirtualAppliances;
-import org.jclouds.abiquo.strategy.cloud.ListVirtualDatacenters;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.google.common.annotations.VisibleForTesting;
-
-/**
- * Provides high level Abiquo cloud operations.
- */
-@Singleton
-public class BaseCloudService implements CloudService {
-   @VisibleForTesting
-   protected final ApiContext<AbiquoApi> context;
-
-   @VisibleForTesting
-   protected final ListVirtualDatacenters listVirtualDatacenters;
-
-   @VisibleForTesting
-   protected final ListVirtualAppliances listVirtualAppliances;
-
-   @Inject
-   protected BaseCloudService(final ApiContext<AbiquoApi> context, final ListVirtualDatacenters listVirtualDatacenters,
-         final ListVirtualAppliances listVirtualAppliances) {
-      this.context = checkNotNull(context, "context");
-      this.listVirtualDatacenters = checkNotNull(listVirtualDatacenters, "listVirtualDatacenters");
-      this.listVirtualAppliances = checkNotNull(listVirtualAppliances, "listVirtualAppliances");
-   }
-
-   /*********************** Virtual Datacenter ********************** */
-
-   @Override
-   public Iterable<VirtualDatacenter> listVirtualDatacenters() {
-      return listVirtualDatacenters.execute();
-   }
-
-   @Override
-   public Iterable<VirtualDatacenter> listVirtualDatacenters(final Enterprise enterprise) {
-      checkNotNull(enterprise, ValidationErrors.NULL_RESOURCE + Enterprise.class);
-      checkNotNull(enterprise.getId(), ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + Enterprise.class);
-
-      VirtualDatacenterOptions options = VirtualDatacenterOptions.builder().enterpriseId(enterprise.getId()).build();
-
-      return listVirtualDatacenters.execute(options);
-   }
-
-   @Override
-   public VirtualDatacenter getVirtualDatacenter(final Integer virtualDatacenterId) {
-      VirtualDatacenterDto virtualDatacenter = context.getApi().getCloudApi().getVirtualDatacenter(virtualDatacenterId);
-      return wrap(context, VirtualDatacenter.class, virtualDatacenter);
-   }
-
-   @Override
-   public Iterable<VirtualDatacenter> getVirtualDatacenters(final List<Integer> virtualDatacenterIds) {
-      return listVirtualDatacenters.execute(virtualDatacenterIds);
-   }
-
-   /*********************** Virtual Appliance ********************** */
-
-   @Override
-   public Iterable<VirtualAppliance> listVirtualAppliances() {
-      return listVirtualAppliances.execute();
-   }
-
-   /*********************** Virtual Machine ********************** */
-
-   @Override
-   public Iterable<VirtualMachine> listVirtualMachines() {
-      PagedIterable<VirtualMachineWithNodeExtendedDto> vms = context.getApi().getCloudApi().listAllVirtualMachines();
-      return wrap(context, VirtualMachine.class, vms.concat());
-   }
-
-   @Override
-   public Iterable<VirtualMachine> listVirtualMachines(VirtualMachineOptions options) {
-      PaginatedCollection<VirtualMachineWithNodeExtendedDto, VirtualMachinesWithNodeExtendedDto> vms = context.getApi()
-            .getCloudApi().listAllVirtualMachines(options);
-      return wrap(context, VirtualMachine.class, vms.toPagedIterable().concat());
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseEventService.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseEventService.java b/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseEventService.java
deleted file mode 100644
index 8944d8e..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseEventService.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.event.Event;
-import org.jclouds.abiquo.domain.event.options.EventOptions;
-import org.jclouds.abiquo.features.services.EventService;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.event.EventDto;
-import com.abiquo.server.core.event.EventsDto;
-import com.google.common.annotations.VisibleForTesting;
-
-/**
- * Provides high level Abiquo event operations.
- */
-@Singleton
-public class BaseEventService implements EventService {
-   @VisibleForTesting
-   protected ApiContext<AbiquoApi> context;
-
-   @Inject
-   protected BaseEventService(final ApiContext<AbiquoApi> context) {
-      this.context = checkNotNull(context, "context");
-   }
-
-   @Override
-   public Iterable<Event> listEvents() {
-      PagedIterable<EventDto> result = context.getApi().getEventApi().listEvents();
-      return wrap(context, Event.class, result.concat());
-   }
-
-   @Override
-   public Iterable<Event> listEvents(final EventOptions options) {
-      PaginatedCollection<EventDto, EventsDto> result = context.getApi().getEventApi().listEvents(options);
-      return wrap(context, Event.class, result.toPagedIterable().concat());
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseMonitoringService.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseMonitoringService.java b/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseMonitoringService.java
deleted file mode 100644
index a6dbb00..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/internal/BaseMonitoringService.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.Constants.PROPERTY_SCHEDULER_THREADS;
-import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY;
-
-import java.util.concurrent.Future;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import javax.annotation.Resource;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.monitor.AsyncTaskMonitor;
-import org.jclouds.abiquo.monitor.ConversionMonitor;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.abiquo.monitor.VirtualApplianceMonitor;
-import org.jclouds.abiquo.monitor.VirtualMachineMonitor;
-import org.jclouds.abiquo.monitor.events.CompletedEvent;
-import org.jclouds.abiquo.monitor.events.FailedEvent;
-import org.jclouds.abiquo.monitor.events.TimeoutEvent;
-import org.jclouds.abiquo.monitor.handlers.AbstractEventHandler;
-import org.jclouds.abiquo.monitor.handlers.BlockingEventHandler;
-import org.jclouds.logging.Logger;
-import org.jclouds.rest.ApiContext;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Function;
-import com.google.common.eventbus.EventBus;
-import com.google.inject.Inject;
-
-/**
- * Utility service to monitor asynchronous operations.
- */
-@Singleton
-public class BaseMonitoringService implements MonitoringService {
-   @VisibleForTesting
-   protected ApiContext<AbiquoApi> context;
-
-   /** The scheduler used to perform monitoring tasks. */
-   @VisibleForTesting
-   protected ScheduledExecutorService scheduler;
-
-   @VisibleForTesting
-   protected Long pollingDelay;
-
-   /**
-    * The event bus used to dispatch monitoring events.
-    * <p>
-    * A sync bus is used by default, to prevent deadlocks when using the
-    * {@link BlockingEventHandler}.
-    */
-   @VisibleForTesting
-   protected EventBus eventBus;
-
-   @Resource
-   private Logger logger = Logger.NULL;
-
-   @Inject
-   public BaseMonitoringService(final ApiContext<AbiquoApi> context,
-         @Named(PROPERTY_SCHEDULER_THREADS) final ScheduledExecutorService scheduler,
-         @Named(ASYNC_TASK_MONITOR_DELAY) final Long pollingDelay, final EventBus eventBus) {
-      this.context = checkNotNull(context, "context");
-      this.scheduler = checkNotNull(scheduler, "scheduler");
-      this.pollingDelay = checkNotNull(pollingDelay, "pollingDelay");
-      this.eventBus = checkNotNull(eventBus, "eventBus");
-   }
-
-   /*************** Generic monitoring methods ***************/
-
-   @Override
-   public <T> void awaitCompletion(final Function<T, MonitorStatus> completeCondition, final T... objects) {
-      awaitCompletion(null, null, completeCondition, objects);
-   }
-
-   @Override
-   public <T> void awaitCompletion(final Long maxWait, final TimeUnit timeUnit,
-         final Function<T, MonitorStatus> completeCondition, final T... objects) {
-      checkNotNull(completeCondition, "completeCondition");
-
-      if (objects != null && objects.length > 0) {
-         BlockingEventHandler<T> blockingHandler = new BlockingEventHandler<T>(logger, objects);
-         register(blockingHandler);
-
-         monitor(maxWait, timeUnit, completeCondition, objects);
-         blockingHandler.lock();
-
-         unregister(blockingHandler);
-      }
-   }
-
-   @Override
-   public <T> void monitor(final Function<T, MonitorStatus> completeCondition, final T... objects) {
-      monitor(null, null, completeCondition, objects);
-   }
-
-   @Override
-   public <T> void monitor(final Long maxWait, final TimeUnit timeUnit,
-         final Function<T, MonitorStatus> completeCondition, final T... objects) {
-      checkNotNull(completeCondition, "completeCondition");
-      if (maxWait != null) {
-         checkNotNull(timeUnit, "timeUnit");
-      }
-
-      if (objects != null && objects.length > 0) {
-         for (T object : objects) {
-            AsyncMonitor<T> monitor = new AsyncMonitor<T>(object, completeCondition);
-            monitor.startMonitoring(maxWait, timeUnit);
-         }
-      }
-   }
-
-   @Override
-   public <T extends AbstractEventHandler<?>> void register(final T handler) {
-      logger.debug("registering event handler %s", handler);
-      eventBus.register(handler);
-   }
-
-   @Override
-   public <T extends AbstractEventHandler<?>> void unregister(final T handler) {
-      logger.debug("unregistering event handler %s", handler);
-      eventBus.unregister(handler);
-   }
-
-   /*************** Delegating monitors ***************/
-
-   @Override
-   public VirtualMachineMonitor getVirtualMachineMonitor() {
-      return checkNotNull(context.utils().injector().getInstance(VirtualMachineMonitor.class), "virtualMachineMonitor");
-   }
-
-   @Override
-   public VirtualApplianceMonitor getVirtualApplianceMonitor() {
-      return checkNotNull(context.utils().injector().getInstance(VirtualApplianceMonitor.class),
-            "virtualApplianceMonitor");
-   }
-
-   @Override
-   public AsyncTaskMonitor getAsyncTaskMonitor() {
-      return checkNotNull(context.utils().injector().getInstance(AsyncTaskMonitor.class), "asyncTaskMonitor");
-   }
-
-   @Override
-   public ConversionMonitor getConversionMonitor() {
-      return checkNotNull(context.utils().injector().getInstance(ConversionMonitor.class), "conversionMonitor");
-   }
-
-   /**
-    * Performs the periodical monitoring tasks.
-    * 
-    * @param <T>
-    *           The type of the object being monitored.
-    */
-   @VisibleForTesting
-   class AsyncMonitor<T> implements Runnable {
-      /** The object being monitored. */
-      private T monitoredObject;
-
-      /** The function used to monitor the target object. */
-      private Function<T, MonitorStatus> completeCondition;
-
-      /**
-       * The future representing the monitoring job. Needed to be able to cancel
-       * it when monitor finishes.
-       */
-      private Future<?> future;
-
-      /** The timeout for this monitor. */
-      private Long timeout;
-
-      public AsyncMonitor(final T monitoredObject, final Function<T, MonitorStatus> completeCondition) {
-         super();
-         this.monitoredObject = checkNotNull(monitoredObject, "monitoredObject");
-         this.completeCondition = checkNotNull(completeCondition, "completeCondition");
-      }
-
-      /**
-       * Starts the monitoring job with the given timeout.
-       * 
-       * @param maxWait
-       *           The timeout.
-       * @param timeUnit
-       *           The timeunit used in the maxWait parameter.
-       */
-      public void startMonitoring(final Long maxWait, TimeUnit timeUnit) {
-         if (maxWait != null) {
-            checkNotNull(timeUnit, "timeUnit must not be null when using timeouts");
-         }
-         future = scheduler.scheduleWithFixedDelay(this, 0L, pollingDelay, TimeUnit.MILLISECONDS);
-         timeout = maxWait == null ? null : System.currentTimeMillis() + timeUnit.toMillis(maxWait);
-         logger.debug("started monitor job for %s with %s timeout", monitoredObject,
-               timeout == null ? "no" : String.valueOf(timeout));
-      }
-
-      /**
-       * Stops the monitoring job, if running.
-       */
-      public void stopMonitoring() {
-         logger.debug("stopping monitor job for %s", monitoredObject);
-
-         try {
-            if (future != null && !future.isCancelled() && !future.isDone()) {
-               // Do not force future cancel. Let it finish gracefully
-               logger.debug("cancelling future");
-               future.cancel(false);
-            }
-         } catch (Exception ex) {
-            logger.warn(ex, "failed to stop monitor job for %s", monitoredObject);
-         }
-      }
-
-      /**
-       * Checks if the monitor has timed out.
-       */
-      public boolean isTimeout() {
-         return timeout != null && timeout < System.currentTimeMillis();
-      }
-
-      @Override
-      public void run() {
-         // Do not use Thread.interrupted() since it will clear the interrupted
-         // flag
-         // and subsequent calls to it may not return the appropriate value
-         if (Thread.currentThread().isInterrupted()) {
-            // If the thread as already been interrupted, just stop monitoring
-            // the task and
-            // return
-            stopMonitoring();
-            return;
-         }
-
-         MonitorStatus status = completeCondition.apply(monitoredObject);
-         logger.debug("monitored object %s status %s", monitoredObject, status.name());
-
-         switch (status) {
-            case DONE:
-               stopMonitoring();
-               logger.debug("publishing COMPLETED event");
-               eventBus.post(new CompletedEvent<T>(monitoredObject));
-               break;
-            case FAILED:
-               stopMonitoring();
-               logger.debug("publishing FAILED event");
-               eventBus.post(new FailedEvent<T>(monitoredObject));
-               break;
-            case CONTINUE:
-            default:
-               if (isTimeout()) {
-                  logger.warn("monitor for object %s timed out. Shutting down monitor.", monitoredObject);
-                  stopMonitoring();
-                  logger.debug("publishing TIMEOUT event");
-                  eventBus.post(new TimeoutEvent<T>(monitoredObject));
-               }
-               break;
-         }
-      }
-
-      public T getMonitoredObject() {
-         return monitoredObject;
-      }
-
-      public Function<T, MonitorStatus> getCompleteCondition() {
-         return completeCondition;
-      }
-
-      public Future<?> getFuture() {
-         return future;
-      }
-
-      public Long getTimeout() {
-         return timeout;
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/AsyncTaskMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/AsyncTaskMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/AsyncTaskMonitor.java
deleted file mode 100644
index a8e10c7..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/AsyncTaskMonitor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor;
-
-import java.util.concurrent.TimeUnit;
-
-import org.jclouds.abiquo.domain.task.AsyncTask;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.monitor.internal.BaseAsyncTaskMonitor;
-
-import com.google.inject.ImplementedBy;
-
-/**
- * {@link VirtualMachine} monitoring features.
- */
-@ImplementedBy(BaseAsyncTaskMonitor.class)
-public interface AsyncTaskMonitor extends MonitoringService {
-   /**
-    * Monitor the given {@link AsyncTask}s and block until they finish.
-    * 
-    * @param tasks
-    *           The {@link AsyncTask}s to monitor.
-    */
-   void awaitCompletion(final AsyncTask<?, ?>... tasks);
-
-   /**
-    * Monitor the given {@link AsyncTask}s and populate an event when they
-    * finish.
-    * 
-    * @param tasks
-    *           The {@link AsyncTask}s to monitor.
-    */
-   void monitor(final AsyncTask<?, ?>... tasks);
-
-   /**
-    * Monitor the given {@link AsyncTask}s and block until they finish.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param tasks
-    *           The {@link AsyncTask}s to monitor.
-    */
-   void awaitCompletion(final Long maxWait, final TimeUnit timeUnit, final AsyncTask<?, ?>... tasks);
-
-   /**
-    * Monitor the given {@link AsyncTask}s and populate an event when they
-    * finish.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param tasks
-    *           The {@link AsyncTask}s to monitor.
-    */
-   void monitor(final Long maxWait, final TimeUnit timeUnit, final AsyncTask<?, ?>... tasks);
-}


[24/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider


Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs/commit/1b689dc1
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs/tree/1b689dc1
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs/diff/1b689dc1

Branch: refs/heads/master
Commit: 1b689dc17ff1cc78e981ca87e13094b47109d3fa
Parents: 3bceb3f
Author: Ignasi Barrera <na...@apache.org>
Authored: Tue Nov 25 23:06:09 2014 +0100
Committer: Ignasi Barrera <na...@apache.org>
Committed: Thu Nov 27 15:27:29 2014 +0100

----------------------------------------------------------------------
 abiquo/README.md                                |   10 -
 abiquo/pom.xml                                  |  125 +-
 .../main/java/org/jclouds/abiquo/AbiquoApi.java |   99 +-
 .../org/jclouds/abiquo/AbiquoApiMetadata.java   |   25 +-
 .../java/org/jclouds/abiquo/AbiquoContext.java  |   72 -
 .../org/jclouds/abiquo/AbiquoFallbacks.java     |  153 --
 .../jclouds/abiquo/binders/AppendToPath.java    |   48 -
 .../jclouds/abiquo/binders/BindLinkToPath.java  |   41 -
 .../binders/BindLinkToPathAndAcceptHeader.java  |   45 -
 .../abiquo/binders/BindRefsToPayload.java       |   63 -
 .../org/jclouds/abiquo/binders/BindToPath.java  |  134 --
 .../abiquo/binders/BindToXMLPayloadAndPath.java |   75 -
 .../cloud/BindHardDiskRefsToPayload.java        |   41 -
 .../binders/cloud/BindIpRefToPayload.java       |   56 -
 .../binders/cloud/BindIpRefsToPayload.java      |   63 -
 .../binders/cloud/BindMoveVolumeToPath.java     |   44 -
 .../BindNetworkConfigurationRefToPayload.java   |   68 -
 .../binders/cloud/BindNetworkRefToPayload.java  |   73 -
 .../cloud/BindUnmanagedIpRefToPayload.java      |   59 -
 .../BindVirtualDatacenterRefToPayload.java      |   57 -
 .../binders/cloud/BindVolumeRefsToPayload.java  |   41 -
 .../infrastructure/AppendMachineIdToPath.java   |   44 -
 .../AppendRemoteServiceTypeToPath.java          |   47 -
 .../BindSupportedDevicesLinkToPath.java         |   35 -
 .../AbiquoComputeServiceContextModule.java      |   77 -
 .../compute/functions/DatacenterToLocation.java |   51 -
 .../functions/VirtualDatacenterToLocation.java  |   73 -
 .../VirtualMachineStateToNodeState.java         |   50 -
 ...neTemplateInVirtualDatacenterToHardware.java |   90 --
 .../VirtualMachineTemplateToImage.java          |   86 --
 .../functions/VirtualMachineToNodeMetadata.java |  134 --
 .../compute/options/AbiquoTemplateOptions.java  |  121 --
 .../strategy/AbiquoComputeServiceAdapter.java   |  335 -----
 .../CreateGroupBeforeCreatingNodes.java         |  112 --
 .../FindCompatibleVirtualDatacenters.java       |   32 -
 .../VirtualApplianceCachingTemplate.java        |  145 --
 ...irtualDatacentersForImageAndConversions.java |   74 -
 ...bleVirtualDatacentersForImageBaseFormat.java |   84 --
 .../abiquo/config/AbiquoHttpApiModule.java      |   80 -
 .../jclouds/abiquo/config/AbiquoProperties.java |    9 -
 .../abiquo/domain/DomainWithLimitsWrapper.java  |  165 ---
 .../abiquo/domain/DomainWithTasksWrapper.java   |   60 -
 .../jclouds/abiquo/domain/DomainWrapper.java    |  279 ----
 .../abiquo/domain/PaginatedCollection.java      |  158 --
 .../abiquo/domain/builder/LimitsBuilder.java    |   94 --
 .../jclouds/abiquo/domain/cloud/Conversion.java |  123 --
 .../jclouds/abiquo/domain/cloud/HardDisk.java   |  158 --
 .../abiquo/domain/cloud/VirtualAppliance.java   |  344 -----
 .../abiquo/domain/cloud/VirtualDatacenter.java  |  481 ------
 .../abiquo/domain/cloud/VirtualMachine.java     |  887 ------------
 .../domain/cloud/VirtualMachineTemplate.java    |  325 -----
 ...rtualMachineTemplateInVirtualDatacenter.java |   44 -
 .../org/jclouds/abiquo/domain/cloud/Volume.java |  238 ---
 .../domain/cloud/options/ConversionOptions.java |   70 -
 .../cloud/options/VirtualApplianceOptions.java  |   55 -
 .../cloud/options/VirtualDatacenterOptions.java |   70 -
 .../cloud/options/VirtualMachineOptions.java    |   55 -
 .../options/VirtualMachineTemplateOptions.java  |  101 --
 .../domain/cloud/options/VolumeOptions.java     |   55 -
 .../jclouds/abiquo/domain/config/Category.java  |  163 ---
 .../jclouds/abiquo/domain/config/License.java   |  107 --
 .../jclouds/abiquo/domain/config/Privilege.java |   52 -
 .../abiquo/domain/config/SystemProperty.java    |   73 -
 .../domain/config/options/IconOptions.java      |   53 -
 .../domain/config/options/LicenseOptions.java   |   63 -
 .../domain/config/options/PropertyOptions.java  |   63 -
 .../abiquo/domain/enterprise/Enterprise.java    |  645 ---------
 .../domain/enterprise/EnterpriseProperties.java |   78 -
 .../abiquo/domain/enterprise/Limits.java        |  166 ---
 .../jclouds/abiquo/domain/enterprise/Role.java  |  201 ---
 .../enterprise/TemplateDefinitionList.java      |  208 ---
 .../abiquo/domain/enterprise/TemplateState.java |   65 -
 .../jclouds/abiquo/domain/enterprise/User.java  |  417 ------
 .../enterprise/options/EnterpriseOptions.java   |   79 -
 .../domain/enterprise/options/UserOptions.java  |   56 -
 .../org/jclouds/abiquo/domain/event/Event.java  |  314 ----
 .../domain/event/options/EventOptions.java      |  164 ---
 .../domain/exception/AbiquoException.java       |  120 --
 .../domain/exception/BuilderException.java      |   57 -
 .../domain/exception/WrapperException.java      |   63 -
 .../domain/infrastructure/Datacenter.java       |  794 ----------
 .../abiquo/domain/infrastructure/Datastore.java |   82 --
 .../abiquo/domain/infrastructure/Machine.java   |  626 --------
 .../domain/infrastructure/NetworkInterface.java |   72 -
 .../abiquo/domain/infrastructure/Rack.java      |  336 -----
 .../domain/infrastructure/RemoteService.java    |  243 ----
 .../domain/infrastructure/StorageDevice.java    |  369 -----
 .../infrastructure/StorageDeviceMetadata.java   |   54 -
 .../domain/infrastructure/StoragePool.java      |  248 ----
 .../abiquo/domain/infrastructure/Tier.java      |  130 --
 .../options/DatacenterOptions.java              |   52 -
 .../infrastructure/options/IpmiOptions.java     |   56 -
 .../infrastructure/options/MachineOptions.java  |   70 -
 .../options/StoragePoolOptions.java             |   57 -
 .../abiquo/domain/network/AbstractPublicIp.java |   53 -
 .../abiquo/domain/network/ExternalIp.java       |   72 -
 .../abiquo/domain/network/ExternalNetwork.java  |  231 ---
 .../org/jclouds/abiquo/domain/network/Ip.java   |   70 -
 .../jclouds/abiquo/domain/network/Network.java  |  306 ----
 .../domain/network/NetworkServiceType.java      |  128 --
 .../org/jclouds/abiquo/domain/network/Nic.java  |   56 -
 .../abiquo/domain/network/PrivateIp.java        |   71 -
 .../abiquo/domain/network/PrivateNetwork.java   |  165 ---
 .../jclouds/abiquo/domain/network/PublicIp.java |   70 -
 .../abiquo/domain/network/PublicNetwork.java    |  190 ---
 .../abiquo/domain/network/UnmanagedIp.java      |   72 -
 .../abiquo/domain/network/UnmanagedNetwork.java |  233 ---
 .../domain/network/options/IpOptions.java       |   55 -
 .../domain/network/options/NetworkOptions.java  |   67 -
 .../abiquo/domain/options/FilterOptions.java    |  108 --
 .../jclouds/abiquo/domain/task/AsyncJob.java    |   70 -
 .../jclouds/abiquo/domain/task/AsyncTask.java   |  141 --
 .../abiquo/domain/task/ConversionTask.java      |   40 -
 .../abiquo/domain/task/VirtualMachineTask.java  |   40 -
 .../domain/task/VirtualMachineTemplateTask.java |   40 -
 .../jclouds/abiquo/domain/util/LinkUtils.java   |   55 -
 .../jclouds/abiquo/fallbacks/MovedVolume.java   |   89 --
 .../org/jclouds/abiquo/features/AdminApi.java   |  180 ---
 .../org/jclouds/abiquo/features/CloudApi.java   | 1253 ----------------
 .../org/jclouds/abiquo/features/ConfigApi.java  |  255 ----
 .../jclouds/abiquo/features/EnterpriseApi.java  |  616 --------
 .../org/jclouds/abiquo/features/EventApi.java   |   70 -
 .../abiquo/features/InfrastructureApi.java      | 1367 ------------------
 .../org/jclouds/abiquo/features/TaskApi.java    |   77 -
 .../features/VirtualMachineTemplateApi.java     |  258 ----
 .../services/AdministrationService.java         |  170 ---
 .../abiquo/features/services/CloudService.java  |   81 --
 .../abiquo/features/services/EventService.java  |   39 -
 .../features/services/MonitoringService.java    |  145 --
 .../AppendApiVersionToAbiquoMimeType.java       |   16 +-
 .../jclouds/abiquo/functions/ParseErrors.java   |   38 -
 .../functions/ReturnTaskReferenceOrNull.java    |   60 -
 .../abiquo/functions/auth/GetTokenFromApi.java  |   40 +-
 .../functions/enterprise/ParseEnterpriseId.java |   40 -
 .../infrastructure/ParseDatacenterId.java       |   40 -
 .../infrastructure/ParseMachineId.java          |   40 -
 .../infrastructure/ParseRemoteServiceType.java  |   41 -
 .../pagination/BasePaginationParser.java        |   54 -
 .../functions/pagination/ParseEnterprises.java  |   47 -
 .../functions/pagination/ParseEvents.java       |   47 -
 .../functions/pagination/ParseExternalIps.java  |   47 -
 .../functions/pagination/ParsePrivateIps.java   |   47 -
 .../functions/pagination/ParsePublicIps.java    |   47 -
 .../functions/pagination/ParseUnmanagedIps.java |   47 -
 .../abiquo/functions/pagination/ParseUsers.java |  154 --
 .../ParseVirtualMachineTemplates.java           |   49 -
 .../pagination/ParseVirtualMachines.java        |   49 -
 .../functions/pagination/ParseVolumes.java      |   48 -
 .../abiquo/handlers/AbiquoErrorHandler.java     |   60 +-
 .../http/filters/AbiquoAuthentication.java      |    2 +-
 .../filters/AppendApiVersionToMediaType.java    |    3 +-
 .../abiquo/internal/AbiquoContextImpl.java      |   89 --
 .../internal/BaseAdministrationService.java     |  231 ---
 .../abiquo/internal/BaseCloudService.java       |  118 --
 .../abiquo/internal/BaseEventService.java       |   61 -
 .../abiquo/internal/BaseMonitoringService.java  |  294 ----
 .../abiquo/monitor/AsyncTaskMonitor.java        |   73 -
 .../abiquo/monitor/ConversionMonitor.java       |   73 -
 .../jclouds/abiquo/monitor/MonitorStatus.java   |   31 -
 .../abiquo/monitor/VirtualApplianceMonitor.java |  121 --
 .../abiquo/monitor/VirtualMachineMonitor.java   |  169 ---
 .../abiquo/monitor/events/CompletedEvent.java   |   27 -
 .../abiquo/monitor/events/FailedEvent.java      |   27 -
 .../abiquo/monitor/events/MonitorEvent.java     |   65 -
 .../abiquo/monitor/events/TimeoutEvent.java     |   27 -
 .../functions/AsyncTaskStatusMonitor.java       |   64 -
 .../functions/ConversionStatusMonitor.java      |   62 -
 .../VirtualApplianceDeployMonitor.java          |   65 -
 .../VirtualApplianceUndeployMonitor.java        |   70 -
 .../functions/VirtualMachineDeployMonitor.java  |   64 -
 .../functions/VirtualMachineStateMonitor.java   |   61 -
 .../VirtualMachineUndeployMonitor.java          |   73 -
 .../monitor/handlers/AbstractEventHandler.java  |   52 -
 .../monitor/handlers/BlockingEventHandler.java  |  145 --
 .../monitor/internal/BaseAsyncTaskMonitor.java  |   78 -
 .../monitor/internal/BaseConversionMonitor.java |   78 -
 .../internal/BaseVirtualApplianceMonitor.java   |  101 --
 .../internal/BaseVirtualMachineMonitor.java     |  125 --
 .../jclouds/abiquo/predicates/IpPredicates.java |   46 -
 .../abiquo/predicates/LinkPredicates.java       |   64 -
 .../NetworkServiceTypePredicates.java           |   35 -
 .../predicates/VirtualDatacenterPredicates.java |   78 -
 .../VirtualMachineTemplatePredicates.java       |   45 -
 .../abiquo/reference/ValidationErrors.java      |   31 -
 .../abiquo/reference/rest/ParentLinkName.java   |   62 -
 .../abiquo/rest/annotations/EndpointLink.java   |   35 -
 .../jclouds/abiquo/strategy/ListEntities.java   |   26 -
 .../abiquo/strategy/ListRootEntities.java       |   26 -
 .../abiquo/strategy/cloud/ListAttachedNics.java |   97 --
 .../strategy/cloud/ListVirtualAppliances.java   |  108 --
 .../strategy/cloud/ListVirtualDatacenters.java  |  122 --
 .../enterprise/ListVirtualMachineTemplates.java |  110 --
 .../strategy/infrastructure/ListMachines.java   |  129 --
 .../services/org.jclouds.apis.ApiMetadata       |    1 -
 .../jclouds/abiquo/AbiquoApiMetadataTest.java   |   12 +-
 .../java/org/jclouds/abiquo/AbiquoApiTest.java  |   57 -
 .../jclouds/abiquo/AbiquoDelegateApiTest.java   |   58 -
 .../abiquo/binders/AppendToPathTest.java        |   51 -
 .../BindLinkToPathAndAcceptHeaderTest.java      |   52 -
 .../abiquo/binders/BindLinkToPathTest.java      |   46 -
 .../jclouds/abiquo/binders/BindToPathTest.java  |  156 --
 .../cloud/BindHardDiskRefsToPayloadTest.java    |   77 -
 .../binders/cloud/BindIpRefToPayloadTest.java   |   64 -
 .../binders/cloud/BindIpRefsToPayloadTest.java  |   78 -
 .../binders/cloud/BindMoveVolumeToPathTest.java |   70 -
 ...indNetworkConfigurationRefToPayloadTest.java |  128 --
 .../cloud/BindNetworkRefToPayloadTest.java      |   61 -
 .../cloud/BindUnmanagedIpRefToPayloadTest.java  |   63 -
 .../BindVirtualDatacenterRefToPayloadTest.java  |   61 -
 .../cloud/BindVolumeRefsToPayloadTest.java      |   77 -
 .../AppendMachineIdToPathTest.java              |   56 -
 .../AppendRemoteServiceTypeToPathTest.java      |   54 -
 .../BindSupportedDevicesLinkToPathTest.java     |   84 --
 .../compute/AbiquoComputeServiceLiveTest.java   |  102 --
 .../functions/DatacenterToLocationTest.java     |   46 -
 .../VirtualDatacenterToLocationTest.java        |   93 --
 .../VirtualMachineStateToNodeStateTest.java     |   43 -
 ...mplateInVirtualDatacenterToHardwareTest.java |  145 --
 .../VirtualMachineTemplateToImageTest.java      |  125 --
 .../VirtualMachineToNodeMetadataTest.java       |  218 ---
 .../options/AbiquoTemplateOptionsTest.java      |   49 -
 .../abiquo/config/SchedulerModuleTest.java      |   39 -
 .../abiquo/domain/AbiquoVersionLiveApiTest.java |   50 -
 .../jclouds/abiquo/domain/AdminResources.java   |  194 ---
 .../jclouds/abiquo/domain/CloudResources.java   |  455 ------
 .../jclouds/abiquo/domain/ConfigResources.java  |  155 --
 .../org/jclouds/abiquo/domain/DomainUtils.java  |   55 -
 .../abiquo/domain/EnterpriseResources.java      |  316 ----
 .../abiquo/domain/InfrastructureResources.java  |  389 -----
 .../jclouds/abiquo/domain/NetworkResources.java |  242 ----
 .../abiquo/domain/TemplateResources.java        |  169 ---
 .../abiquo/domain/admin/RoleLiveApiTest.java    |  102 --
 .../abiquo/domain/cloud/AccountLiveTest.java    |   55 -
 .../domain/cloud/HardDiskLiveApiTest.java       |   65 -
 .../cloud/VirtualApplianceLiveApiTest.java      |   91 --
 .../domain/cloud/VirtualApplianceLiveTest.java  |  130 --
 .../cloud/VirtualDatacenterLiveApiTest.java     |  177 ---
 .../domain/cloud/VirtualMachineLiveApiTest.java |  137 --
 .../domain/cloud/VirtualMachineLiveTest.java    |  179 ---
 .../VirtualMachineNetworkingLiveApiTest.java    |  223 ---
 .../cloud/VirtualMachineStorageLiveApiTest.java |  152 --
 .../VirtualMachineTemplateLiveApiTest.java      |   58 -
 .../abiquo/domain/cloud/VirtualMachineTest.java |   37 -
 .../abiquo/domain/cloud/VolumeLiveApiTest.java  |  131 --
 .../domain/config/CategoryLiveApiTest.java      |   68 -
 .../domain/config/LicenseLiveApiTest.java       |   44 -
 .../config/SystemPropertiesLiveApiTest.java     |   44 -
 .../enterprise/EnterpriseLiveApiTest.java       |  164 ---
 .../EnterprisePropertiesLiveApiTest.java        |   47 -
 .../TemplateDefinitionListLiveApiTest.java      |   75 -
 .../domain/enterprise/UserLiveApiTest.java      |  105 --
 .../abiquo/domain/event/EventLiveApiTest.java   |  251 ----
 .../infrastructure/DatacenterLiveApiTest.java   |   76 -
 .../infrastructure/MachineLiveApiTest.java      |  138 --
 .../NetworkServiceTypeLiveApiTest.java          |   64 -
 .../domain/infrastructure/RackLiveApiTest.java  |   65 -
 .../RemoteServiceLiveApiTest.java               |  116 --
 .../StorageDeviceLiveApiTest.java               |   66 -
 .../infrastructure/StoragePoolLiveApiTest.java  |   85 --
 .../domain/infrastructure/TierLiveApiTest.java  |   67 -
 .../network/ExternalNetworkLiveApiTest.java     |  160 --
 .../network/GenericNetworkLiveApiTest.java      |   79 -
 .../network/PrivateNetworkLiveApiTest.java      |  146 --
 .../network/PublicNetworkLiveApiTest.java       |  150 --
 .../network/UnmanagedNetworkLiveApiTest.java    |  162 ---
 .../environment/CloudTestEnvironment.java       |  221 ---
 .../InfrastructureTestEnvironment.java          |  493 -------
 .../abiquo/environment/TestEnvironment.java     |   35 -
 .../AppendApiVersionToAbiquoMimeTypeTest.java   |   60 -
 .../fallbacks/FalseIfNotAvailableTest.java      |  105 --
 .../abiquo/fallbacks/FalseOn5xxTest.java        |   96 --
 .../abiquo/fallbacks/MovedVolumeTest.java       |   93 --
 .../jclouds/abiquo/fallbacks/NullOn303Test.java |   94 --
 ...agateAbiquoExceptionOnNotFoundOr4xxTest.java |   68 -
 .../jclouds/abiquo/features/AdminApiTest.java   |  175 ---
 .../features/BaseAbiquoApiExpectTest.java       |   89 --
 .../abiquo/features/BaseAbiquoApiTest.java      |   87 --
 .../abiquo/features/CloudApiExpectTest.java     |  590 --------
 .../jclouds/abiquo/features/CloudApiTest.java   | 1097 --------------
 .../jclouds/abiquo/features/ConfigApiTest.java  |  279 ----
 .../features/EnterpriseApiExpectTest.java       |  207 ---
 .../abiquo/features/EnterpriseApiTest.java      |  603 --------
 .../abiquo/features/EventApiExpectTest.java     |  106 --
 .../features/InfrastructureApiExpectTest.java   |  424 ------
 .../abiquo/features/InfrastructureApiTest.java  | 1277 ----------------
 .../jclouds/abiquo/features/TaskApiTest.java    |  118 --
 .../VirtualMachineTemplateApiExpectTest.java    |  121 --
 .../features/VirtualMachineTemplateApiTest.java |  208 ---
 .../ReturnTaskReferenceOrNullTest.java          |   90 --
 .../functions/auth/GetTokenFromApiTest.java     |   14 +-
 .../enterprise/ParseEnterpriseIdTest.java       |   56 -
 .../infrastructure/ParseDatacenterIdTest.java   |   56 -
 .../infrastructure/ParseMachineIdTest.java      |   56 -
 .../ParseRemoteServiceTypeTest.java             |   47 -
 .../AppendApiVersionToMediaTypeTest.java        |  122 +-
 .../abiquo/internal/AsyncMonitorTest.java       |  533 -------
 .../internal/BaseAbiquoApiLiveApiTest.java      |   77 -
 .../abiquo/internal/BaseAbiquoLiveApiTest.java  |   61 -
 .../internal/BaseAdministrationServiceTest.java |   38 -
 .../abiquo/internal/BaseCloudServiceTest.java   |   37 -
 .../abiquo/internal/BaseEventServiceTest.java   |   34 -
 .../abiquo/internal/BaseInjectionTest.java      |   61 -
 .../internal/BaseMonitoringServiceTest.java     |   90 --
 .../functions/AsyncTaskStatusMonitorTest.java   |   96 --
 .../functions/ConversionStatusMonitorTest.java  |   95 --
 .../VirtualApplianceDeployMonitorTest.java      |   99 --
 .../VirtualApplianceUndeployMonitorTest.java    |  100 --
 .../VirtualMachineDeployMonitorTest.java        |   97 --
 .../VirtualMachineStateMonitorTest.java         |   99 --
 .../VirtualMachineUndeployMonitorTest.java      |   98 --
 .../handlers/BlockingEventHandlerTest.java      |  107 --
 .../internal/BaseAsyncTaskMonitorTest.java      |   36 -
 .../BaseVirtualApplianceMonitorTest.java        |   38 -
 .../internal/BaseVirtualMachineMonitorTest.java |   37 -
 .../abiquo/reference/AbiquoTestConstants.java   |   29 -
 .../strategy/BaseAbiquoStrategyLiveApiTest.java |   28 -
 .../cloud/ListAttachedNicsLiveApiTest.java      |   91 --
 .../cloud/ListVirtualAppliancesLiveApiTest.java |   46 -
 .../ListVirtualDatacentersLiveApiTest.java      |   62 -
 .../ListVirtualMachineTemplatesLiveApiTest.java |   46 -
 .../infrastructure/ListMachinesLiveApiTest.java |   46 -
 .../java/org/jclouds/abiquo/util/Assert.java    |   76 -
 .../java/org/jclouds/abiquo/util/Config.java    |   65 -
 abiquo/src/test/resources/api-live.properties   |   41 -
 .../test/resources/filters/filters.properties   |   47 -
 abiquo/src/test/resources/license/expired       |   21 -
 abiquo/src/test/resources/logback-test.xml      |   94 --
 .../resources/payloads/all-vms-lastpage.xml     |   31 -
 abiquo/src/test/resources/payloads/all-vms.xml  |   31 -
 .../payloads/available-templates-lastpage.xml   |   43 -
 .../payloads/available-templates-page.xml       |   43 -
 .../resources/payloads/enterprises-lastpage.xml |   40 -
 .../resources/payloads/enterprises-page.xml     |   40 -
 .../test/resources/payloads/events-lastpage.xml |   40 -
 .../src/test/resources/payloads/events-page.xml |   40 -
 .../resources/payloads/externalips-lastpage.xml |   27 -
 .../resources/payloads/externalips-page.xml     |   27 -
 .../src/test/resources/payloads/nst-create.xml  |    5 -
 abiquo/src/test/resources/payloads/nst-edit.xml |    7 -
 abiquo/src/test/resources/payloads/nst-list.xml |   15 -
 .../resources/payloads/privateips-lastpage.xml  |   17 -
 .../test/resources/payloads/privateips-page.xml |   17 -
 .../payloads/publicips-available-lastpage.xml   |   29 -
 .../payloads/publicips-available-page.xml       |   29 -
 .../resources/payloads/publicips-lastpage.xml   |   25 -
 .../test/resources/payloads/publicips-page.xml  |   25 -
 .../payloads/publicips-purchased-lastpage.xml   |   29 -
 .../payloads/publicips-purchased-page.xml       |   29 -
 .../resources/payloads/templates-lastpage.xml   |   35 -
 .../test/resources/payloads/templates-page.xml  |   35 -
 .../payloads/unmanagedips-lastpage.xml          |   29 -
 .../resources/payloads/unmanagedips-page.xml    |   29 -
 .../test/resources/payloads/users-lastpage.xml  |   24 -
 .../src/test/resources/payloads/users-page.xml  |   39 -
 .../resources/payloads/vm-accepted-request.xml  |    4 -
 .../src/test/resources/payloads/vm-snapshot.xml |    4 -
 .../test/resources/payloads/vms-lastpage.xml    |   31 -
 abiquo/src/test/resources/payloads/vms-page.xml |   31 -
 .../resources/payloads/volumes-lastpage.xml     |   18 -
 .../test/resources/payloads/volumes-page.xml    |   18 -
 360 files changed, 116 insertions(+), 42918 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/README.md
----------------------------------------------------------------------
diff --git a/abiquo/README.md b/abiquo/README.md
deleted file mode 100644
index cdf6b84..0000000
--- a/abiquo/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-Jclouds Abiquo Provider
-=======================
-
-This is the jclouds Abiquo provider. It enables compute features for the Abiquo cloud platform.
-
-Detailed information about the Abiquo REST API can be found in the
-[Abiquo documentation page](http://community.abiquo.com).
-
-If you find any issue in the provider api, please submit it to the [Bug tracking system](http://jira.abiquo.com/browse/ABIQUOJC) and we will do our best to fix it.
-

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/pom.xml
----------------------------------------------------------------------
diff --git a/abiquo/pom.xml b/abiquo/pom.xml
index 5d07e09..3999eea 100644
--- a/abiquo/pom.xml
+++ b/abiquo/pom.xml
@@ -32,13 +32,11 @@
   <packaging>bundle</packaging>
   
   <properties>
-    <abiquomodel.version>2.3.0</abiquomodel.version>
-    <abiquoam.version>2.2.0</abiquoam.version>
     <test.abiquo.endpoint>http://localhost/api</test.abiquo.endpoint>
     <test.abiquo.identity>FIXME</test.abiquo.identity>
     <test.abiquo.credential>FIXME</test.abiquo.credential>
     <test.abiquo.api-version />
-    <test.abiquo.build-version />
+    <test.abiquo.template />
     <jclouds.osgi.export>org.jclouds.abiquo*;version="${project.version}"</jclouds.osgi.export>
     <jclouds.osgi.import>
       org.jclouds.labs*;version="${project.version}",
@@ -58,60 +56,10 @@
       <artifactId>jclouds-compute</artifactId>
       <version>${jclouds.version}</version>
     </dependency>
-    <!-- Abiquo -->
     <dependency>
-      <groupId>com.abiquo</groupId>
-      <artifactId>api-model-transport</artifactId>
-      <version>${abiquomodel.version}</version>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.ws.rs</groupId>
-          <artifactId>jsr311-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.uncommons</groupId>
-          <artifactId>reportng</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>com.abiquo</groupId>
-      <artifactId>am-model</artifactId>
-      <version>${abiquoam.version}</version>
-      <exclusions>
-        <exclusion>
-          <groupId>com.abiquo</groupId>
-          <artifactId>ovfmanager</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>javax.ws.rs</groupId>
-          <artifactId>jsr311-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.uncommons</groupId>
-          <artifactId>reportng</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <!-- Required for class SyndLink (imported form RESTLink) : TODO remove this dependency -->
-    <dependency>
-      <groupId>org.apache.wink</groupId>
-      <artifactId>wink-common</artifactId>
-      <version>1.1-incubating</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.slf4j</groupId>
-          <artifactId>slf4j-jdk14</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>javax.ws.rs</groupId>
-          <artifactId>jsr311-api</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>javax.xml.stream</groupId>
-          <artifactId>stax-api</artifactId>
-        </exclusion>
-      </exclusions>
+      <groupId>com.google.auto.value</groupId>
+      <artifactId>auto-value</artifactId>
+      <scope>provided</scope>
     </dependency>
     <!-- Test dependencies -->
     <dependency>
@@ -152,29 +100,6 @@
     </dependency>
   </dependencies>
   
-  <build>
-    <testResources>
-      <testResource>
-        <directory>src/test/resources</directory>
-        <filtering>true</filtering>
-      </testResource>
-    </testResources>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <excludes>
-            <exclude>**/*IntegrationTest.java</exclude>
-            <exclude>**/*LiveTest.java</exclude>
-            <exclude>**/*LiveApiTest.java</exclude>
-            <exclude>**/*LiveUcsTest.java</exclude>
-          </excludes>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  
   <profiles>
     <profile>
       <id>live</id>
@@ -191,51 +116,13 @@
                   <goal>test</goal>
                 </goals>
                 <configuration>
-                  <systemPropertyVariables>
-                    <test.abiquo.identity>${test.abiquo.idenfity}</test.abiquo.identity>
-                    <test.abiquo.credential>${test.abiquo.credential}</test.abiquo.credential>
-                    <test.abiquo.api-version>${test.abiquo.api-version}</test.abiquo.api-version>
-                    <test.abiquo.build-version>${test.abiquo.build-version}</test.abiquo.build-version>
-                  </systemPropertyVariables>
-                </configuration>
-              </execution>
-            </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-    <profile>
-      <id>api</id>
-      <build>
-        <filters>
-          <filter>src/test/resources/filters/filters.properties</filter>
-        </filters>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-surefire-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>integration</id>
-                <phase>integration-test</phase>
-                <goals>
-                  <goal>test</goal>
-                </goals>
-                <configuration>
-                  <!-- Infrastructure tests must not be executed in parallel.
-                       They modify concurrently the same infrastructure resources. -->
                   <threadCount>1</threadCount>
-                  <excludes>
-                    <exclude>none</exclude>
-                  </excludes>
-                  <includes>
-                    <include>**/*LiveApiTest.java</include>
-                  </includes>
                   <systemPropertyVariables>
+                    <test.abiquo.endpoint>${test.abiquo.endpoint}</test.abiquo.endpoint>
                     <test.abiquo.identity>${test.abiquo.identity}</test.abiquo.identity>
                     <test.abiquo.credential>${test.abiquo.credential}</test.abiquo.credential>
                     <test.abiquo.api-version>${test.abiquo.api-version}</test.abiquo.api-version>
-                    <test.abiquo.build-version>${test.abiquo.build-version}</test.abiquo.build-version>
+                    <test.abiquo.template>${test.abiquo.template}</test.abiquo.template>
                   </systemPropertyVariables>
                 </configuration>
               </execution>

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApi.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApi.java b/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApi.java
index 76bee9c..ff64686 100644
--- a/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApi.java
+++ b/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApi.java
@@ -18,106 +18,9 @@ package org.jclouds.abiquo;
 
 import java.io.Closeable;
 
-import javax.inject.Named;
-import javax.ws.rs.GET;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.binders.BindLinkToPathAndAcceptHeader;
-import org.jclouds.abiquo.features.AdminApi;
-import org.jclouds.abiquo.features.CloudApi;
-import org.jclouds.abiquo.features.ConfigApi;
-import org.jclouds.abiquo.features.EnterpriseApi;
-import org.jclouds.abiquo.features.EventApi;
-import org.jclouds.abiquo.features.InfrastructureApi;
-import org.jclouds.abiquo.features.TaskApi;
-import org.jclouds.abiquo.features.VirtualMachineTemplateApi;
-import org.jclouds.abiquo.http.filters.AbiquoAuthentication;
-import org.jclouds.abiquo.http.filters.AppendApiVersionToMediaType;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Delegate;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.RequestFilters;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.SingleResourceTransportDto;
-
 /**
- * Provides synchronous access to Abiquo.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/API+Reference">
- *      http://community.abiquo.com/display/ABI20/API+Reference</a>
+ * Provides access to Abiquo.
  */
-@RequestFilters({ AbiquoAuthentication.class, AppendApiVersionToMediaType.class })
 public interface AbiquoApi extends Closeable {
-   /**
-    * The version of the supported Abiquo API.
-    */
-   String API_VERSION = SingleResourceTransportDto.API_VERSION;
-
-   /**
-    * The supported build version of the Abiquo Api.
-    */
-   String BUILD_VERSION = "7bbfe95-158721b";
-
-   /**
-    * Provides synchronous access to Admin features.
-    */
-   @Delegate
-   AdminApi getAdminApi();
-
-   /**
-    * Provides synchronous access to Infrastructure features.
-    */
-   @Delegate
-   InfrastructureApi getInfrastructureApi();
-
-   /**
-    * Provides synchronous access to Cloud features.
-    */
-   @Delegate
-   CloudApi getCloudApi();
-
-   /**
-    * Provides synchronous access to Apps library features.
-    */
-   @Delegate
-   VirtualMachineTemplateApi getVirtualMachineTemplateApi();
-
-   /**
-    * Provides synchronous access to Enterprise features.
-    */
-   @Delegate
-   EnterpriseApi getEnterpriseApi();
-
-   /**
-    * Provides synchronous access to configuration features.
-    */
-   @Delegate
-   ConfigApi getConfigApi();
-
-   /**
-    * Provides synchronous access to task asynchronous features.
-    */
-   @Delegate
-   TaskApi getTaskApi();
-
-   /**
-    * Provides synchronous access to Event features.
-    */
-   @Delegate
-   EventApi getEventApi();
-
-   /**
-    * Perform a GET request to the given link.
-    * 
-    * @param link
-    *           The link to get.
-    * @return The response.
-    */
-   @Named("link:get")
-   @GET
-   @Fallback(NullOnNotFoundOr404.class)
-   HttpResponse get(@BinderParam(BindLinkToPathAndAcceptHeader.class) final RESTLink link);
 
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApiMetadata.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApiMetadata.java b/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApiMetadata.java
index 7320e59..98e2d18 100644
--- a/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApiMetadata.java
+++ b/abiquo/src/main/java/org/jclouds/abiquo/AbiquoApiMetadata.java
@@ -16,26 +16,24 @@
  */
 package org.jclouds.abiquo;
 
-import static org.jclouds.Constants.PROPERTY_MAX_REDIRECTS;
-import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY;
 import static org.jclouds.abiquo.config.AbiquoProperties.CREDENTIAL_TYPE;
 
 import java.net.URI;
 import java.util.Properties;
 
-import org.jclouds.abiquo.compute.config.AbiquoComputeServiceContextModule;
 import org.jclouds.abiquo.config.AbiquoAuthenticationModule;
 import org.jclouds.abiquo.config.AbiquoHttpApiModule;
-import org.jclouds.concurrent.config.ScheduledExecutorServiceModule;
+import org.jclouds.apis.ApiMetadata;
 import org.jclouds.rest.internal.BaseHttpApiMetadata;
 
-import com.google.common.base.CharMatcher;
+import com.google.auto.service.AutoService;
 import com.google.common.collect.ImmutableSet;
 import com.google.inject.Module;
 
 /**
  * Implementation of {@link ApiMetadata} for Abiquo API.
  */
+@AutoService(ApiMetadata.class)
 public class AbiquoApiMetadata extends BaseHttpApiMetadata<AbiquoApi> {
 
    public AbiquoApiMetadata() {
@@ -53,34 +51,26 @@ public class AbiquoApiMetadata extends BaseHttpApiMetadata<AbiquoApi> {
 
    public static Properties defaultProperties() {
       Properties properties = BaseHttpApiMetadata.defaultProperties();
-      // By default redirects will be handled in the domain objects
-      properties.setProperty(PROPERTY_MAX_REDIRECTS, "0");
-      // The default polling delay between AsyncTask monitor requests
-      properties.setProperty(ASYNC_TASK_MONITOR_DELAY, "5000");
       // By default the provided credential is not a token
       properties.setProperty(CREDENTIAL_TYPE, "password");
       return properties;
    }
 
    public static class Builder extends BaseHttpApiMetadata.Builder<AbiquoApi, Builder> {
-      private static final String DOCUMENTATION_ROOT = "http://community.abiquo.com/display/ABI"
-            + CharMatcher.DIGIT.retainFrom(AbiquoApi.API_VERSION);
 
       protected Builder() {
          id("abiquo")
                .name("Abiquo API")
                .identityName("API Username")
                .credentialName("API Password")
-               .documentation(URI.create(DOCUMENTATION_ROOT + "/API+Reference"))
+               .documentation(URI.create("http://wiki.abiquo.com/display/ABI32/Api+Reference"))
                .defaultEndpoint("http://localhost/api")
-               .version(AbiquoApi.API_VERSION)
-               .buildVersion(AbiquoApi.BUILD_VERSION)
-               .view(AbiquoContext.class)
+               .version("3.2")
+               // .view(ComputeServiceContext.class)
                .defaultProperties(AbiquoApiMetadata.defaultProperties())
                .defaultModules(
                      ImmutableSet.<Class<? extends Module>> of(AbiquoHttpApiModule.class,
-                           AbiquoAuthenticationModule.class, AbiquoComputeServiceContextModule.class,
-                           ScheduledExecutorServiceModule.class));
+                           AbiquoAuthenticationModule.class));
       }
 
       @Override
@@ -92,7 +82,6 @@ public class AbiquoApiMetadata extends BaseHttpApiMetadata<AbiquoApi> {
       protected Builder self() {
          return this;
       }
-
    }
 
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/AbiquoContext.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/AbiquoContext.java b/abiquo/src/main/java/org/jclouds/abiquo/AbiquoContext.java
deleted file mode 100644
index 853a56a..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/AbiquoContext.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo;
-
-import org.jclouds.abiquo.features.services.AdministrationService;
-import org.jclouds.abiquo.features.services.CloudService;
-import org.jclouds.abiquo.features.services.EventService;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.internal.AbiquoContextImpl;
-import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.rest.ApiContext;
-
-import com.google.inject.ImplementedBy;
-
-/**
- * Abiquo {@link ComputeServiceContext} implementation to expose high level
- * Abiquo functionalities.
- */
-@ImplementedBy(AbiquoContextImpl.class)
-public interface AbiquoContext extends ComputeServiceContext {
-   /**
-    * Returns the Abiquo API context, providing direct access to the Abiquo Rest
-    * API.
-    * 
-    * @return The Abiquo API context.
-    */
-   ApiContext<AbiquoApi> getApiContext();
-
-   /**
-    * Returns the administration service.
-    * <p>
-    * This service provides an entry point to infrastructure administration
-    * tasks.
-    */
-   AdministrationService getAdministrationService();
-
-   /**
-    * Returns the cloud service.
-    * <p>
-    * This service provides an entry point to cloud management tasks.
-    */
-   CloudService getCloudService();
-
-   /**
-    * Returns the monitoring service.
-    * <p>
-    * This service provides an entry point to asynchronous task monitoring
-    * tasks.
-    */
-   MonitoringService getMonitoringService();
-
-   /**
-    * Returns the event service.
-    * <p>
-    * This service provides an entry point to event management tasks.
-    */
-   EventService getEventService();
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/AbiquoFallbacks.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/AbiquoFallbacks.java b/abiquo/src/main/java/org/jclouds/abiquo/AbiquoFallbacks.java
deleted file mode 100644
index c4abdea..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/AbiquoFallbacks.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo;
-
-import static com.google.common.base.Throwables.getCausalChain;
-import static com.google.common.base.Throwables.propagate;
-import static com.google.common.collect.Iterables.find;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.Fallback;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.HttpResponseException;
-import org.jclouds.rest.ResourceNotFoundException;
-
-import com.google.common.base.Predicate;
-
-/**
- * fallbacks common to abiquo
- */
-public final class AbiquoFallbacks {
-   private AbiquoFallbacks() {
-   }
-
-   /**
-    * Return an Abiquo Exception on not found errors.
-    */
-   public static final class PropagateAbiquoExceptionOnNotFoundOr4xx implements Fallback<Object> {
-      @Override
-      public Object createOrPropagate(Throwable from) throws Exception {
-         Throwable exception = find(getCausalChain(from), isNotFoundAndHasAbiquoException(from), null);
-         throw propagate(exception == null ? from : exception.getCause());
-      }
-   }
-
-   /**
-    * Return <code>null</code> on 303 response codes when requesting a task.
-    */
-   public static final class NullOn303 implements Fallback<Object> {
-      @Override
-      public Object createOrPropagate(Throwable from) throws Exception {
-         Throwable exception = find(getCausalChain(from), hasResponse(from), null);
-
-         if (exception != null) {
-            HttpResponseException responseException = (HttpResponseException) exception;
-            HttpResponse response = responseException.getResponse();
-
-            if (response != null && response.getStatusCode() == Status.SEE_OTHER.getStatusCode()) {
-               return null;
-            }
-         }
-
-         throw propagate(from);
-      }
-
-   }
-
-   /**
-    * Return false on service error exceptions.
-    */
-   public static final class FalseOn5xx implements Fallback<Boolean> {
-      @Override
-      public Boolean createOrPropagate(Throwable from) throws Exception {
-         Throwable exception = find(getCausalChain(from), hasResponse(from), null);
-
-         if (exception != null) {
-            HttpResponseException responseException = (HttpResponseException) exception;
-            HttpResponse response = responseException.getResponse();
-
-            if (response != null && response.getStatusCode() >= 500 && response.getStatusCode() < 600) {
-               return false;
-            }
-         }
-
-         throw propagate(from);
-      }
-
-   }
-
-   /**
-    * Return false on service error exceptions.
-    */
-   public static final class FalseIfNotAvailable implements Fallback<Boolean> {
-      @Override
-      public Boolean createOrPropagate(Throwable from) throws Exception {
-         Throwable exception = find(getCausalChain(from), isNotAvailableException(from), null);
-
-         if (exception != null) {
-            if (exception instanceof HttpResponseException) {
-               HttpResponseException responseException = (HttpResponseException) exception;
-               HttpResponse response = responseException.getResponse();
-
-               if (response != null && response.getStatusCode() >= 500 && response.getStatusCode() < 600) {
-                  return false;
-               }
-            } else {
-               // Will enter here when exception is a ResourceNotFoundException
-               return false;
-            }
-         }
-
-         throw propagate(from);
-      }
-
-   }
-
-   private static Predicate<Throwable> isNotFoundAndHasAbiquoException(final Throwable exception) {
-      return new Predicate<Throwable>() {
-         @Override
-         public boolean apply(final Throwable input) {
-            return input instanceof ResourceNotFoundException && input.getCause() instanceof AbiquoException;
-         }
-      };
-   }
-
-   private static Predicate<Throwable> isNotAvailableException(final Throwable exception) {
-      return new Predicate<Throwable>() {
-         @Override
-         public boolean apply(final Throwable input) {
-            boolean notAvailable = input instanceof HttpResponseException
-                  && ((HttpResponseException) input).getResponse() != null;
-
-            notAvailable |= input instanceof ResourceNotFoundException;
-
-            return notAvailable;
-         }
-      };
-   }
-
-   private static Predicate<Throwable> hasResponse(final Throwable exception) {
-      return new Predicate<Throwable>() {
-         @Override
-         public boolean apply(final Throwable input) {
-            return input instanceof HttpResponseException && ((HttpResponseException) input).getResponse() != null;
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/AppendToPath.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/AppendToPath.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/AppendToPath.java
deleted file mode 100644
index 5b807b7..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/AppendToPath.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.Binder;
-
-/**
- * Appends the parameter value to the end of the request URI.
- */
-@Singleton
-public class AppendToPath implements Binder {
-   @SuppressWarnings("unchecked")
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
-      // Append the parameter to the request URI
-      String valueToAppend = getValue(request, checkNotNull(input, "input"));
-      URI path = URI.create(request.getEndpoint().toString() + "/" + valueToAppend);
-      return (R) request.toBuilder().endpoint(path).build();
-   }
-
-   /**
-    * Get the value that will be appended to the request URI.
-    */
-   protected <R extends HttpRequest> String getValue(final R request, final Object input) {
-      return input.toString();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/BindLinkToPath.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/BindLinkToPath.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/BindLinkToPath.java
deleted file mode 100644
index c36d6c1..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/BindLinkToPath.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Singleton;
-
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import com.abiquo.model.rest.RESTLink;
-
-/**
- * Binds the given link to the uri.
- */
-@Singleton
-public class BindLinkToPath extends BindToPath {
-
-   @Override
-   protected String getNewEndpoint(final GeneratedHttpRequest gRequest, final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof RESTLink, "this binder is only valid for RESTLink objects");
-
-      return ((RESTLink) input).getHref();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/BindLinkToPathAndAcceptHeader.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/BindLinkToPathAndAcceptHeader.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/BindLinkToPathAndAcceptHeader.java
deleted file mode 100644
index c18e67f..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/BindLinkToPathAndAcceptHeader.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpRequest;
-
-import com.abiquo.model.rest.RESTLink;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.net.HttpHeaders;
-
-/**
- * Binds the given link to the uri and the Accept header.
- */
-@Singleton
-public class BindLinkToPathAndAcceptHeader extends BindLinkToPath {
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
-      R updatedRequest = super.bindToRequest(request, input);
-      return addHeader(updatedRequest, HttpHeaders.ACCEPT, ((RESTLink) input).getType());
-   }
-
-   @SuppressWarnings("unchecked")
-   @VisibleForTesting
-   <R extends HttpRequest> R addHeader(final R request, final String header, final String value) {
-      return (R) request.toBuilder().replaceHeader(HttpHeaders.ACCEPT, checkNotNull(value, "value")).build();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/BindRefsToPayload.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/BindRefsToPayload.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/BindRefsToPayload.java
deleted file mode 100644
index ccd74da..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/BindRefsToPayload.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.binders.BindToXMLPayload;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.model.transport.SingleResourceTransportDto;
-
-/**
- * Bind multiple objects to the payload of the request as a list of links.
- */
-public abstract class BindRefsToPayload extends BindToXMLPayload {
-   @Inject
-   public BindRefsToPayload(final XMLParser xmlParser) {
-      super(xmlParser);
-   }
-
-   protected abstract String getRelToUse(final Object input);
-
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof SingleResourceTransportDto[],
-            "this binder is only valid for SingleResourceTransportDto arrays");
-
-      SingleResourceTransportDto[] dtos = (SingleResourceTransportDto[]) input;
-      LinksDto refs = new LinksDto();
-
-      for (SingleResourceTransportDto dto : dtos) {
-         RESTLink editLink = checkNotNull(dto.getEditLink(), "entity must have an edit link");
-
-         // Do not add repeated references
-         if (refs.searchLinkByHref(editLink.getHref()) == null) {
-            refs.addLink(new RESTLink(getRelToUse(input), editLink.getHref()));
-         }
-      }
-
-      return super.bindToRequest(request, refs);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/BindToPath.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/BindToPath.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/BindToPath.java
deleted file mode 100644
index 7611f8c..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/BindToPath.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import java.lang.annotation.Annotation;
-import java.net.URI;
-import java.util.Arrays;
-
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.rest.annotations.EndpointLink;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.Binder;
-import org.jclouds.rest.binders.BindException;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.SingleResourceTransportDto;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
-
-/**
- * Binds the given object to the path..
- */
-@Singleton
-public class BindToPath implements Binder {
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
-      checkArgument(checkNotNull(request, "request") instanceof GeneratedHttpRequest,
-            "this binder is only valid for GeneratedHttpRequests");
-      GeneratedHttpRequest gRequest = (GeneratedHttpRequest) request;
-      checkState(gRequest.getInvocation().getArgs() != null, "args should be initialized at this point");
-
-      // Update the request URI with the configured link URI
-      String newEndpoint = getNewEndpoint(gRequest, input);
-      return bindToPath(request, newEndpoint);
-   }
-
-   /**
-    * Get the new endpoint to use.
-    * 
-    * @param gRequest
-    *           The request.
-    * @param input
-    *           The input parameter.
-    * @return The new endpoint to use.
-    */
-   protected String getNewEndpoint(final GeneratedHttpRequest gRequest, final Object input) {
-      SingleResourceTransportDto dto = checkValidInput(input);
-      return getLinkToUse(gRequest, dto).getHref();
-   }
-
-   /**
-    * Get the link to be used to build the request URI.
-    * 
-    * @param request
-    *           The current request.
-    * @param payload
-    *           The object containing the link.
-    * @return The link to be used to build the request URI.
-    */
-   static RESTLink getLinkToUse(final GeneratedHttpRequest request, final SingleResourceTransportDto payload) {
-      int argIndex = request.getInvocation().getArgs().indexOf(payload);
-      Annotation[] annotations = request.getInvocation().getInvokable().getParameters().get(argIndex).getAnnotations();
-
-      EndpointLink linkName = (EndpointLink) Iterables.find(Arrays.asList(annotations),
-            Predicates.instanceOf(EndpointLink.class), null);
-
-      if (linkName == null) {
-         throw new BindException(request, "Expected a EndpointLink annotation but not found in the parameter");
-      }
-
-      return checkNotNull(payload.searchLink(linkName.value()), "No link was found in object with rel: " + linkName);
-   }
-
-   /**
-    * Bind the given link to the request URI.
-    * 
-    * @param request
-    *           The request to modify.
-    * @param endpoint
-    *           The endpoint to use as the request URI.
-    * @return The updated request.
-    */
-   @SuppressWarnings("unchecked")
-   static <R extends HttpRequest> R bindToPath(final R request, final String endpoint) {
-      // Preserve current query parameters
-      String newEndpoint = endpoint + getParameterString(request);
-
-      // Replace the URI with the edit link in the DTO
-      URI path = URI.create(newEndpoint);
-      return (R) request.toBuilder().endpoint(path).build();
-   }
-
-   protected static SingleResourceTransportDto checkValidInput(final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof SingleResourceTransportDto,
-            "this binder is only valid for SingleResourceTransportDto objects");
-
-      return (SingleResourceTransportDto) input;
-   }
-
-   protected static <R extends HttpRequest> String getParameterString(final R request) {
-      String endpoint = request.getEndpoint().toString();
-
-      int query = endpoint.indexOf('?');
-
-      if (query == -1) {
-         // No parameters
-         return "";
-      } else {
-         // Only request parameters
-         return endpoint.substring(query);
-      }
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/BindToXMLPayloadAndPath.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/BindToXMLPayloadAndPath.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/BindToXMLPayloadAndPath.java
deleted file mode 100644
index 1b7c65e..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/BindToXMLPayloadAndPath.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.binders.BindToXMLPayload;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.transport.SingleResourceTransportDto;
-
-/**
- * Binds the given object to the payload and extracts the path parameters from
- * the edit link.
- * <p>
- * This method should be used in {@link PUT} methods to automatically extract
- * the path parameters from the edit link of the updated object.
- */
-@Singleton
-public class BindToXMLPayloadAndPath extends BindToXMLPayload {
-   @Inject
-   public BindToXMLPayloadAndPath(final XMLParser xmlParser) {
-      super(xmlParser);
-   }
-
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object payload) {
-      checkArgument(checkNotNull(request, "request") instanceof GeneratedHttpRequest,
-            "this binder is only valid for GeneratedHttpRequests");
-      GeneratedHttpRequest gRequest = (GeneratedHttpRequest) request;
-      checkState(gRequest.getInvocation().getArgs() != null, "args should be initialized at this point");
-
-      // Update the request URI with the configured link URI
-      String newEndpoint = getNewEndpoint(gRequest, payload);
-      R updatedRequest = BindToPath.bindToPath(request, newEndpoint);
-
-      // Add the payload
-      return super.bindToRequest(updatedRequest, payload);
-   }
-
-   /**
-    * Get the new endpoint to use.
-    * 
-    * @param gRequest
-    *           The request.
-    * @param input
-    *           The input parameter.
-    * @return The new endpoint to use.
-    */
-   protected String getNewEndpoint(final GeneratedHttpRequest gRequest, final Object input) {
-      SingleResourceTransportDto dto = BindToPath.checkValidInput(input);
-      return BindToPath.getLinkToUse(gRequest, dto).getHref();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindHardDiskRefsToPayload.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindHardDiskRefsToPayload.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindHardDiskRefsToPayload.java
deleted file mode 100644
index 396606c..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindHardDiskRefsToPayload.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.binders.BindRefsToPayload;
-import org.jclouds.xml.XMLParser;
-
-/**
- * Bind multiple {@link DiskManagementDto} objects to the payload of the request
- * as a list of links.
- */
-@Singleton
-public class BindHardDiskRefsToPayload extends BindRefsToPayload {
-   @Inject
-   public BindHardDiskRefsToPayload(final XMLParser xmlParser) {
-      super(xmlParser);
-   }
-
-   @Override
-   protected String getRelToUse(final Object input) {
-      return "disk";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindIpRefToPayload.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindIpRefToPayload.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindIpRefToPayload.java
deleted file mode 100644
index 9f0df3c..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindIpRefToPayload.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.binders.BindToXMLPayload;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.network.AbstractIpDto;
-
-/**
- * Bind the link reference to an {@link AbstractIpDto} object into the payload.
- */
-@Singleton
-public class BindIpRefToPayload extends BindToXMLPayload {
-   @Inject
-   public BindIpRefToPayload(final XMLParser xmlParser) {
-      super(xmlParser);
-   }
-
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof AbstractIpDto,
-            "this binder is only valid for AbstractIpDto objects");
-
-      AbstractIpDto ip = (AbstractIpDto) input;
-      RESTLink selfLink = checkNotNull(ip.searchLink("self"), "AbstractIpDto must have an self link");
-
-      LinksDto refs = new LinksDto();
-      refs.addLink(new RESTLink(selfLink.getTitle(), selfLink.getHref()));
-
-      return super.bindToRequest(request, refs);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindIpRefsToPayload.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindIpRefsToPayload.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindIpRefsToPayload.java
deleted file mode 100644
index 4b106d6..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindIpRefsToPayload.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.util.LinkUtils;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.binders.BindToXMLPayload;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.network.AbstractIpDto;
-
-/**
- * Bind the link reference to an {@link AbstractIpDto} object into the payload.
- */
-@Singleton
-public class BindIpRefsToPayload extends BindToXMLPayload {
-   @Inject
-   public BindIpRefsToPayload(final XMLParser xmlParser) {
-      super(xmlParser);
-   }
-
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof AbstractIpDto[],
-            "this binder is only valid for AbstractIpDto arrays");
-
-      AbstractIpDto[] ips = (AbstractIpDto[]) input;
-      LinksDto refs = new LinksDto();
-
-      for (AbstractIpDto ip : ips) {
-         RESTLink selfLink = checkNotNull(LinkUtils.getSelfLink(ip), "AbstractIpDto must have an edit or self link");
-         if (refs.searchLinkByHref(selfLink.getHref()) == null) {
-            RESTLink ref = new RESTLink(selfLink.getTitle(), selfLink.getHref());
-            ref.setType(selfLink.getType());
-            refs.addLink(ref);
-         }
-      }
-
-      return super.bindToRequest(request, refs);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPath.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPath.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPath.java
deleted file mode 100644
index 8cd5bc6..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPath.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.binders.BindToPath;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-
-/**
- * Binds the move volume action to the request endpoint.
- */
-public class BindMoveVolumeToPath extends BindToPath {
-
-   @Override
-   protected String getNewEndpoint(final GeneratedHttpRequest gRequest, final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof VolumeManagementDto,
-            "this binder is only valid for VolumeManagementDto objects");
-
-      VolumeManagementDto volume = (VolumeManagementDto) input;
-      RESTLink editLink = checkNotNull(volume.getEditLink(), "VolumeManagementDto must have an edit link");
-
-      return editLink.getHref() + "/action/move";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayload.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayload.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayload.java
deleted file mode 100644
index aa0e8ff..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayload.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.binders.BindToXMLPayload;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.cloud.VirtualMachineDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
-
-/**
- * Bind multiple objects to the payload of the request as a list of links.
- */
-@Singleton
-public class BindNetworkConfigurationRefToPayload extends BindToXMLPayload {
-   @Inject
-   public BindNetworkConfigurationRefToPayload(final XMLParser xmlParser) {
-      super(xmlParser);
-   }
-
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
-      checkArgument(checkNotNull(request, "request") instanceof GeneratedHttpRequest,
-            "this binder is only valid for GeneratedHttpRequests");
-      checkArgument(checkNotNull(input, "input") instanceof VLANNetworkDto,
-            "this binder is only valid for VLANNetworkDto");
-      GeneratedHttpRequest gRequest = (GeneratedHttpRequest) request;
-      checkState(gRequest.getInvocation().getArgs() != null, "args should be initialized at this point");
-
-      VLANNetworkDto network = (VLANNetworkDto) input;
-      VirtualMachineDto vm = (VirtualMachineDto) Iterables.find(gRequest.getInvocation().getArgs(),
-            Predicates.instanceOf(VirtualMachineDto.class));
-
-      RESTLink configLink = checkNotNull(vm.searchLink("configurations"), "missing required link");
-
-      LinksDto dto = new LinksDto();
-      dto.addLink(new RESTLink("network_configuration", configLink.getHref() + "/" + network.getId()));
-
-      return super.bindToRequest(request, dto);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindNetworkRefToPayload.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindNetworkRefToPayload.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindNetworkRefToPayload.java
deleted file mode 100644
index 0daaacc..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindNetworkRefToPayload.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.binders.BindToXMLPayload;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-
-/**
- * Bind the link reference to an {@link VLANNetworkDto} object into the payload.
- */
-@Singleton
-public class BindNetworkRefToPayload extends BindToXMLPayload {
-   @Inject
-   public BindNetworkRefToPayload(final XMLParser xmlParser) {
-      super(xmlParser);
-   }
-
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof VLANNetworkDto,
-            "this binder is only valid for VLANNetworkDto objects");
-
-      VLANNetworkDto network = (VLANNetworkDto) input;
-      RESTLink editLink = checkNotNull(network.getEditLink(), "VLANNetworkDto must have an edit link");
-
-      LinksDto refs = new LinksDto();
-      switch (network.getType()) {
-         case INTERNAL:
-            refs.addLink(new RESTLink("internalnetwork", editLink.getHref()));
-            break;
-         case EXTERNAL:
-            refs.addLink(new RESTLink("externalnetwork", editLink.getHref()));
-            break;
-         case PUBLIC:
-            refs.addLink(new RESTLink("publicnetwork", editLink.getHref()));
-            break;
-         case UNMANAGED:
-            refs.addLink(new RESTLink("unmanagednetwork", editLink.getHref()));
-            break;
-         default:
-            // TODO: EXTERNAL_UNMANAGED network type
-            throw new IllegalArgumentException("Unsupported network type");
-      }
-
-      return super.bindToRequest(request, refs);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindUnmanagedIpRefToPayload.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindUnmanagedIpRefToPayload.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindUnmanagedIpRefToPayload.java
deleted file mode 100644
index ce9364f..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindUnmanagedIpRefToPayload.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.binders.BindToXMLPayload;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-
-/**
- * Bind the link reference to an {@link AbstractIpDto} object into the payload.
- */
-@Singleton
-public class BindUnmanagedIpRefToPayload extends BindToXMLPayload {
-   @Inject
-   public BindUnmanagedIpRefToPayload(final XMLParser xmlParser) {
-      super(xmlParser);
-   }
-
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof VLANNetworkDto,
-            "this binder is only valid for VLANNetworkDto objects");
-
-      VLANNetworkDto network = (VLANNetworkDto) input;
-      checkArgument(network.getType() == NetworkType.UNMANAGED, "this binder is only valid for UNMANAGED networks");
-
-      RESTLink ipsLink = checkNotNull(network.searchLink("ips"), "VLANNetworkDto must have an ips link");
-
-      LinksDto refs = new LinksDto();
-      refs.addLink(new RESTLink("unmanagedip", ipsLink.getHref()));
-
-      return super.bindToRequest(request, refs);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindVirtualDatacenterRefToPayload.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindVirtualDatacenterRefToPayload.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindVirtualDatacenterRefToPayload.java
deleted file mode 100644
index d3ee835..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindVirtualDatacenterRefToPayload.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.http.HttpRequest;
-import org.jclouds.rest.binders.BindToXMLPayload;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-
-/**
- * Bind multiple {@link VolumeManagementDto} objects to the payload of the
- * request as a list of links.
- */
-@Singleton
-public class BindVirtualDatacenterRefToPayload extends BindToXMLPayload {
-   @Inject
-   public BindVirtualDatacenterRefToPayload(final XMLParser xmlParser) {
-      super(xmlParser);
-   }
-
-   @Override
-   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
-      checkArgument(checkNotNull(input, "input") instanceof VirtualDatacenterDto,
-            "this binder is only valid for VirtualDatacenterDto objects");
-
-      VirtualDatacenterDto vdc = (VirtualDatacenterDto) input;
-      RESTLink editLink = checkNotNull(vdc.getEditLink(), "VirtualDatacenterDto must have an edit link");
-      LinksDto refs = new LinksDto();
-      refs.addLink(new RESTLink("virtualdatacenter", editLink.getHref()));
-
-      return super.bindToRequest(request, refs);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindVolumeRefsToPayload.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindVolumeRefsToPayload.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindVolumeRefsToPayload.java
deleted file mode 100644
index 28c7c8b..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/cloud/BindVolumeRefsToPayload.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.binders.BindRefsToPayload;
-import org.jclouds.xml.XMLParser;
-
-/**
- * Bind multiple {@link VolumeManagementDto} objects to the payload of the
- * request as a list of links.
- */
-@Singleton
-public class BindVolumeRefsToPayload extends BindRefsToPayload {
-   @Inject
-   public BindVolumeRefsToPayload(final XMLParser xmlParser) {
-      super(xmlParser);
-   }
-
-   @Override
-   protected String getRelToUse(final Object input) {
-      return "volume";
-   }
-
-}


[09/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/admin/RoleLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/admin/RoleLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/admin/RoleLiveApiTest.java
deleted file mode 100644
index 2383be0..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/admin/RoleLiveApiTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.admin;
-
-import static com.google.common.collect.Iterables.find;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.fail;
-
-import java.util.List;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.config.Privilege;
-import org.jclouds.abiquo.domain.enterprise.Role;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.enterprise.PrivilegeDto;
-import com.abiquo.server.core.enterprise.RoleDto;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Lists;
-
-/**
- * Live integration tests for the {@link Role} domain class.
- */
-@Test(groups = "api", testName = "RoleLiveApiTest")
-public class RoleLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   public void testUpdate() {
-      Role role = Role.builder(env.context.getApiContext()).name("dummyRoleUpdateRole").blocked(false).build();
-      role.save();
-
-      role.setName("UPDATED_ROLE");
-      role.update();
-
-      // Recover the updated role
-      RoleDto updated = env.adminApi.getRole(role.getId());
-
-      assertEquals(updated.getName(), "UPDATED_ROLE");
-
-      role.delete();
-   }
-
-   public void testCreateRepeated() {
-      Role repeated = Role.Builder.fromRole(env.role).build();
-
-      try {
-         repeated.save();
-         fail("Should not be able to create roles with the same name");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "ROLE-7");
-      }
-   }
-
-   public void testCreateEnterpriseRole() {
-      final Role entRole = Role.Builder.fromRole(env.role).build();
-      entRole.setName(entRole.getName() + "enterprise");
-      entRole.setEnterprise(env.enterprise);
-      entRole.save();
-
-      find(env.enterprise.listRoles(), new Predicate<Role>() {
-         @Override
-         public boolean apply(Role input) {
-            return input.getName().equals(entRole.getName());
-         }
-      });
-   }
-
-   public void testAddPrivilege() {
-      PrivilegeDto dto = env.configApi.getPrivilege(8);
-      final Privilege privilege = DomainWrapper.wrap(env.context.getApiContext(), Privilege.class, dto);
-      List<Privilege> privileges = Lists.newArrayList(env.role.listPrivileges());
-      privileges.add(privilege);
-
-      env.role.setPrivileges(privileges);
-      env.role.update();
-
-      find(env.role.listPrivileges(), new Predicate<Privilege>() {
-         @Override
-         public boolean apply(Privilege input) {
-            return input.getName().equals(privilege.getName());
-         }
-      });
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/AccountLiveTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/AccountLiveTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/AccountLiveTest.java
deleted file mode 100644
index c18201a..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/AccountLiveTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.internal.BaseAbiquoLiveApiTest;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-/**
- * Live integration tests
- */
-@Test(groups = "live", testName = "AccountLiveTest")
-public class AccountLiveTest extends BaseAbiquoLiveApiTest {
-
-   private Enterprise enterprise;
-
-   @BeforeClass(groups = { "integration", "live" })
-   @Override
-   public void setupContext() {
-      super.setupContext();
-      enterprise = view.getAdministrationService().getCurrentEnterprise();
-   }
-
-   public void testGetCurrentUser() {
-      assertEquals(view.getAdministrationService().getCurrentUser().getNick(), view.getApiContext().getIdentity());
-   }
-
-   public void testAllowedDatacenters() {
-      assertTrue(size(enterprise.listAllowedDatacenters()) > 0);
-   }
-
-   public void testAvailableTemplates() {
-      assertTrue(size(enterprise.listTemplates()) > 0);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/HardDiskLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/HardDiskLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/HardDiskLiveApiTest.java
deleted file mode 100644
index d23b60b..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/HardDiskLiveApiTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.SkipException;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.HypervisorType;
-
-/**
- * Live integration tests for the {@link HardDisk} domain class.
- */
-@Test(groups = "api", testName = "HardDiskLiveApiTest")
-public class HardDiskLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   private HardDisk hardDisk;
-
-   public void createHardDisk() {
-      skipIfUnsupported();
-
-      hardDisk = HardDisk.builder(env.context.getApiContext(), env.virtualDatacenter).sizeInMb(64L).build();
-      hardDisk.save();
-
-      assertNotNull(hardDisk.getId());
-      assertNotNull(hardDisk.getSequence());
-
-      assertNotNull(env.virtualDatacenter.getHardDisk(hardDisk.getId()));
-   }
-
-   @Test(dependsOnMethods = "createHardDisk")
-   public void deleteHardDisk() {
-      skipIfUnsupported();
-
-      HardDisk hd = env.virtualDatacenter.getHardDisk(hardDisk.getId());
-      assertNotNull(hd);
-
-      Integer id = hd.getId();
-      hardDisk.delete();
-      assertNull(env.virtualDatacenter.getHardDisk(id));
-   }
-
-   protected static void skipIfUnsupported() {
-      if (!env.machine.getType().equals(HypervisorType.VMX_04)) {
-         throw new SkipException(
-               "Cannot perform this test because hard disk actions are not available for this hypervisor");
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveApiTest.java
deleted file mode 100644
index 666ec6c..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveApiTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.List;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualApplianceState;
-import com.google.common.collect.Lists;
-
-/**
- * Live integration tests for the {@link VirtualAppliance} domain class.
- */
-@Test(groups = "api", testName = "VirtualApplianceLiveApiTest")
-public class VirtualApplianceLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   public void testUpdate() {
-      env.virtualAppliance.setName("Virtual AppAloha updated");
-      env.virtualAppliance.update();
-
-      // Recover the updated virtual appliance
-      VirtualApplianceDto updated = env.cloudApi.getVirtualAppliance(env.virtualDatacenter.unwrap(),
-            env.virtualAppliance.getId());
-
-      assertEquals(updated.getName(), "Virtual AppAloha updated");
-   }
-
-   public void testCreateRepeated() {
-      VirtualAppliance repeated = VirtualAppliance.Builder.fromVirtualAppliance(env.virtualAppliance).build();
-
-      repeated.save();
-
-      List<VirtualApplianceDto> virtualAppliances = env.cloudApi.listVirtualAppliances(env.virtualDatacenter.unwrap())
-            .getCollection();
-
-      assertEquals(virtualAppliances.size(), 2);
-      repeated.delete();
-   }
-
-   public void testGetState() {
-      assertEquals(env.virtualAppliance.getState(), VirtualApplianceState.NOT_DEPLOYED);
-   }
-
-   public void testListVirtualMachinesReturnsAll() {
-      List<VirtualMachine> vms = Lists.newArrayList();
-
-      // Pagination by default is set to 25 items per page, so create a few more
-      // to verify that
-      // all are returned when listing
-      int numVms = 30;
-
-      for (int i = 0; i < numVms; i++) {
-         VirtualMachine vm = VirtualMachine.Builder.fromVirtualMachine(env.virtualMachine).build();
-         vm.save();
-         vms.add(vm);
-      }
-
-      try {
-         Iterable<VirtualMachine> all = env.virtualAppliance.listVirtualMachines();
-
-         assertNotNull(all);
-         assertTrue(size(all) >= numVms);
-      } finally {
-         for (VirtualMachine vm : vms) {
-            vm.delete();
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveTest.java
deleted file mode 100644
index bb833e1..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualApplianceLiveTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.getLast;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-
-import java.util.concurrent.TimeUnit;
-
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.internal.BaseAbiquoLiveApiTest;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualApplianceState;
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Ordering;
-import com.google.common.primitives.Longs;
-
-/**
- * Live integration tests for the {@link VirtualAppliance} domain class.
- */
-@Test(groups = "live", testName = "VirtualApplianceLiveTest")
-public class VirtualApplianceLiveTest extends BaseAbiquoLiveApiTest {
-   private static final long MAX_WAIT = 2;
-
-   private VirtualDatacenter vdc;
-
-   private VirtualAppliance vapp;
-
-   private VirtualMachine vm;
-
-   private VirtualMachineTemplate vmt;
-
-   private MonitoringService monitoringService;
-
-   @BeforeClass(groups = { "integration", "live" })
-   @Override
-   public void setupContext() {
-      super.setupContext();
-      monitoringService = view.getMonitoringService();
-      vdc = getLast(view.getCloudService().listVirtualDatacenters());
-      vmt = templateBySize().min(vdc.listAvailableTemplates());
-   }
-
-   public void testCreateVirtualAppliance() {
-      vapp = VirtualAppliance.builder(view.getApiContext(), vdc).name(PREFIX + "Virtual Appliance Ohana").build();
-      vapp.save();
-
-      assertNotNull(vapp.getId());
-   }
-
-   @Test(dependsOnMethods = "testCreateVirtualAppliance")
-   public void testUpdateVirtualAppliance() {
-      vapp.setName(PREFIX + "Virtual Appliance Updated");
-      vapp.update();
-
-      // Reload the appliance to check the updated name
-      VirtualAppliance updated = vdc.getVirtualAppliance(vapp.getId());
-      assertEquals(updated.getName(), PREFIX + "Virtual Appliance Updated");
-   }
-
-   @Test(dependsOnMethods = "testUpdateVirtualAppliance")
-   public void testDeployVirtualAppliance() {
-      vm = VirtualMachine.builder(view.getApiContext(), vapp, vmt).cpu(1).nameLabel(PREFIX + "VM Makua").ram(128)
-            .build();
-
-      vm.save();
-      assertNotNull(vm.getId());
-
-      VirtualMachineTask[] tasks = vapp.deploy();
-      assertEquals(tasks.length, 1); // One task for each VM in the VAPP
-
-      monitoringService.getVirtualApplianceMonitor().awaitCompletionDeploy(MAX_WAIT, TimeUnit.MINUTES, vapp);
-      assertEquals(vapp.getState(), VirtualApplianceState.DEPLOYED);
-      assertEquals(vm.getState(), VirtualMachineState.ON);
-   }
-
-   @Test(dependsOnMethods = "testDeployVirtualAppliance")
-   public void testUndeployVirtualAppliance() {
-      VirtualMachineTask[] tasks = vapp.undeploy();
-      assertEquals(tasks.length, 1); // One task for each VM in the VAPP
-
-      monitoringService.getVirtualApplianceMonitor().awaitCompletionUndeploy(MAX_WAIT, TimeUnit.MINUTES, vapp);
-      assertEquals(vapp.getState(), VirtualApplianceState.NOT_DEPLOYED);
-      assertEquals(vm.getState(), VirtualMachineState.NOT_ALLOCATED);
-   }
-
-   @Test(dependsOnMethods = "testUndeployVirtualAppliance")
-   public void testDeleteVirtualAppliance() {
-      final String name = vapp.getName();
-      vapp.delete();
-
-      assertNull(find(view.getCloudService().listVirtualAppliances(), new Predicate<VirtualAppliance>() {
-         @Override
-         public boolean apply(VirtualAppliance input) {
-            return input.getName().equals(name);
-         }
-      }, null));
-   }
-
-   private static Ordering<VirtualMachineTemplate> templateBySize() {
-      return new Ordering<VirtualMachineTemplate>() {
-         @Override
-         public int compare(final VirtualMachineTemplate left, final VirtualMachineTemplate right) {
-            return Longs.compare(left.getDiskFileSize(), right.getDiskFileSize());
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualDatacenterLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualDatacenterLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualDatacenterLiveApiTest.java
deleted file mode 100644
index 88b9aac..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualDatacenterLiveApiTest.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.get;
-import static com.google.common.collect.Iterables.size;
-import static com.google.common.collect.Lists.newArrayList;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.List;
-
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter.Builder;
-import org.jclouds.abiquo.domain.cloud.options.VirtualDatacenterOptions;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.network.PrivateNetwork;
-import org.jclouds.abiquo.domain.network.PublicIp;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link VirtualDatacenter} domain class.
- */
-@Test(groups = "api", testName = "VirtualDatacenterLiveApiTest")
-public class VirtualDatacenterLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   private VirtualMachineTemplate template;
-
-   public void testUpdate() {
-      env.virtualDatacenter.setName("Aloha updated");
-      env.virtualDatacenter.update();
-
-      // Recover the updated virtual datacenter
-      VirtualDatacenterDto updated = env.cloudApi.getVirtualDatacenter(env.virtualDatacenter.getId());
-
-      assertEquals(updated.getName(), "Aloha updated");
-   }
-
-   public void testCreateRepeated() {
-      PrivateNetwork newnet = PrivateNetwork.builder(env.context.getApiContext()).name("Newnet").gateway("10.0.0.1")
-            .address("10.0.0.0").mask(24).build();
-
-      VirtualDatacenter repeated = Builder.fromVirtualDatacenter(env.virtualDatacenter).network(newnet).build();
-
-      repeated.save();
-
-      List<VirtualDatacenterDto> virtualDatacenters = env.cloudApi.listVirtualDatacenters(
-            VirtualDatacenterOptions.builder().build()).getCollection();
-
-      assertEquals(virtualDatacenters.size(), 2);
-      assertEquals(virtualDatacenters.get(0).getName(), virtualDatacenters.get(1).getName());
-      repeated.delete();
-   }
-
-   public void testCreateFromEnterprise() {
-      Enterprise enterprise = env.enterpriseAdminContext.getAdministrationService().getCurrentUser().getEnterprise();
-      assertNotNull(enterprise);
-
-      List<Datacenter> datacenters = newArrayList(enterprise.listAllowedDatacenters());
-      assertNotNull(datacenters);
-      assertTrue(size(datacenters) > 0);
-
-      Datacenter datacenter = datacenters.get(0);
-
-      List<HypervisorType> hypervisors = newArrayList(datacenter.listAvailableHypervisors());
-      assertNotNull(datacenters);
-      assertTrue(size(datacenters) > 0);
-
-      HypervisorType hypervisor = hypervisors.get(0);
-
-      PrivateNetwork network = PrivateNetwork.builder(env.enterpriseAdminContext.getApiContext())
-            .name("DefaultNetwork").gateway("192.168.1.1").address("192.168.1.0").mask(24).build();
-
-      VirtualDatacenter virtualDatacenter = VirtualDatacenter
-            .builder(env.enterpriseAdminContext.getApiContext(), datacenters.get(0), enterprise)
-            .name(PREFIX + "Plain Virtual Aloha from ENT").cpuCountLimits(18, 20).hdLimitsInMb(279172872, 279172872)
-            .publicIpsLimits(2, 2).ramLimits(19456, 20480).storageLimits(289910292, 322122547).vlansLimits(1, 2)
-            .hypervisorType(hypervisor).network(network).build();
-
-      virtualDatacenter.save();
-      assertNotNull(virtualDatacenter.getId());
-
-      virtualDatacenter.delete();
-   }
-
-   public void testCreateFromVirtualDatacenter() {
-      HypervisorType hypervisor = env.virtualDatacenter.getHypervisorType();
-
-      Enterprise enterprise = env.user.getEnterprise();
-      assertNotNull(enterprise);
-
-      Datacenter datacenter = env.virtualDatacenter.getDatacenter();
-      assertNotNull(datacenter);
-
-      PrivateNetwork network = PrivateNetwork.builder(env.plainUserContext.getApiContext()).name("DefaultNetwork")
-            .gateway("192.168.1.1").address("192.168.1.0").mask(24).build();
-
-      VirtualDatacenter virtualDatacenter = VirtualDatacenter
-            .builder(env.context.getApiContext(), datacenter, enterprise).name(PREFIX + "Plain Virtual Aloha from VDC")
-            .cpuCountLimits(18, 20).hdLimitsInMb(279172872, 279172872).publicIpsLimits(2, 2).ramLimits(19456, 20480)
-            .storageLimits(289910292, 322122547).vlansLimits(1, 2).hypervisorType(hypervisor).network(network).build();
-
-      virtualDatacenter.save();
-      assertNotNull(virtualDatacenter.getId());
-
-      virtualDatacenter.delete();
-   }
-
-   public void testPurchaseIp() {
-      final PublicIp publicIp = get(env.virtualDatacenter.listAvailablePublicIps(), 0);
-      assertNotNull(publicIp);
-      env.virtualDatacenter.purchasePublicIp(publicIp);
-
-      PublicIp apiIp = find(env.virtualDatacenter.listPurchasedPublicIps(), new Predicate<PublicIp>() {
-         @Override
-         public boolean apply(PublicIp input) {
-            return input.getIp().equals(publicIp.getIp());
-         }
-      });
-
-      env.virtualDatacenter.releasePublicIp(apiIp);
-      apiIp = find(env.virtualDatacenter.listPurchasedPublicIps(), new Predicate<PublicIp>() {
-         @Override
-         public boolean apply(PublicIp input) {
-            return input.getIp().equals(publicIp.getIp());
-         }
-      }, null);
-      assertNull(apiIp);
-   }
-
-   public void testGetDefaultNetwork() {
-      PrivateNetwork network = env.virtualDatacenter.getDefaultNetwork().toPrivateNetwork();
-
-      assertNotNull(network);
-      assertEquals(network.getName(), env.privateNetwork.getName());
-      assertEquals(network.getType(), env.privateNetwork.getType());
-   }
-
-   public void testGetAvailableTemplates() {
-      List<VirtualMachineTemplate> templates = newArrayList(env.virtualDatacenter.listAvailableTemplates());
-      assertNotNull(templates);
-      assertFalse(templates.isEmpty());
-
-      template = templates.get(0);
-   }
-
-   @Test(dependsOnMethods = "testGetAvailableTemplates")
-   public void testGetAvailableTemplate() {
-      VirtualMachineTemplate templateFound = env.virtualDatacenter.getAvailableTemplate(template.getId());
-      assertNotNull(templateFound);
-      assertEquals(templateFound.getId(), template.getId());
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveApiTest.java
deleted file mode 100644
index a9b18ea..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveApiTest.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.task.AsyncTask;
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualMachineDto;
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link VirtualMachine} domain class.
- */
-@Test(groups = "api", testName = "VirtualMachineLiveApiTest")
-public class VirtualMachineLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   public void testListAllVirtualMachines() {
-      Iterable<VirtualMachine> vms = env.context.getCloudService().listVirtualMachines();
-      assertTrue(size(vms) > 1);
-
-      // Verify that the VM created in the setup exists. This call will throw
-      // a NoSuchElementException if no macthing VM is found
-      find(vms, new Predicate<VirtualMachine>() {
-         @Override
-         public boolean apply(VirtualMachine input) {
-            return input.getId().equals(env.virtualMachine.getId());
-         }
-      });
-   }
-
-   public void testHasDataFromNode() {
-      assertNotNull(env.virtualMachine.getNameLabel());
-      assertNotNull(env.virtualMachine.getInternalName());
-      assertNotNull(env.virtualMachine.getOwnerName());
-   }
-
-   public void testUpdateInfoFromNode() {
-      env.virtualMachine.setNameLabel(PREFIX + "-label-updated");
-      env.virtualMachine.update();
-      env.virtualMachine.refresh();
-
-      assertEquals(env.virtualMachine.getNameLabel(), PREFIX + "-label-updated");
-   }
-
-   public void testGetTasks() {
-      Iterable<AsyncTask<?, ?>> tasks = env.virtualMachine.listTasks();
-      assertNotNull(tasks);
-   }
-
-   public void testGetState() {
-      VirtualMachineState state = env.virtualMachine.getState();
-      assertEquals(state, VirtualMachineState.NOT_ALLOCATED);
-   }
-
-   public void testIsPersistent() {
-      assertFalse(env.virtualMachine.isPersistent());
-   }
-
-   public void testGetVirtualAppliance() {
-      VirtualAppliance vapp = env.virtualMachine.getVirtualAppliance();
-      assertNotNull(vapp);
-      assertEquals(vapp.getId(), env.virtualAppliance.getId());
-   }
-
-   public void testRebootVirtualMachineFailsWhenNotAllocated() {
-      // Since the virtual machine is not deployed, this should not generate a
-      // task
-
-      try {
-         env.virtualMachine.reboot();
-         fail("Reboot should have failed for the NOT_ALLOCATED virtual machine");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "VM-11");
-      }
-   }
-
-   public void testUpdateForcingLimits() {
-      int originalHard = env.virtualDatacenter.getCpuCountHardLimit();
-      int originalSoft = env.virtualDatacenter.getCpuCountSoftLimit();
-
-      env.virtualDatacenter.setCpuCountHardLimit(10);
-      env.virtualDatacenter.setCpuCountSoftLimit(5);
-      env.virtualDatacenter.update();
-
-      try {
-         VirtualMachine vm = env.virtualAppliance.getVirtualMachine(env.virtualMachine.getId());
-         vm.setCpu(7);
-         VirtualMachineTask task = vm.update(true);
-
-         assertNull(task);
-         assertEquals(vm.getCpu().intValue(), 7);
-      } finally {
-         env.virtualDatacenter.setCpuCountHardLimit(originalHard);
-         env.virtualDatacenter.setCpuCountSoftLimit(originalSoft);
-         env.virtualDatacenter.update();
-      }
-   }
-
-   public void testAttachDvd() {
-      VirtualMachine vm = VirtualMachine.Builder.fromVirtualMachine(env.virtualMachine).dvd(true).build();
-      vm.save();
-
-      VirtualMachineDto updated = env.cloudApi.getVirtualMachine(env.virtualAppliance.unwrap(), vm.getId());
-
-      assertNotNull(updated.getDvd());
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveTest.java
deleted file mode 100644
index 8e9b76c..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineLiveTest.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.getLast;
-import static org.jclouds.abiquo.environment.CloudTestEnvironment.templateBySize;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.fail;
-
-import java.util.concurrent.TimeUnit;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.network.Ip;
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.internal.BaseAbiquoLiveApiTest;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Lists;
-
-/**
- * Live integration tests for the {@link VirtualMachine} domain class.
- */
-@Test(groups = "live", testName = "VirtualMachineLiveTest")
-public class VirtualMachineLiveTest extends BaseAbiquoLiveApiTest {
-   private static final long MAX_WAIT = 2;
-
-   private VirtualDatacenter vdc;
-
-   private VirtualAppliance vapp;
-
-   private VirtualMachine vm;
-
-   private VirtualMachineTemplate vmt;
-
-   private MonitoringService monitoringService;
-
-   @BeforeClass(groups = { "integration", "live" })
-   @Override
-   public void setupContext() {
-      super.setupContext();
-      monitoringService = view.getMonitoringService();
-      vdc = getLast(view.getCloudService().listVirtualDatacenters());
-      vmt = templateBySize().min(vdc.listAvailableTemplates());
-
-      vapp = VirtualAppliance.builder(view.getApiContext(), vdc).name(PREFIX + "Virtual Appliance Wahine").build();
-      vapp.save();
-      assertNotNull(vapp.getId());
-   }
-
-   @AfterClass(groups = { "integration", "live" })
-   @Override
-   protected void tearDownContext() {
-      vapp.delete();
-      super.tearDownContext();
-   }
-
-   @Test
-   public void testCreateVirtualMachine() {
-      vm = VirtualMachine.builder(view.getApiContext(), vapp, vmt).cpu(1).nameLabel(PREFIX + "VM Kane").ram(128)
-            .build();
-
-      vm.save();
-      assertNotNull(vm.getId());
-   }
-
-   @Test(dependsOnMethods = "testCreateVirtualMachine")
-   public void testUpdateVirtualMachineWhenNotDeployed() {
-      vm.setNameLabel(PREFIX + "VM Kane Updated");
-      VirtualMachineTask task = vm.update();
-      assertNull(task);
-
-      find(vapp.listVirtualMachines(), new Predicate<VirtualMachine>() {
-         @Override
-         public boolean apply(VirtualMachine input) {
-            return input.getNameLabel().equals(PREFIX + "VM Kane Updated");
-         }
-      });
-   }
-
-   @Test(dependsOnMethods = "testUpdateVirtualMachineWhenNotDeployed")
-   public void testDeployVirtualMachine() {
-      VirtualMachineTask task = vm.deploy(true);
-      assertNotNull(task);
-
-      monitoringService.getVirtualMachineMonitor().awaitCompletionDeploy(MAX_WAIT, TimeUnit.MINUTES, vm);
-      assertEquals(vm.getState(), VirtualMachineState.ON);
-   }
-
-   @Test(dependsOnMethods = "testDeployVirtualMachine")
-   public void testChangeVirtualMachineState() {
-      VirtualMachineTask task = vm.changeState(VirtualMachineState.OFF);
-      assertNotNull(task);
-
-      monitoringService.getVirtualMachineMonitor().awaitState(MAX_WAIT, TimeUnit.MINUTES, VirtualMachineState.OFF, vm);
-      assertEquals(vm.getState(), VirtualMachineState.OFF);
-   }
-
-   @Test(dependsOnMethods = "testChangeVirtualMachineState")
-   public void testReconfigure() {
-      final Ip<?, ?> ip = getLast(vdc.getDefaultNetwork().listUnusedIps());
-
-      VirtualMachineTask task = vm.setNics(Lists.<Ip<?, ?>> newArrayList(ip));
-      assertNotNull(task);
-
-      monitoringService.getVirtualMachineMonitor().awaitState(MAX_WAIT, TimeUnit.MINUTES, VirtualMachineState.OFF, vm);
-
-      find(vm.listAttachedNics(), new Predicate<Ip<?, ?>>() {
-         @Override
-         public boolean apply(Ip<?, ?> input) {
-            return input.getIp().equals(ip.getIp());
-         }
-      });
-   }
-
-   @Test(dependsOnMethods = "testReconfigure")
-   public void testUndeployVirtualMachine() {
-      VirtualMachineTask task = vm.undeploy();
-      assertNotNull(task);
-
-      monitoringService.getVirtualMachineMonitor().awaitCompletionUndeploy(MAX_WAIT, TimeUnit.MINUTES, vm);
-      assertEquals(vm.getState(), VirtualMachineState.NOT_ALLOCATED);
-   }
-
-   @Test(dependsOnMethods = "testUndeployVirtualMachine")
-   public void testDeployFailsWhenHardLimitsAreExceeded() {
-      Enterprise ent = view.getAdministrationService().getCurrentEnterprise();
-
-      if (vdc.getCpuCountHardLimit() != 0) {
-         vm.setCpu(vdc.getCpuCountHardLimit() + 1);
-      } else if (ent.getCpuCountHardLimit() != 0) {
-         vm.setCpu(ent.getCpuCountHardLimit() + 1);
-      }
-
-      VirtualMachineTask task = vm.update();
-      assertNull(task);
-
-      try {
-         vm.deploy(true);
-         fail("Deployments over the hard limits should not be allowed");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "LIMIT_EXCEEDED");
-      }
-   }
-
-   @Test(dependsOnMethods = "testDeployFailsWhenHardLimitsAreExceeded")
-   public void tesDeleteVirtualMachine() {
-      Integer vmId = vm.getId();
-      vm.delete();
-      assertNull(vapp.getVirtualMachine(vmId));
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineNetworkingLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineNetworkingLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineNetworkingLiveApiTest.java
deleted file mode 100644
index cd4580d..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineNetworkingLiveApiTest.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.get;
-import static com.google.common.collect.Iterables.getLast;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.fail;
-
-import java.util.List;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.network.ExternalIp;
-import org.jclouds.abiquo.domain.network.Ip;
-import org.jclouds.abiquo.domain.network.PrivateIp;
-import org.jclouds.abiquo.domain.network.PublicIp;
-import org.jclouds.abiquo.domain.network.PublicNetwork;
-import org.jclouds.abiquo.domain.network.UnmanagedIp;
-import org.jclouds.abiquo.domain.network.UnmanagedNetwork;
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.Lists;
-
-/**
- * Live integration tests for the {@link VirtualMachine} networking operations.
- */
-@Test(groups = "api", testName = "VirtualMachineNetworkingLiveApiTest")
-public class VirtualMachineNetworkingLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   private PrivateIp privateIp;
-
-   private ExternalIp externalIp;
-
-   private PublicIp publicIpInfrastructure;
-
-   private PublicIp publicIpCloud;
-
-   private UnmanagedIp unmanagedIp1;
-
-   private UnmanagedIp unmanagedIp2;
-
-   @BeforeClass
-   public void setupIps() {
-      privateIp = getLast(env.privateNetwork.listUnusedIps());
-      externalIp = getLast(env.externalNetwork.listUnusedIps());
-
-      publicIpInfrastructure = getLast(env.virtualDatacenter.listAvailablePublicIps());
-      env.virtualDatacenter.purchasePublicIp(publicIpInfrastructure);
-
-      publicIpCloud = find(env.virtualDatacenter.listPurchasedPublicIps(), new Predicate<PublicIp>() {
-         @Override
-         public boolean apply(PublicIp input) {
-            return input.getIp().equals(publicIpInfrastructure.getIp());
-         }
-      });
-   }
-
-   @AfterClass
-   public void restorePrivateIp() {
-      VirtualMachineTask task = env.virtualMachine.setNics(Lists.<Ip<?, ?>> newArrayList(privateIp));
-      assertNull(task);
-
-      Iterable<Ip<?, ?>> nics = env.virtualMachine.listAttachedNics();
-      assertEquals(size(nics), 1);
-      assertEquals(get(nics, 0).getId(), privateIp.getId());
-
-      final String address = publicIpCloud.getIp();
-      env.virtualDatacenter.releasePublicIp(publicIpCloud);
-
-      assertNull(find(env.virtualDatacenter.listPurchasedPublicIps(), new Predicate<PublicIp>() {
-         @Override
-         public boolean apply(PublicIp input) {
-            return input.getIp().equals(address);
-         }
-      }, null));
-   }
-
-   // TODO: Infrastructure edit link for public ips can not be used to attach
-   @Test(enabled = false)
-   public void testAttachInfrastructurePublicIp() {
-      VirtualMachineTask task = env.virtualMachine.setNics(Lists.<Ip<?, ?>> newArrayList(publicIpInfrastructure));
-      assertNull(task);
-
-      Iterable<Ip<?, ?>> nics = env.virtualMachine.listAttachedNics();
-      assertEquals(size(nics), 1);
-      assertEquals(get(nics, 0).getId(), publicIpInfrastructure.getId());
-   }
-
-   public void testAttachPublicIp() {
-      VirtualMachineTask task = env.virtualMachine.setNics(Lists.<Ip<?, ?>> newArrayList(publicIpCloud));
-      assertNull(task);
-
-      Iterable<Ip<?, ?>> nics = env.virtualMachine.listAttachedNics();
-      assertEquals(size(nics), 1);
-      assertEquals(get(nics, 0).getId(), publicIpCloud.getId());
-   }
-
-   @Test(dependsOnMethods = "testAttachPublicIp")
-   public void testAttachPrivateIp() {
-      List<Ip<?, ?>> nics = Lists.newArrayList(env.virtualMachine.listAttachedNics());
-      nics.add(privateIp);
-
-      VirtualMachineTask task = env.virtualMachine.setNics(nics);
-      assertNull(task);
-
-      nics = Lists.newArrayList(env.virtualMachine.listAttachedNics());
-      assertEquals(nics.size(), 2);
-      assertEquals(nics.get(0).getId(), publicIpCloud.getId());
-      assertEquals(nics.get(1).getId(), privateIp.getId());
-   }
-
-   @Test(dependsOnMethods = "testAttachPrivateIp")
-   public void testAttachExternalIp() {
-      List<Ip<?, ?>> nics = Lists.newArrayList(env.virtualMachine.listAttachedNics());
-      nics.add(externalIp);
-
-      VirtualMachineTask task = env.virtualMachine.setNics(nics);
-      assertNull(task);
-
-      nics = Lists.newArrayList(env.virtualMachine.listAttachedNics());
-      assertEquals(nics.size(), 3);
-      assertEquals(nics.get(0).getId(), publicIpCloud.getId());
-      assertEquals(nics.get(1).getId(), privateIp.getId());
-      assertEquals(nics.get(2).getId(), externalIp.getId());
-   }
-
-   @Test(dependsOnMethods = "testAttachExternalIp")
-   public void testAddUnmanagedNics() {
-      Iterable<Ip<?, ?>> nics = env.virtualMachine.listAttachedNics();
-
-      VirtualMachineTask task = env.virtualMachine.setNics(Lists.newArrayList(nics),
-            Lists.<UnmanagedNetwork> newArrayList(env.unmanagedNetwork, env.unmanagedNetwork));
-      assertNull(task);
-
-      nics = env.virtualMachine.listAttachedNics();
-      assertEquals(size(nics), 5);
-      assertEquals(get(nics, 0).getId(), publicIpCloud.getId());
-      assertEquals(get(nics, 1).getId(), privateIp.getId());
-      assertEquals(get(nics, 2).getId(), externalIp.getId());
-      // Unmanaged ips are created during the attach.
-      assertEquals(get(nics, 3).getNetworkName(), env.unmanagedNetwork.getName());
-      assertEquals(get(nics, 4).getNetworkName(), env.unmanagedNetwork.getName());
-
-      unmanagedIp1 = (UnmanagedIp) get(nics, 3);
-      unmanagedIp2 = (UnmanagedIp) get(nics, 4);
-   }
-
-   @Test(dependsOnMethods = "testAddUnmanagedNics")
-   public void testReorderNics() {
-      List<Ip<?, ?>> nics = Lists.newArrayList(env.virtualMachine.listAttachedNics());
-
-      VirtualMachineTask task = env.virtualMachine.setNics(Lists.<Ip<?, ?>> newArrayList(nics.get(2), nics.get(1),
-            nics.get(0), nics.get(4), nics.get(3)));
-      assertNull(task);
-
-      nics = Lists.newArrayList(env.virtualMachine.listAttachedNics());
-      assertEquals(nics.size(), 5);
-      assertEquals(nics.get(0).getId(), externalIp.getId());
-      assertEquals(nics.get(1).getId(), privateIp.getId());
-      assertEquals(nics.get(2).getId(), publicIpCloud.getId());
-      assertEquals(nics.get(3).getId(), unmanagedIp2.getId());
-      assertEquals(nics.get(4).getId(), unmanagedIp1.getId());
-   }
-
-   @Test(dependsOnMethods = "testReorderNics")
-   public void testDetachNics() {
-      List<Ip<?, ?>> nics = Lists.newArrayList(env.virtualMachine.listAttachedNics());
-
-      VirtualMachineTask task = env.virtualMachine.setNics(Lists.<Ip<?, ?>> newArrayList(nics.get(1), nics.get(2)));
-      assertNull(task);
-
-      nics = Lists.newArrayList(env.virtualMachine.listAttachedNics());
-      assertEquals(nics.size(), 2);
-      assertEquals(nics.get(0).getId(), privateIp.getId());
-      assertEquals(nics.get(1).getId(), publicIpCloud.getId());
-   }
-
-   @Test(dependsOnMethods = "testDetachNics")
-   public void testSetDefaultGateway() {
-      PublicNetwork network = publicIpCloud.getNetwork();
-      env.virtualMachine.setGatewayNetwork(network);
-
-      Integer configId = env.virtualMachine.unwrap().getIdFromLink("network_configuration");
-      assertEquals(configId, network.getId());
-   }
-
-   // TODO: Review this functionality
-   @Test(dependsOnMethods = "testSetDefaultGateway", enabled = false)
-   public void testDetachAllNics() {
-      try {
-         env.virtualMachine.setNics(null);
-
-         fail("It should not be allowed to remove all nics from a vm");
-      } catch (AbiquoException ex) {
-         // At least one nic must be configured
-         assertHasError(ex, Status.BAD_REQUEST, "VM-46");
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineStorageLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineStorageLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineStorageLiveApiTest.java
deleted file mode 100644
index dafc3eb..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineStorageLiveApiTest.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.get;
-import static com.google.common.collect.Iterables.isEmpty;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.abiquo.domain.infrastructure.Tier;
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link VirtualMachine} storage operations.
- */
-@Test(groups = "api", testName = "VirtualMachineStorageLiveApiTest")
-public class VirtualMachineStorageLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   private Volume volume;
-
-   private HardDisk hardDisk;
-
-   public void testAttachVolumes() {
-      volume = createVolume();
-
-      // Since the virtual machine is not deployed, this should not generate a
-      // task
-      VirtualMachineTask task = env.virtualMachine.attachVolumes(volume);
-      assertNull(task);
-
-      Iterable<Volume> attached = env.virtualMachine.listAttachedVolumes();
-      assertEquals(size(attached), 1);
-      assertEquals(get(attached, 0).getId(), volume.getId());
-   }
-
-   @Test(dependsOnMethods = "testAttachVolumes")
-   public void detachVolume() {
-      env.virtualMachine.detachVolumes(volume);
-      Iterable<Volume> attached = env.virtualMachine.listAttachedVolumes();
-      assertTrue(isEmpty(attached));
-   }
-
-   @Test(dependsOnMethods = "detachVolume")
-   public void detachAllVolumes() {
-      // Since the virtual machine is not deployed, this should not generate a
-      // task
-      VirtualMachineTask task = env.virtualMachine.attachVolumes(volume);
-      assertNull(task);
-
-      env.virtualMachine.detachAllVolumes();
-      Iterable<Volume> attached = env.virtualMachine.listAttachedVolumes();
-      assertTrue(isEmpty(attached));
-
-      deleteVolume(volume);
-   }
-
-   public void testAttachHardDisks() {
-      hardDisk = createHardDisk();
-
-      // Since the virtual machine is not deployed, this should not generate a
-      // task
-      VirtualMachineTask task = env.virtualMachine.attachHardDisks(hardDisk);
-      assertNull(task);
-
-      Iterable<HardDisk> attached = env.virtualMachine.listAttachedHardDisks();
-      assertEquals(size(attached), 1);
-      assertEquals(get(attached, 0).getId(), hardDisk.getId());
-   }
-
-   @Test(dependsOnMethods = "testAttachHardDisks")
-   public void detachHardDisk() {
-      env.virtualMachine.detachHardDisks(hardDisk);
-      Iterable<HardDisk> attached = env.virtualMachine.listAttachedHardDisks();
-      assertTrue(isEmpty(attached));
-   }
-
-   @Test(dependsOnMethods = "detachHardDisk")
-   public void detachAllHardDisks() {
-      // Since the virtual machine is not deployed, this should not generate a
-      // task
-      VirtualMachineTask task = env.virtualMachine.attachHardDisks(hardDisk);
-      assertNull(task);
-
-      env.virtualMachine.detachAllHardDisks();
-      Iterable<HardDisk> attached = env.virtualMachine.listAttachedHardDisks();
-      assertTrue(isEmpty(attached));
-
-      deleteHardDisk(hardDisk);
-   }
-
-   private Volume createVolume() {
-      Tier tier = find(env.virtualDatacenter.listStorageTiers(), new Predicate<Tier>() {
-         @Override
-         public boolean apply(Tier input) {
-            return input.getName().equals(env.tier.getName());
-         }
-      });
-
-      Volume volume = Volume.builder(env.context.getApiContext(), env.virtualDatacenter, tier)
-            .name(PREFIX + "Hawaian volume").sizeInMb(32).build();
-      volume.save();
-
-      assertNotNull(volume.getId());
-      assertNotNull(env.virtualDatacenter.getVolume(volume.getId()));
-
-      return volume;
-   }
-
-   private void deleteVolume(final Volume volume) {
-      Integer id = volume.getId();
-      volume.delete();
-      assertNull(env.virtualDatacenter.getVolume(id));
-   }
-
-   private HardDisk createHardDisk() {
-      HardDisk hardDisk = HardDisk.builder(env.context.getApiContext(), env.virtualDatacenter).sizeInMb(64L).build();
-      hardDisk.save();
-
-      assertNotNull(hardDisk.getId());
-      assertNotNull(hardDisk.getSequence());
-
-      return hardDisk;
-   }
-
-   private void deleteHardDisk(final HardDisk hardDisk) {
-      Integer id = hardDisk.getId();
-      hardDisk.delete();
-      assertNull(env.virtualDatacenter.getHardDisk(id));
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateLiveApiTest.java
deleted file mode 100644
index 01ea54e..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateLiveApiTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.fail;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.config.Category;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-/**
- * Live integration tests for the {@link VirtualMachineTemplate} domain class.
- */
-@Test(groups = "api", testName = "VirtualMachineTemplateLiveApiTest")
-public class VirtualMachineTemplateLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   public void testGetParent() {
-      Datacenter datacenter = env.virtualMachine.getTemplate().getDatacenter();
-      assertNotNull(datacenter);
-      assertEquals(datacenter.getId(), env.datacenter.getId());
-   }
-
-   public void testGetCategory() {
-      Category category = env.virtualMachine.getTemplate().getCategory();
-      assertNotNull(category);
-   }
-
-   public void testRequestConversionToSameFormat() {
-      try {
-         env.virtualMachine.getTemplate().requestConversion(env.virtualMachine.getTemplate().getDiskFormatType());
-         fail("Should not be able to create create a conversion to the base format");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "CONVERSION-3");
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTest.java
deleted file mode 100644
index 2d83116..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.AbiquoContext;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link VirtualMachine} class.
- */
-@Test(groups = "unit", testName = "VirtualMachineTest")
-public class VirtualMachineTest {
-
-   @Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "Missing required field nameLabel")
-   public void testNameLabelIsMandatory() {
-      AbiquoContext context = EasyMock.createMock(AbiquoContext.class);
-      VirtualAppliance vapp = EasyMock.createMock(VirtualAppliance.class);
-      VirtualMachineTemplate template = EasyMock.createMock(VirtualMachineTemplate.class);
-
-      VirtualMachine.builder(context.getApiContext(), vapp, template).build();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VolumeLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VolumeLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VolumeLiveApiTest.java
deleted file mode 100644
index e7e84fe..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/cloud/VolumeLiveApiTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.isEmpty;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.abiquo.domain.cloud.options.VolumeOptions;
-import org.jclouds.abiquo.domain.infrastructure.Tier;
-import org.jclouds.abiquo.domain.network.PrivateNetwork;
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link Volume} domain class.
- */
-@Test(groups = "api", testName = "VolumeLiveApiTest")
-public class VolumeLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   public void testCreateVolume() {
-      // We need the vdc-relative tier
-      Tier tier = find(env.virtualDatacenter.listStorageTiers(), new Predicate<Tier>() {
-         @Override
-         public boolean apply(Tier input) {
-            return input.getName().equals(env.tier.getName());
-         }
-      });
-
-      Volume volume = Volume.builder(env.context.getApiContext(), env.virtualDatacenter, tier)
-            .name(PREFIX + "Hawaian volume").sizeInMb(32).build();
-      volume.save();
-
-      assertNotNull(volume.getId());
-      assertNotNull(env.virtualDatacenter.getVolume(volume.getId()));
-   }
-
-   @Test(dependsOnMethods = "testCreateVolume")
-   public void testFilterVolumes() {
-      VolumeOptions validOptions = VolumeOptions.builder().has("hawa").build();
-      VolumeOptions invalidOptions = VolumeOptions.builder().has("cacatua").build();
-
-      Iterable<Volume> volumes = env.virtualDatacenter.listVolumes(validOptions);
-      assertEquals(size(volumes), 1);
-
-      volumes = env.virtualDatacenter.listVolumes(invalidOptions);
-      assertTrue(isEmpty(volumes));
-   }
-
-   @Test(dependsOnMethods = "testFilterVolumes")
-   public void testUpdateVolume() {
-      Volume volume = find(env.virtualDatacenter.listVolumes(), volumeName(PREFIX + "Hawaian volume"));
-
-      volume.setName("Hawaian volume updated");
-      VirtualMachineTask task = volume.update();
-      assertNull(task);
-
-      // Reload the volume to check
-      Volume updated = env.virtualDatacenter.getVolume(volume.getId());
-      assertEquals(updated.getName(), "Hawaian volume updated");
-   }
-
-   @Test(dependsOnMethods = "testUpdateVolume")
-   public void testMoveVolume() {
-      // Create the new virtual datacenter
-      PrivateNetwork network = PrivateNetwork.builder(env.context.getApiContext()).name("DefaultNetwork")
-            .gateway("192.168.1.1").address("192.168.1.0").mask(24).build();
-
-      VirtualDatacenter newVdc = VirtualDatacenter.builder(env.context.getApiContext(), env.datacenter, env.enterprise)
-            .name("New VDC").network(network).hypervisorType(env.machine.getType()).build();
-      newVdc.save();
-      assertNotNull(newVdc.getId());
-
-      Volume volume = find(env.virtualDatacenter.listVolumes(), volumeName("Hawaian volume updated"));
-      volume.moveTo(newVdc);
-
-      // Check that the underlying Dto has been updated to the new VDC
-      assertTrue(volume.unwrap().getEditLink().getHref().startsWith(newVdc.unwrap().getEditLink().getHref()));
-
-      // Move it back to the original VDC
-      volume.moveTo(env.virtualDatacenter);
-
-      // Check that the underlying Dto has been updated to the new VDC
-      assertTrue(volume.unwrap().getEditLink().getHref()
-            .startsWith(env.virtualDatacenter.unwrap().getEditLink().getHref()));
-
-      // Tear down the virtual datacenter
-      newVdc.delete();
-   }
-
-   @Test(dependsOnMethods = "testMoveVolume")
-   public void testDeleteVolume() {
-      Volume volume = find(env.virtualDatacenter.listVolumes(), volumeName("Hawaian volume updated"));
-
-      Integer id = volume.getId();
-      volume.delete();
-
-      assertNull(env.virtualDatacenter.getVolume(id));
-   }
-
-   private static Predicate<Volume> volumeName(final String name) {
-      return new Predicate<Volume>() {
-         @Override
-         public boolean apply(Volume input) {
-            return input.getName().equals(name);
-         }
-      };
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/config/CategoryLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/config/CategoryLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/config/CategoryLiveApiTest.java
deleted file mode 100644
index 89eae02..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/config/CategoryLiveApiTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.config;
-
-import static com.google.common.collect.Iterables.find;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link Category} domain class.
- */
-@Test(groups = "api", testName = "CategoryLiveApiTest")
-public class CategoryLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   public void testCreateAndGet() {
-      Category category = Category.builder(env.context.getApiContext()).name(PREFIX + "-test-category").build();
-      category.save();
-
-      Category apiCategory = find(env.context.getAdministrationService().listCategories(), new Predicate<Category>() {
-         @Override
-         public boolean apply(Category input) {
-            return input.getName().equals(PREFIX + "-test-category");
-         }
-      });
-
-      apiCategory.delete();
-   }
-
-   @Test(dependsOnMethods = "testCreateAndGet")
-   public void testUpdate() {
-      Iterable<Category> categories = env.context.getAdministrationService().listCategories();
-      assertNotNull(categories);
-
-      Category category = categories.iterator().next();
-      String name = category.getName();
-
-      category.setName(PREFIX + "-test-category-updated");
-      category.update();
-
-      find(env.context.getAdministrationService().listCategories(), new Predicate<Category>() {
-         @Override
-         public boolean apply(Category input) {
-            return input.getName().equals(PREFIX + "-test-category-updated");
-         }
-      });
-
-      category.setName(name);
-      category.update();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/config/LicenseLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/config/LicenseLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/config/LicenseLiveApiTest.java
deleted file mode 100644
index 724f87f..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/config/LicenseLiveApiTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.config;
-
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.fail;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-/**
- * Live integration tests for the {@link User} domain class.
- */
-@Test(groups = "api", testName = "LicenseLiveApiTest")
-public class LicenseLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   public void testCreateRepeated() {
-      License repeated = License.Builder.fromLicense(env.license).build();
-
-      try {
-         repeated.add();
-         fail("Should not be able to create licenses with the same code");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "LICENSE-5");
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/config/SystemPropertiesLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/config/SystemPropertiesLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/config/SystemPropertiesLiveApiTest.java
deleted file mode 100644
index 8efde3c..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/config/SystemPropertiesLiveApiTest.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.config;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-/**
- * Live integration tests for the {@link User} domain class.
- */
-@Test(groups = "api", testName = "SystemPropertiesLiveApiTest")
-public class SystemPropertiesLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   public void testUpdate() {
-      SystemProperty prop = env.administrationService.getSystemProperty("client.dashboard.showStartUpAlert");
-
-      String value = prop.getValue();
-      prop.setValue("0");
-      prop.update();
-
-      // Recover the updated datacenter
-      SystemProperty updated = env.administrationService.getSystemProperty("client.dashboard.showStartUpAlert");
-
-      assertEquals(updated.getValue(), "0");
-
-      prop.setValue(value);
-      prop.update();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/EnterpriseLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/EnterpriseLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/EnterpriseLiveApiTest.java
deleted file mode 100644
index af1602b..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/EnterpriseLiveApiTest.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import static com.google.common.collect.Iterables.get;
-import static com.google.common.collect.Iterables.isEmpty;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.enterprise.Enterprise.Builder;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.enterprise.DatacentersLimitsDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-
-/**
- * Live integration tests for the {@link Enterprise} domain class.
- */
-@Test(groups = "api", testName = "EnterpriseLiveApiTest")
-public class EnterpriseLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   private Enterprise enterprise;
-
-   private Limits limits;
-
-   @BeforeClass
-   public void setupEnterprise() {
-      enterprise = Enterprise.Builder.fromEnterprise(env.enterprise).build();
-      enterprise.setName(PREFIX + "-enterprise-test");
-      enterprise.save();
-
-      limits = enterprise.allowDatacenter(env.datacenter);
-      assertNotNull(limits);
-
-      DatacentersLimitsDto limitsDto = env.enterpriseApi.getLimits(enterprise.unwrap(), env.datacenter.unwrap());
-      assertNotNull(limitsDto);
-      assertEquals(limitsDto.getCollection().size(), 1);
-   }
-
-   @AfterClass
-   public void tearDownEnterprise() {
-      enterprise.prohibitDatacenter(env.datacenter);
-
-      try {
-         // If a datacenter is not allowed, the limits for it can not be
-         // retrieved
-         env.enterpriseApi.getLimits(enterprise.unwrap(), env.datacenter.unwrap());
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "ENTERPRISE-10");
-      }
-
-      Iterable<Datacenter> allowed = enterprise.listAllowedDatacenters();
-      assertNotNull(allowed);
-      assertTrue(isEmpty(allowed));
-
-      enterprise.delete();
-   }
-
-   public void testUpdate() {
-      enterprise.setName("Updated Enterprise");
-      enterprise.update();
-
-      // Recover the updated enterprise
-      EnterpriseDto updated = env.enterpriseApi.getEnterprise(enterprise.getId());
-
-      assertEquals(updated.getName(), "Updated Enterprise");
-   }
-
-   public void testCreateRepeated() {
-      Enterprise repeated = Builder.fromEnterprise(enterprise).build();
-
-      try {
-         repeated.save();
-         fail("Should not be able to create enterprises with the same name");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "ENTERPRISE-4");
-      }
-   }
-
-   public void testAllowTwiceWorks() {
-      // Allow the datacenter again and check that the configuration has not
-      // changed
-      Limits limits = enterprise.allowDatacenter(env.datacenter);
-      assertNotNull(limits);
-
-      DatacentersLimitsDto limitsDto = env.enterpriseApi.getLimits(enterprise.unwrap(), env.datacenter.unwrap());
-      assertNotNull(limitsDto);
-      assertEquals(limitsDto.getCollection().size(), 1);
-   }
-
-   public void testListLimits() {
-      Iterable<Limits> allLimits = enterprise.listLimits();
-      assertNotNull(allLimits);
-      assertEquals(size(allLimits), 1);
-   }
-
-   public void testUpdateInvalidLimits() {
-      // CPU soft remains to 0 => conflict because hard is smaller
-      limits.setCpuCountHardLimit(2);
-
-      try {
-         limits.update();
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.BAD_REQUEST, "CONSTR-LIMITRANGE");
-      }
-   }
-
-   public void testUpdateLimits() {
-      limits.setCpuCountLimits(4, 5);
-      limits.update();
-
-      DatacentersLimitsDto limitsDto = env.enterpriseApi.getLimits(enterprise.unwrap(), env.datacenter.unwrap());
-      assertNotNull(limitsDto);
-      assertEquals(limitsDto.getCollection().size(), 1);
-      assertEquals(limitsDto.getCollection().get(0).getCpuCountHardLimit(), 5);
-      assertEquals(limitsDto.getCollection().get(0).getCpuCountSoftLimit(), 4);
-   }
-
-   public void testListAllowedDatacenters() {
-      Iterable<Datacenter> allowed = enterprise.listAllowedDatacenters();
-
-      assertNotNull(allowed);
-      assertFalse(isEmpty(allowed));
-      assertEquals(get(allowed, 0).getId(), env.datacenter.getId());
-   }
-
-   public void testListVirtualMachines() {
-      Iterable<VirtualMachine> machines = env.defaultEnterprise.listVirtualMachines();
-      assertTrue(size(machines) > 0);
-   }
-
-   public void testListVirtualAppliances() {
-      Iterable<VirtualAppliance> vapps = env.defaultEnterprise.listVirtualAppliances();
-      assertTrue(size(vapps) > 0);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/EnterprisePropertiesLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/EnterprisePropertiesLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/EnterprisePropertiesLiveApiTest.java
deleted file mode 100644
index 5eebf8d..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/EnterprisePropertiesLiveApiTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertTrue;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.enterprise.EnterprisePropertiesDto;
-
-/**
- * Live integration tests for the {@link Enterprise} domain class.
- */
-@Test(groups = "api", testName = "EnterprisePropertiesLiveApiTest")
-public class EnterprisePropertiesLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   public void testUpdate() {
-      EnterpriseProperties properties = env.administrationService.getEnterpriseProperties(env.enterprise);
-
-      Integer size = properties.getProperties().size();
-      properties.getProperties().put("Prop", "Value");
-      properties.update();
-
-      // Recover the updated properties
-      EnterprisePropertiesDto updated = env.enterpriseApi.getEnterpriseProperties(env.enterprise.unwrap());
-
-      assertEquals(updated.getProperties().size(), size + 1);
-      assertTrue(updated.getProperties().containsKey("Prop"));
-      assertTrue(updated.getProperties().containsValue("Value"));
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/TemplateDefinitionListLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/TemplateDefinitionListLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/TemplateDefinitionListLiveApiTest.java
deleted file mode 100644
index 9452367..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/TemplateDefinitionListLiveApiTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link TemplateDefinitionList} domain class.
- */
-@Test(groups = "api", testName = "TemplateDefinitionListLiveApiTest")
-public class TemplateDefinitionListLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   private TemplateDefinitionList list;
-
-   public void testUpdate() {
-      list.setName(list.getName() + "Updated");
-      list.update();
-
-      Iterable<TemplateDefinitionList> lists = filter(env.enterprise.listTemplateDefinitionLists(),
-            new Predicate<TemplateDefinitionList>() {
-               @Override
-               public boolean apply(TemplateDefinitionList input) {
-                  return input.getName().equals("myListUpdated");
-               }
-            });
-
-      assertEquals(size(lists), 1);
-   }
-
-   public void testListStates() {
-      Iterable<TemplateState> states = list.listStatus(env.datacenter);
-      assertNotNull(states);
-   }
-
-   @BeforeClass
-   public void setup() {
-      list = TemplateDefinitionList.builder(env.context.getApiContext(), env.enterprise).name("myList")
-            .url("http://virtualapp-repository.com/vapp1.ovf").build();
-
-      list.save();
-
-      assertNotNull(list.getId());
-   }
-
-   @AfterClass
-   public void tearDown() {
-      Integer idTemplateList = list.getId();
-      list.delete();
-      assertNull(env.enterprise.getTemplateDefinitionList(idTemplateList));
-   }
-}


[13/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/ConversionMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/ConversionMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/ConversionMonitor.java
deleted file mode 100644
index 7d78ba5..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/ConversionMonitor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor;
-
-import java.util.concurrent.TimeUnit;
-
-import org.jclouds.abiquo.domain.cloud.Conversion;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.monitor.internal.BaseConversionMonitor;
-
-import com.google.inject.ImplementedBy;
-
-/**
- * {@link Conversion} monitoring features.
- */
-@ImplementedBy(BaseConversionMonitor.class)
-public interface ConversionMonitor extends MonitoringService {
-   /**
-    * Monitor the given {@link Conversion}s and block until they finishes.
-    * 
-    * @param conversions
-    *           The {@link Conversion}s to monitor.
-    */
-   void awaitCompletion(final Conversion... conversions);
-
-   /**
-    * Monitor the given {@link Conversion}s and populate an event when they
-    * finish.
-    * 
-    * @param conversions
-    *           The {@link Conversion}s to monitor.
-    */
-   void monitor(final Conversion... conversions);
-
-   /**
-    * Monitor the given {@link Conversion}s and block until they finish.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param conversions
-    *           The {@link Conversion}s to monitor.
-    */
-   void awaitCompletion(final Long maxWait, final TimeUnit timeUnit, final Conversion... conversions);
-
-   /**
-    * Monitor the given {@link Conversion}s and populate an event when they
-    * finish.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param conversions
-    *           The {@link Conversion}s to monitor.
-    */
-   void monitor(final Long maxWait, final TimeUnit timeUnit, final Conversion... conversions);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/MonitorStatus.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/MonitorStatus.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/MonitorStatus.java
deleted file mode 100644
index 1ff4d10..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/MonitorStatus.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor;
-
-/**
- * Represents the states of a running monitor.
- */
-public enum MonitorStatus {
-   /** The monitoring job has finished. */
-   DONE,
-
-   /** The monitoring job has finished and the result is not the expected one. */
-   FAILED,
-
-   /** The monitoring job must continue. */
-   CONTINUE
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/VirtualApplianceMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/VirtualApplianceMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/VirtualApplianceMonitor.java
deleted file mode 100644
index 13b9cc9..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/VirtualApplianceMonitor.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor;
-
-import java.util.concurrent.TimeUnit;
-
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.monitor.internal.BaseVirtualApplianceMonitor;
-
-import com.google.inject.ImplementedBy;
-
-/**
- * {@link VirtualAppliance} monitoring features.
- */
-@ImplementedBy(BaseVirtualApplianceMonitor.class)
-public interface VirtualApplianceMonitor extends MonitoringService {
-   /**
-    * Monitor the given {@link VirtualAppliance}s and block until the deploy
-    * finishes.
-    * 
-    * @param vapp
-    *           The {@link VirtualAppliance}s to monitor.
-    */
-   void awaitCompletionDeploy(final VirtualAppliance... vapp);
-
-   /**
-    * Monitor the given {@link VirtualAppliance}s and populate an event when the
-    * deploy finishes.
-    * 
-    * @param VirtualAppliance
-    *           The {@link VirtualAppliance}s to monitor.
-    */
-   void monitorDeploy(final VirtualAppliance... vapps);
-
-   /**
-    * Monitor the given {@link VirtualAppliance}s and block until the deploy
-    * finishes.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param vapp
-    *           The {@link VirtualAppliance}s to monitor.
-    */
-   void awaitCompletionDeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualAppliance... vapp);
-
-   /**
-    * Monitor the given {@link VirtualAppliance}s and populate an event when
-    * deploy finishes.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param vapps
-    *           The {@link VirtualAppliance}s to monitor.
-    */
-   void monitorDeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualAppliance... vapps);
-
-   /**
-    * Monitor the given {@link VirtualAppliance}s and block until the undeploy
-    * finishes.
-    * 
-    * @param vapp
-    *           The {@link VirtualAppliance}s to monitor.
-    */
-   void awaitCompletionUndeploy(final VirtualAppliance... vapp);
-
-   /**
-    * Monitor the given {@link VirtualAppliance}s and call populate an event
-    * when undeploy finishes.
-    * 
-    * @param vapps
-    *           The {@link VirtualAppliance}s to monitor.
-    */
-   void monitorUndeploy(final VirtualAppliance... vapps);
-
-   /**
-    * Monitor the given {@link VirtualAppliance}s and blocks until the undeploy
-    * finishes.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param vapp
-    *           The {@link VirtualAppliance}s to monitor.
-    */
-   void awaitCompletionUndeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualAppliance... vapp);
-
-   /**
-    * Monitor the given {@link VirtualAppliance}s and populate an event when
-    * undeploy finishes.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param callback
-    *           The callback.
-    * @param vapps
-    *           The {@link VirtualAppliance}s to monitor.
-    */
-   void monitorUndeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualAppliance... vapps);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/VirtualMachineMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/VirtualMachineMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/VirtualMachineMonitor.java
deleted file mode 100644
index c4cc034..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/VirtualMachineMonitor.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor;
-
-import java.util.concurrent.TimeUnit;
-
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.monitor.internal.BaseVirtualMachineMonitor;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.inject.ImplementedBy;
-
-/**
- * {@link VirtualMachine} monitoring features.
- */
-@ImplementedBy(BaseVirtualMachineMonitor.class)
-public interface VirtualMachineMonitor extends MonitoringService {
-   /**
-    * Monitor the given {@link VirtualMachine}s and block until all deploys
-    * finish.
-    * 
-    * @param vm
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void awaitCompletionDeploy(final VirtualMachine... vm);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and populate an event when all
-    * deploys finish.
-    * 
-    * @param vms
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void monitorDeploy(final VirtualMachine... vms);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and block until all deploys
-    * finish.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param vm
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void awaitCompletionDeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualMachine... vm);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and populate an event when all
-    * deploys finish.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param vms
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void monitorDeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualMachine... vms);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and block until all undeploys
-    * finish.
-    * 
-    * @param vm
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void awaitCompletionUndeploy(final VirtualMachine... vm);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and populate an event when all
-    * undeploys finish.
-    * 
-    * @param vms
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void monitorUndeploy(final VirtualMachine... vms);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and blocks until all undeploys
-    * finish.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param vm
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void awaitCompletionUndeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualMachine... vm);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and populate an event when all
-    * undeploys finish.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param callback
-    *           The callback.
-    * @param vms
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void monitorUndeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualMachine... vms);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and block until it is in the
-    * given state.
-    * 
-    * @param vm
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void awaitState(VirtualMachineState state, final VirtualMachine... vm);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and populate an event when it is
-    * in the given state.
-    * 
-    * @param vms
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void monitorState(VirtualMachineState state, final VirtualMachine... vms);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and block until it is in the
-    * given state.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param vm
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void awaitState(final Long maxWait, final TimeUnit timeUnit, VirtualMachineState state, final VirtualMachine... vm);
-
-   /**
-    * Monitor the given {@link VirtualMachine}s and populate an event when it is
-    * in the given state.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param callback
-    *           The callback.
-    * @param vms
-    *           The {@link VirtualMachine}s to monitor.
-    */
-   void monitorState(final Long maxWait, final TimeUnit timeUnit, VirtualMachineState state,
-         final VirtualMachine... vms);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/CompletedEvent.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/CompletedEvent.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/CompletedEvent.java
deleted file mode 100644
index 18ab9b3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/CompletedEvent.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.events;
-
-/**
- * Event dispatched when a monitoring job completes without error.
- */
-public class CompletedEvent<T> extends MonitorEvent<T> {
-   public CompletedEvent(final T target) {
-      super(MonitorEvent.Type.COMPLETED, target);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/FailedEvent.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/FailedEvent.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/FailedEvent.java
deleted file mode 100644
index 5d35b1c..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/FailedEvent.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.events;
-
-/**
- * Event dispatched when a monitoring job completes with errors.
- */
-public class FailedEvent<T> extends MonitorEvent<T> {
-   public FailedEvent(final T target) {
-      super(MonitorEvent.Type.FAILED, target);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/MonitorEvent.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/MonitorEvent.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/MonitorEvent.java
deleted file mode 100644
index 5b3f0c3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/MonitorEvent.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.events;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * base class for all monitor events.
- */
-public class MonitorEvent<T> {
-   /**
-    * The type of the event.
-    */
-   public static enum Type {
-      COMPLETED, FAILED, TIMEOUT;
-   }
-
-   /** The type of the event. */
-   private Type type;
-
-   /** The target object being monitored. */
-   private T target;
-
-   public MonitorEvent(final Type type, final T target) {
-      super();
-      this.type = checkNotNull(type, "type");
-      this.target = checkNotNull(target, "target");
-   }
-
-   public Type getType() {
-      return type;
-   }
-
-   public void setType(final Type type) {
-      this.type = type;
-   }
-
-   public T getTarget() {
-      return target;
-   }
-
-   public void setTarget(final T target) {
-      this.target = target;
-   }
-
-   @Override
-   public String toString() {
-      return "MonitorEvent [type=" + type + ", target=" + target + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/TimeoutEvent.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/TimeoutEvent.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/TimeoutEvent.java
deleted file mode 100644
index 03aecae..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/events/TimeoutEvent.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.events;
-
-/**
- * Event dispatched when a monitoring job times out.
- */
-public class TimeoutEvent<T> extends MonitorEvent<T> {
-   public TimeoutEvent(final T target) {
-      super(MonitorEvent.Type.TIMEOUT, target);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/AsyncTaskStatusMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/AsyncTaskStatusMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/AsyncTaskStatusMonitor.java
deleted file mode 100644
index c8544fa..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/AsyncTaskStatusMonitor.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.task.AsyncTask;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-
-/**
- * This class takes care of monitoring {@link AsyncTask} jobs.
- */
-@Singleton
-public class AsyncTaskStatusMonitor implements Function<AsyncTask<?, ?>, MonitorStatus> {
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   @Override
-   public MonitorStatus apply(final AsyncTask<?, ?> asyncTask) {
-      checkNotNull(asyncTask, "asyncTask");
-
-      try {
-         asyncTask.refresh();
-
-         switch (asyncTask.getState()) {
-            case ABORTED:
-            case FINISHED_UNSUCCESSFULLY:
-               return MonitorStatus.FAILED;
-            case FINISHED_SUCCESSFULLY:
-               return MonitorStatus.DONE;
-            case STARTED:
-            case PENDING:
-               return MonitorStatus.CONTINUE;
-            default:
-               throw new IllegalStateException("Unsupported task status");
-         }
-      } catch (Exception ex) {
-         logger.warn(ex, "exception thrown while monitoring %s on %s, returning CONTINUE", asyncTask, getClass()
-               .getName());
-
-         return MonitorStatus.CONTINUE;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/ConversionStatusMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/ConversionStatusMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/ConversionStatusMonitor.java
deleted file mode 100644
index 711b812..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/ConversionStatusMonitor.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.cloud.Conversion;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-
-/**
- * This class takes care of monitoring {@link Conversion} jobs.
- */
-@Singleton
-public class ConversionStatusMonitor implements Function<Conversion, MonitorStatus> {
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   @Override
-   public MonitorStatus apply(final Conversion conversion) {
-      checkNotNull(conversion, "conversion");
-
-      try {
-         conversion.refresh();
-
-         switch (conversion.getState()) {
-            case ENQUEUED:
-               return MonitorStatus.CONTINUE;
-            case FAILED:
-               return MonitorStatus.FAILED;
-            case FINISHED:
-               return MonitorStatus.DONE;
-            default:
-               throw new IllegalStateException("Unsupported conversion status");
-         }
-      } catch (Exception ex) {
-         logger.warn(ex, "exception thrown while monitoring %s on %s, returning CONTINUE", conversion, getClass()
-               .getName());
-
-         return MonitorStatus.CONTINUE;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceDeployMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceDeployMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceDeployMonitor.java
deleted file mode 100644
index 4bc5507..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceDeployMonitor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.logging.Logger;
-
-import com.abiquo.server.core.cloud.VirtualApplianceState;
-import com.google.common.base.Function;
-
-/**
- * This class takes care of monitoring the a deploy of a
- * {@link VirtualAppliance}.
- */
-@Singleton
-public class VirtualApplianceDeployMonitor implements Function<VirtualAppliance, MonitorStatus> {
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   @Override
-   public MonitorStatus apply(final VirtualAppliance virtualAppliance) {
-      checkNotNull(virtualAppliance, "virtualAppliance");
-
-      try {
-         VirtualApplianceState state = virtualAppliance.getState();
-
-         switch (state) {
-            case UNKNOWN:
-            case NEEDS_SYNC:
-            case NOT_DEPLOYED:
-               return MonitorStatus.FAILED;
-            case DEPLOYED:
-               return MonitorStatus.DONE;
-            case LOCKED:
-            default:
-               return MonitorStatus.CONTINUE;
-         }
-      } catch (Exception ex) {
-         logger.warn(ex, "exception thrown while monitoring %s on %s, returning CONTINUE", virtualAppliance, getClass()
-               .getName());
-
-         return MonitorStatus.CONTINUE;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceUndeployMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceUndeployMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceUndeployMonitor.java
deleted file mode 100644
index 124fbf8..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualApplianceUndeployMonitor.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.logging.Logger;
-import org.jclouds.rest.ResourceNotFoundException;
-
-import com.abiquo.server.core.cloud.VirtualApplianceState;
-import com.google.common.base.Function;
-
-/**
- * This class takes care of monitoring the a undeploy of a
- * {@link VirtualAppliance}.
- */
-@Singleton
-public class VirtualApplianceUndeployMonitor implements Function<VirtualAppliance, MonitorStatus> {
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   @Override
-   public MonitorStatus apply(final VirtualAppliance virtualAppliance) {
-      checkNotNull(virtualAppliance, "virtualAppliance");
-
-      try {
-         VirtualApplianceState state = virtualAppliance.getState();
-
-         switch (state) {
-            case DEPLOYED:
-            case UNKNOWN:
-            case NEEDS_SYNC:
-               return MonitorStatus.FAILED;
-            case NOT_DEPLOYED:
-               return MonitorStatus.DONE;
-            case LOCKED:
-            default:
-               return MonitorStatus.CONTINUE;
-         }
-      } catch (ResourceNotFoundException nfe) {
-         logger.warn("virtual appliance %s not found, assuming it was undeployed successfully, "
-               + "stop monitor with DONE", virtualAppliance);
-         return MonitorStatus.DONE;
-      } catch (Exception ex) {
-         logger.warn(ex, "exception thrown while monitoring %s on %s, returning CONTINUE", virtualAppliance, getClass()
-               .getName());
-
-         return MonitorStatus.CONTINUE;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineDeployMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineDeployMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineDeployMonitor.java
deleted file mode 100644
index 17a63d8..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineDeployMonitor.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.annotation.Resource;
-
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.logging.Logger;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.common.base.Function;
-import com.google.inject.Singleton;
-
-/**
- * This class takes care of monitoring the a deploy of a {@link VirtualMachine}.
- * 
- * @see MonitoringService
- */
-@Singleton
-public class VirtualMachineDeployMonitor implements Function<VirtualMachine, MonitorStatus> {
-   @Resource
-   private Logger logger = Logger.NULL;
-
-   @Override
-   public MonitorStatus apply(final VirtualMachine virtualMachine) {
-      checkNotNull(virtualMachine, "virtualMachine");
-
-      try {
-         VirtualMachineState state = virtualMachine.getState();
-
-         switch (state) {
-            case NOT_ALLOCATED:
-            case UNKNOWN:
-               return MonitorStatus.FAILED;
-            case ON:
-               return MonitorStatus.DONE;
-            default:
-               return MonitorStatus.CONTINUE;
-         }
-      } catch (Exception ex) {
-         logger.warn(ex, "exception thrown while monitoring %s on %s, returning CONTINUE", virtualMachine, getClass()
-               .getName());
-
-         return MonitorStatus.CONTINUE;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineStateMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineStateMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineStateMonitor.java
deleted file mode 100644
index 759be2e..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineStateMonitor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.annotation.Resource;
-
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.logging.Logger;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.common.base.Function;
-
-/**
- * This class takes care of monitoring the state of a {@link VirtualMachine}.
- * 
- * @see MonitoringService
- */
-public class VirtualMachineStateMonitor implements Function<VirtualMachine, MonitorStatus> {
-   @Resource
-   private Logger logger = Logger.NULL;
-
-   private VirtualMachineState expectedState;
-
-   public VirtualMachineStateMonitor(final VirtualMachineState expectedState) {
-      super();
-      this.expectedState = checkNotNull(expectedState, "expectedState");
-   }
-
-   @Override
-   public MonitorStatus apply(final VirtualMachine virtualMachine) {
-      checkNotNull(virtualMachine, "virtualMachine");
-
-      try {
-         VirtualMachineState state = virtualMachine.getState();
-         return state == expectedState ? MonitorStatus.DONE : MonitorStatus.CONTINUE;
-      } catch (Exception ex) {
-         logger.warn(ex, "exception thrown while monitoring %s on %s, returning CONTINUE", virtualMachine, getClass()
-               .getName());
-
-         return MonitorStatus.CONTINUE;
-
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineUndeployMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineUndeployMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineUndeployMonitor.java
deleted file mode 100644
index 82cfdc8..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/functions/VirtualMachineUndeployMonitor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.annotation.Resource;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.logging.Logger;
-import org.jclouds.rest.ResourceNotFoundException;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.common.base.Function;
-
-/**
- * This class takes care of monitoring the a undeploy of a
- * {@link VirtualMachine}.
- */
-@Singleton
-public class VirtualMachineUndeployMonitor implements Function<VirtualMachine, MonitorStatus> {
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   @Override
-   public MonitorStatus apply(final VirtualMachine virtualMachine) {
-      checkNotNull(virtualMachine, "virtualMachine");
-
-      try {
-         VirtualMachineState state = virtualMachine.getState();
-
-         // This state may be reached if the undeploy process fails and a
-         // rollback is done
-         if (state.existsInHypervisor()) {
-            return MonitorStatus.FAILED;
-         }
-
-         switch (state) {
-            case UNKNOWN:
-               return MonitorStatus.FAILED;
-            case NOT_ALLOCATED:
-               return MonitorStatus.DONE;
-            default:
-               return MonitorStatus.CONTINUE;
-         }
-      } catch (ResourceNotFoundException nfe) {
-         logger.warn("virtual machine %s not found, assuming it was undeployed successfully, "
-               + "stop monitor with DONE", virtualMachine);
-         return MonitorStatus.DONE;
-      } catch (Exception ex) {
-         logger.warn(ex, "exception thrown while monitoring %s on %s, returning CONTINUE", virtualMachine, getClass()
-               .getName());
-
-         return MonitorStatus.CONTINUE;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/handlers/AbstractEventHandler.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/handlers/AbstractEventHandler.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/handlers/AbstractEventHandler.java
deleted file mode 100644
index 7f85bc2..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/handlers/AbstractEventHandler.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.handlers;
-
-import javax.annotation.Resource;
-
-import org.jclouds.abiquo.monitor.events.MonitorEvent;
-import org.jclouds.logging.Logger;
-
-/**
- * Base class for all {@link MonitorEvent} handlers.
- */
-public abstract class AbstractEventHandler<T> {
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   /**
-    * Checks if the current handler must handle the dispatched event.
-    * 
-    * @param event
-    *           The event being dispatched.
-    * @return Boolean indicating if the event must be handled by the current
-    *         handler.
-    */
-   protected abstract boolean handles(MonitorEvent<T> event);
-
-   // Public getters and setters to allow non-guice code to set the appropriate
-   // logger
-
-   public Logger getLogger() {
-      return logger;
-   }
-
-   public void setLogger(final Logger logger) {
-      this.logger = logger;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/handlers/BlockingEventHandler.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/handlers/BlockingEventHandler.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/handlers/BlockingEventHandler.java
deleted file mode 100644
index 7ba2e69..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/handlers/BlockingEventHandler.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.handlers;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-
-import org.jclouds.abiquo.monitor.events.MonitorEvent;
-import org.jclouds.logging.Logger;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Throwables;
-import com.google.common.collect.Lists;
-import com.google.common.eventbus.Subscribe;
-
-/**
- * An event handler that blocks the thread until all monitored objects have been
- * finished being watched.
- * <p>
- * Due to <a
- * href="http://code.google.com/p/guava-libraries/issues/detail?id=783">Guava
- * Issue 786</a> {@link #handle(MonitorEvent)} is marked <code>final</code>to
- * avoid having duplicate events.
- * 
- * @param <T>
- *           The monitored object.
- */
-public class BlockingEventHandler<T> extends AbstractEventHandler<T> {
-   /** The signal used to lock the thread. */
-   @VisibleForTesting
-   CountDownLatch completeSignal;
-
-   /**
-    * The objects being locked.
-    * <p>
-    * This class handles events in a thread safe way. Otherwise this collections
-    * should be synchronised.
-    */
-   protected List<T> lockedObjects;
-
-   public BlockingEventHandler(final T... lockedObjects) {
-      this(Logger.NULL, lockedObjects);
-   }
-
-   public BlockingEventHandler(final Logger logger, final T... lockedObjects) {
-      super();
-      checkArgument(checkNotNull(lockedObjects, "lockedObjects").length > 0, "must provide at least one object");
-      this.logger = checkNotNull(logger, "logger");
-      this.lockedObjects = Lists.newArrayList(lockedObjects);
-      this.logger.debug("created BlockingEventHandler locking %s objects", lockedObjects.length);
-   }
-
-   @Override
-   protected boolean handles(final MonitorEvent<T> event) {
-      logger.debug("checking if %s event on %s must be handled by %s", event.getType(), event.getTarget(), this);
-      boolean handles = lockedObjects.contains(event.getTarget());
-      logger.debug("%s event on %s must %sbe handled", event.getType(), event.getTarget(), handles ? "" : "not ");
-      return handles;
-   }
-
-   /**
-    * Handles the dispatched event in a thread safe way.
-    * <p>
-    * Due to <a
-    * href="http://code.google.com/p/guava-libraries/issues/detail?id=783">Guava
-    * Issue 786</a> {@link #handle(MonitorEvent)} is marked <code>final</code>to
-    * avoid having duplicate events.
-    * 
-    * @see {@link #doBeforeRelease(MonitorEvent)}
-    */
-   @Subscribe
-   public final void handle(final MonitorEvent<T> event) {
-      if (handles(event)) {
-         logger.debug("handling %s", event);
-
-         try {
-            doBeforeRelease(event);
-         } finally {
-            // Always release the lock, even if the handler code fails
-            release(event.getTarget());
-         }
-      }
-   }
-
-   /**
-    * Blocks the thread until all locked objects have been released.
-    */
-   public void lock() {
-      // When invoking the lock, it is possible that all events have
-      // already been consumed. If there are no objects to monitor,
-      // just ignore the lock.
-      if (!lockedObjects.isEmpty()) {
-         try {
-            completeSignal = new CountDownLatch(lockedObjects.size());
-            logger.debug("creating lock for %s object(s)", lockedObjects.size());
-            completeSignal.await();
-         } catch (InterruptedException ex) {
-            throw Throwables.propagate(ex);
-         }
-      } else {
-         logger.debug("there is nothing to watch. Ignoring lock.");
-      }
-   }
-
-   /**
-    * Releases the lock on the given object.
-    */
-   protected void release(final T target) {
-      logger.debug("releasing %s", target);
-      lockedObjects.remove(target);
-
-      // The completeSignal might be null if the events have been consumed
-      // before acquiring the lock
-      if (completeSignal != null) {
-         completeSignal.countDown();
-         logger.debug("releasing lock for %s. %s remaining objects", target, completeSignal.getCount());
-      }
-   }
-
-   /**
-    * Convenience method to bypass the <a
-    * href="http://code.google.com/p/guava-libraries/issues/detail?id=783">Guava
-    * Issue 786</a> that forces the subscriber method to be <code>final</code>.
-    */
-   protected void doBeforeRelease(final MonitorEvent<T> event) {
-      // Let subclasses may override it to customize behavior
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitor.java
deleted file mode 100644
index edbebb6..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseAsyncTaskMonitor.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.Constants.PROPERTY_SCHEDULER_THREADS;
-import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY;
-
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.task.AsyncTask;
-import org.jclouds.abiquo.internal.BaseMonitoringService;
-import org.jclouds.abiquo.monitor.AsyncTaskMonitor;
-import org.jclouds.abiquo.monitor.functions.AsyncTaskStatusMonitor;
-import org.jclouds.rest.ApiContext;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.eventbus.EventBus;
-
-/**
- * Default monitor for {@link AsyncTask} objects.
- */
-@Singleton
-public class BaseAsyncTaskMonitor extends BaseMonitoringService implements AsyncTaskMonitor {
-
-   @VisibleForTesting
-   protected AsyncTaskStatusMonitor taskMonitor;
-
-   @Inject
-   public BaseAsyncTaskMonitor(final ApiContext<AbiquoApi> context,
-         @Named(PROPERTY_SCHEDULER_THREADS) final ScheduledExecutorService scheduler,
-         @Named(ASYNC_TASK_MONITOR_DELAY) final Long pollingDelay, final EventBus eventBus,
-         final AsyncTaskStatusMonitor monitor) {
-      super(context, scheduler, pollingDelay, eventBus);
-      this.taskMonitor = checkNotNull(monitor, "monitor");
-   }
-
-   @Override
-   public void awaitCompletion(final AsyncTask<?, ?>... tasks) {
-      awaitCompletion(taskMonitor, tasks);
-   }
-
-   @Override
-   public void monitor(final AsyncTask<?, ?>... tasks) {
-      monitor(taskMonitor, tasks);
-   }
-
-   @Override
-   public void awaitCompletion(final Long maxWait, final TimeUnit timeUnit, final AsyncTask<?, ?>... tasks) {
-      awaitCompletion(maxWait, timeUnit, taskMonitor, tasks);
-   }
-
-   @Override
-   public void monitor(final Long maxWait, final TimeUnit timeUnit, final AsyncTask<?, ?>... tasks) {
-      monitor(maxWait, timeUnit, taskMonitor, tasks);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseConversionMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseConversionMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseConversionMonitor.java
deleted file mode 100644
index 98457dc..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseConversionMonitor.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.Constants.PROPERTY_SCHEDULER_THREADS;
-import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY;
-
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.Conversion;
-import org.jclouds.abiquo.internal.BaseMonitoringService;
-import org.jclouds.abiquo.monitor.ConversionMonitor;
-import org.jclouds.abiquo.monitor.functions.ConversionStatusMonitor;
-import org.jclouds.rest.ApiContext;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.eventbus.EventBus;
-
-/**
- * Default monitor for {@link Conversion} objects.
- */
-@Singleton
-public class BaseConversionMonitor extends BaseMonitoringService implements ConversionMonitor {
-
-   @VisibleForTesting
-   protected ConversionStatusMonitor conversionMonitor;
-
-   @Inject
-   public BaseConversionMonitor(final ApiContext<AbiquoApi> context,
-         @Named(PROPERTY_SCHEDULER_THREADS) final ScheduledExecutorService scheduler,
-         @Named(ASYNC_TASK_MONITOR_DELAY) final Long pollingDelay, final EventBus eventBus,
-         final ConversionStatusMonitor monitor) {
-      super(context, scheduler, pollingDelay, eventBus);
-      this.conversionMonitor = checkNotNull(monitor, "monitor");
-   }
-
-   @Override
-   public void awaitCompletion(final Conversion... conversions) {
-      awaitCompletion(conversionMonitor, conversions);
-   }
-
-   @Override
-   public void monitor(final Conversion... conversions) {
-      monitor(conversionMonitor, conversions);
-   }
-
-   @Override
-   public void awaitCompletion(final Long maxWait, final TimeUnit timeUnit, final Conversion... conversions) {
-      awaitCompletion(maxWait, timeUnit, conversionMonitor, conversions);
-   }
-
-   @Override
-   public void monitor(final Long maxWait, final TimeUnit timeUnit, final Conversion... conversions) {
-      monitor(maxWait, timeUnit, conversionMonitor, conversions);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitor.java
deleted file mode 100644
index 16ce43f..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualApplianceMonitor.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.Constants.PROPERTY_SCHEDULER_THREADS;
-import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY;
-
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.internal.BaseMonitoringService;
-import org.jclouds.abiquo.monitor.VirtualApplianceMonitor;
-import org.jclouds.abiquo.monitor.functions.VirtualApplianceDeployMonitor;
-import org.jclouds.abiquo.monitor.functions.VirtualApplianceUndeployMonitor;
-import org.jclouds.rest.ApiContext;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.eventbus.EventBus;
-
-/**
- * Default monitor for {@link VirtualAppliance} objects.
- */
-@Singleton
-public class BaseVirtualApplianceMonitor extends BaseMonitoringService implements VirtualApplianceMonitor {
-   @VisibleForTesting
-   protected VirtualApplianceDeployMonitor deployMonitor;
-
-   @VisibleForTesting
-   protected VirtualApplianceUndeployMonitor undeployMonitor;
-
-   @Inject
-   public BaseVirtualApplianceMonitor(final ApiContext<AbiquoApi> context,
-         @Named(PROPERTY_SCHEDULER_THREADS) final ScheduledExecutorService scheduler,
-         @Named(ASYNC_TASK_MONITOR_DELAY) final Long pollingDelay, final EventBus eventBus,
-         final VirtualApplianceDeployMonitor deployMonitor, final VirtualApplianceUndeployMonitor undeployMonitor) {
-      super(context, scheduler, pollingDelay, eventBus);
-      this.deployMonitor = checkNotNull(deployMonitor, "deployMonitor");
-      this.undeployMonitor = checkNotNull(undeployMonitor, "undeployMonitor");
-   }
-
-   @Override
-   public void awaitCompletionDeploy(final VirtualAppliance... vapps) {
-      awaitCompletion(deployMonitor, vapps);
-   }
-
-   @Override
-   public void monitorDeploy(final VirtualAppliance... vapps) {
-      monitor(deployMonitor, vapps);
-   }
-
-   @Override
-   public void awaitCompletionDeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualAppliance... vapps) {
-      awaitCompletion(maxWait, timeUnit, deployMonitor, vapps);
-   }
-
-   @Override
-   public void monitorDeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualAppliance... vapps) {
-      monitor(maxWait, timeUnit, deployMonitor, vapps);
-   }
-
-   @Override
-   public void awaitCompletionUndeploy(final VirtualAppliance... vapps) {
-      awaitCompletion(undeployMonitor, vapps);
-   }
-
-   @Override
-   public void monitorUndeploy(final VirtualAppliance... vapps) {
-      monitor(undeployMonitor, vapps);
-   }
-
-   @Override
-   public void awaitCompletionUndeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualAppliance... vapps) {
-      awaitCompletion(maxWait, timeUnit, undeployMonitor, vapps);
-   }
-
-   @Override
-   public void monitorUndeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualAppliance... vapps) {
-      monitor(maxWait, timeUnit, undeployMonitor, vapps);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitor.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitor.java b/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitor.java
deleted file mode 100644
index 1fdb111..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/monitor/internal/BaseVirtualMachineMonitor.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.Constants.PROPERTY_SCHEDULER_THREADS;
-import static org.jclouds.abiquo.config.AbiquoProperties.ASYNC_TASK_MONITOR_DELAY;
-
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.internal.BaseMonitoringService;
-import org.jclouds.abiquo.monitor.VirtualMachineMonitor;
-import org.jclouds.abiquo.monitor.functions.VirtualMachineDeployMonitor;
-import org.jclouds.abiquo.monitor.functions.VirtualMachineStateMonitor;
-import org.jclouds.abiquo.monitor.functions.VirtualMachineUndeployMonitor;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.eventbus.EventBus;
-
-/**
- * Default monitor for {@link VirtualMachine} objects.
- */
-@Singleton
-public class BaseVirtualMachineMonitor extends BaseMonitoringService implements VirtualMachineMonitor {
-   @VisibleForTesting
-   protected VirtualMachineDeployMonitor deployMonitor;
-
-   @VisibleForTesting
-   protected VirtualMachineUndeployMonitor undeployMonitor;
-
-   @Inject
-   public BaseVirtualMachineMonitor(final ApiContext<AbiquoApi> context,
-         @Named(PROPERTY_SCHEDULER_THREADS) final ScheduledExecutorService scheduler,
-         @Named(ASYNC_TASK_MONITOR_DELAY) final Long pollingDelay, final EventBus eventBus,
-         final VirtualMachineDeployMonitor deployMonitor, final VirtualMachineUndeployMonitor undeployMonitor) {
-      super(context, scheduler, pollingDelay, eventBus);
-      this.deployMonitor = checkNotNull(deployMonitor, "deployMonitor");
-      this.undeployMonitor = checkNotNull(undeployMonitor, "undeployMonitor");
-   }
-
-   @Override
-   public void awaitCompletionDeploy(final VirtualMachine... vms) {
-      awaitCompletion(deployMonitor, vms);
-   }
-
-   @Override
-   public void monitorDeploy(final VirtualMachine... vms) {
-      monitor(deployMonitor, vms);
-   }
-
-   @Override
-   public void awaitCompletionDeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualMachine... vms) {
-      awaitCompletion(maxWait, timeUnit, deployMonitor, vms);
-   }
-
-   @Override
-   public void monitorDeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualMachine... vms) {
-      monitor(maxWait, timeUnit, deployMonitor, vms);
-   }
-
-   @Override
-   public void awaitCompletionUndeploy(final VirtualMachine... vms) {
-      awaitCompletion(undeployMonitor, vms);
-   }
-
-   @Override
-   public void monitorUndeploy(final VirtualMachine... vms) {
-      monitor(undeployMonitor, vms);
-   }
-
-   @Override
-   public void awaitCompletionUndeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualMachine... vms) {
-      awaitCompletion(maxWait, timeUnit, undeployMonitor, vms);
-   }
-
-   @Override
-   public void monitorUndeploy(final Long maxWait, final TimeUnit timeUnit, final VirtualMachine... vms) {
-      monitor(maxWait, timeUnit, undeployMonitor, vms);
-   }
-
-   @Override
-   public void awaitState(final VirtualMachineState state, final VirtualMachine... vms) {
-      awaitCompletion(new VirtualMachineStateMonitor(state), vms);
-   }
-
-   @Override
-   public void monitorState(final VirtualMachineState state, final VirtualMachine... vms) {
-      monitor(new VirtualMachineStateMonitor(state), vms);
-   }
-
-   @Override
-   public void awaitState(final Long maxWait, final TimeUnit timeUnit, final VirtualMachineState state,
-         final VirtualMachine... vms) {
-      awaitCompletion(maxWait, timeUnit, new VirtualMachineStateMonitor(state), vms);
-   }
-
-   @Override
-   public void monitorState(final Long maxWait, final TimeUnit timeUnit, final VirtualMachineState state,
-         final VirtualMachine... vms) {
-      monitor(maxWait, timeUnit, new VirtualMachineStateMonitor(state), vms);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/predicates/IpPredicates.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/predicates/IpPredicates.java b/abiquo/src/main/java/org/jclouds/abiquo/predicates/IpPredicates.java
deleted file mode 100644
index 2ea3ca7..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/predicates/IpPredicates.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.predicates;
-
-import org.jclouds.abiquo.domain.network.AbstractPublicIp;
-import org.jclouds.abiquo.domain.network.Ip;
-
-import com.google.common.base.Predicate;
-
-/**
- * Container for {@link Network} filters.
- */
-public class IpPredicates {
-
-   public static <T extends AbstractPublicIp<?, ?>> Predicate<T> available() {
-      return new Predicate<T>() {
-         @Override
-         public boolean apply(final T address) {
-            return address.isAvailable();
-         }
-      };
-   }
-
-   public static <T extends Ip<?, ?>> Predicate<T> notUsed() {
-      return new Predicate<T>() {
-         @Override
-         public boolean apply(final T address) {
-            return address.unwrap().searchLink("virtualmachine") == null;
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/predicates/LinkPredicates.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/predicates/LinkPredicates.java b/abiquo/src/main/java/org/jclouds/abiquo/predicates/LinkPredicates.java
deleted file mode 100644
index c722ed6..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/predicates/LinkPredicates.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.predicates;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.regex.Pattern;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.network.NicDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.google.common.base.Predicate;
-
-/**
- * Container for {@link RESTLink} filters.
- */
-public class LinkPredicates {
-
-   private static final Pattern IS_NIC_REL_PATTERN = Pattern.compile("^" + NicDto.REL_PREFIX + "[0-9]+$");
-   private static final Pattern IS_DISK_REL_PATTERN = Pattern.compile("^" + VolumeManagementDto.REL_PREFIX + "[0-9]+$");
-
-   public static Predicate<RESTLink> rel(final String rel) {
-      checkNotNull(rel, "rel must be defined");
-      return new Predicate<RESTLink>() {
-         @Override
-         public boolean apply(final RESTLink link) {
-            return link.getRel().equals(rel);
-         }
-      };
-   }
-
-   public static Predicate<RESTLink> isNic() {
-      return new Predicate<RESTLink>() {
-         @Override
-         public boolean apply(final RESTLink link) {
-            return IS_NIC_REL_PATTERN.matcher(link.getRel()).matches();
-         }
-      };
-   }
-
-   public static Predicate<RESTLink> isDisk() {
-      return new Predicate<RESTLink>() {
-         @Override
-         public boolean apply(RESTLink link) {
-            return IS_DISK_REL_PATTERN.matcher(link.getRel()).matches();
-         }
-      };
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/predicates/NetworkServiceTypePredicates.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/predicates/NetworkServiceTypePredicates.java b/abiquo/src/main/java/org/jclouds/abiquo/predicates/NetworkServiceTypePredicates.java
deleted file mode 100644
index b7527f3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/predicates/NetworkServiceTypePredicates.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.predicates;
-
-import org.jclouds.abiquo.domain.network.NetworkServiceType;
-
-import com.google.common.base.Predicate;
-
-/**
- * Container for {@link NetworkServiceType} filters.
- */
-public class NetworkServiceTypePredicates {
-   public static Predicate<NetworkServiceType> isDefault() {
-      return new Predicate<NetworkServiceType>() {
-         @Override
-         public boolean apply(final NetworkServiceType ni) {
-            return ni.isDefaultNST();
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/predicates/VirtualDatacenterPredicates.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/predicates/VirtualDatacenterPredicates.java b/abiquo/src/main/java/org/jclouds/abiquo/predicates/VirtualDatacenterPredicates.java
deleted file mode 100644
index 4ad1011..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/predicates/VirtualDatacenterPredicates.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.predicates;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.isEmpty;
-
-import org.jclouds.abiquo.domain.cloud.Conversion;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-
-import com.abiquo.model.enumerator.ConversionState;
-import com.abiquo.model.enumerator.HypervisorType;
-import com.google.common.base.Predicate;
-
-/**
- * Container for {@link VirtualDatacenter} filters.
- */
-public class VirtualDatacenterPredicates {
-
-   public static Predicate<VirtualDatacenter> datacenter(final Datacenter datacenter) {
-      checkNotNull(datacenter, "datacenter must be defined");
-
-      return new Predicate<VirtualDatacenter>() {
-         @Override
-         public boolean apply(final VirtualDatacenter virtualDatacenter) {
-            // Avoid using the getDatacenter() method since it will generate an
-            // unnecessary API
-            // call. We can get the ID from the datacenter link.
-            Integer datacenterId = checkNotNull(virtualDatacenter.unwrap().getIdFromLink(ParentLinkName.DATACENTER),
-                  ValidationErrors.MISSING_REQUIRED_LINK);
-
-            return datacenterId.equals(datacenter.getId());
-         }
-      };
-   }
-
-   /**
-    * Check if the given template type is compatible with the given virtual
-    * datacenter type taking into account the conversions of the template.
-    * 
-    * @param template
-    *           The template to check.
-    * @return Predicate to check if the template or its conversions are
-    *         compatibles with the given virtual datacenter.
-    */
-   public static Predicate<VirtualDatacenter> compatibleWithTemplateOrConversions(final VirtualMachineTemplate template) {
-      return new Predicate<VirtualDatacenter>() {
-         @Override
-         public boolean apply(final VirtualDatacenter vdc) {
-            HypervisorType type = vdc.getHypervisorType();
-            boolean compatible = type.isCompatible(template.getDiskFormatType());
-            if (!compatible) {
-               Iterable<Conversion> compatibleConversions = template.listConversions(type, ConversionState.FINISHED);
-               compatible = compatibleConversions != null && !isEmpty(compatibleConversions);
-            }
-            return compatible;
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/predicates/VirtualMachineTemplatePredicates.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/predicates/VirtualMachineTemplatePredicates.java b/abiquo/src/main/java/org/jclouds/abiquo/predicates/VirtualMachineTemplatePredicates.java
deleted file mode 100644
index 8af9f6f..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/predicates/VirtualMachineTemplatePredicates.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.predicates;
-
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-
-import com.google.common.base.Predicate;
-
-/**
- * Container for {@link VirtualMachineTemplate} filters.
- */
-public class VirtualMachineTemplatePredicates {
-
-   public static Predicate<VirtualMachineTemplate> isShared() {
-      return new Predicate<VirtualMachineTemplate>() {
-         @Override
-         public boolean apply(final VirtualMachineTemplate input) {
-            return input.unwrap().isShared();
-         }
-      };
-   }
-
-   public static Predicate<VirtualMachineTemplate> isInstance() {
-      return new Predicate<VirtualMachineTemplate>() {
-         @Override
-         public boolean apply(final VirtualMachineTemplate input) {
-            return input.unwrap().searchLink("master") != null;
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/reference/ValidationErrors.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/reference/ValidationErrors.java b/abiquo/src/main/java/org/jclouds/abiquo/reference/ValidationErrors.java
deleted file mode 100644
index 67d7f88..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/reference/ValidationErrors.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.reference;
-
-/**
- * Error constants.
- */
-public class ValidationErrors {
-   public static final String NULL_RESOURCE = "The resource should be assigned to a ";
-
-   public static final String MISSING_REQUIRED_FIELD = "Missing required field ";
-
-   public static final String MISSING_REQUIRED_LINK = "Missing required link ";
-
-   public static final String INVALID_NETWORK_TYPE = "Invalid network type ";
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/reference/rest/ParentLinkName.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/reference/rest/ParentLinkName.java b/abiquo/src/main/java/org/jclouds/abiquo/reference/rest/ParentLinkName.java
deleted file mode 100644
index 9fc9b84..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/reference/rest/ParentLinkName.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.reference.rest;
-
-/**
- * Names of the "rel" attribute of the links that point to parent objects.
- */
-public class ParentLinkName {
-   public static final String RACK = "rack";
-
-   public static final String DATACENTER = "datacenter";
-
-   public static final String ENTERPRISE = "enterprise";
-
-   public static final String ROLE = "role";
-
-   public static final String TIER = "tier";
-
-   public static final String STORAGE_DEVICE = "device";
-
-   public static final String VIRTUAL_DATACENTER = "virtualdatacenter";
-
-   public static final String VIRTUAL_APPLIANCE = "virtualappliance";
-
-   public static final String VIRTUAL_MACHINE_TEMPLATE = "virtualmachinetemplate";
-
-   public static final String DATACENTER_REPOSITORY = "datacenterrepository";
-
-   public static final String CATEGORY = "category";
-
-   public static final String ICON = "icon";
-
-   public static final String PRIVATE_NETWORK = "privatenetwork";
-
-   public static final String PUBLIC_NETWORK = "publicnetwork";
-
-   public static final String EXTERNAL_NETWORK = "externalnetwork";
-
-   public static final String UNMANAGED_NETWORK = "unmanagednetwork";
-
-   public static final String NETWORK_CONFIGURATIONS = "configurations";
-
-   public static final String NETWORK_GATEWAY = "network_configuration";
-
-   public static final String TASK_RESULT = "result";
-   
-   public static final String VIRTUAL_MACHINE = "virtualmachine";
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/rest/annotations/EndpointLink.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/rest/annotations/EndpointLink.java b/abiquo/src/main/java/org/jclouds/abiquo/rest/annotations/EndpointLink.java
deleted file mode 100644
index 84d87d4..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/rest/annotations/EndpointLink.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.rest.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Indicates the link to be used to generate the endpoint for the request.
- */
-@Target({ ElementType.PARAMETER })
-@Retention(RetentionPolicy.RUNTIME)
-public @interface EndpointLink {
-
-   /**
-    * The name of the link that will be used to generate the request endpoint.
-    */
-   String value();
-}


[22/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWithTasksWrapper.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWithTasksWrapper.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWithTasksWrapper.java
deleted file mode 100644
index 55ab1ad..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWithTasksWrapper.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.task.AsyncTask;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.transport.SingleResourceTransportDto;
-import com.abiquo.server.core.task.TaskDto;
-import com.abiquo.server.core.task.TasksDto;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Ordering;
-import com.google.common.primitives.Longs;
-
-/**
- * This class is used to decorate transport objects that are owners of some
- * {@link TaskDto}
- */
-public abstract class DomainWithTasksWrapper<T extends SingleResourceTransportDto> extends DomainWrapper<T> {
-
-   protected DomainWithTasksWrapper(final ApiContext<AbiquoApi> context, final T target) {
-      super(context, target);
-   }
-
-   public Iterable<AsyncTask<?, ?>> listTasks() {
-      TasksDto result = context.getApi().getTaskApi().listTasks(target);
-      List<AsyncTask<?, ?>> tasks = Lists.newArrayList();
-      for (TaskDto dto : result.getCollection()) {
-         tasks.add(newTask(context, dto));
-      }
-
-      // Return the most recent task first
-      Collections.sort(tasks, new Ordering<AsyncTask<?, ?>>() {
-         @Override
-         public int compare(final AsyncTask<?, ?> left, final AsyncTask<?, ?> right) {
-            return Longs.compare(left.getTimestamp(), right.getTimestamp());
-         }
-      }.reverse());
-
-      return tasks;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWrapper.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWrapper.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWrapper.java
deleted file mode 100644
index 908edcc..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWrapper.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.concat;
-import static com.google.common.collect.Iterables.transform;
-import static org.jclouds.reflect.Reflection2.constructor;
-
-import java.lang.reflect.InvocationTargetException;
-import java.net.URI;
-import java.util.Collection;
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.exception.WrapperException;
-import org.jclouds.abiquo.domain.task.AsyncTask;
-import org.jclouds.abiquo.domain.task.ConversionTask;
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.domain.task.VirtualMachineTemplateTask;
-import org.jclouds.abiquo.domain.util.LinkUtils;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.abiquo.model.transport.SingleResourceTransportDto;
-import com.abiquo.model.transport.WrapperDto;
-import com.abiquo.server.core.task.TaskDto;
-import com.abiquo.server.core.task.enums.TaskType;
-import com.google.common.base.Function;
-import com.google.common.collect.Lists;
-import com.google.common.reflect.Invokable;
-import com.google.inject.TypeLiteral;
-
-/**
- * This class is used to decorate transport objects with high level
- * functionality.
- */
-public abstract class DomainWrapper<T extends SingleResourceTransportDto> {
-   /** The rest context. */
-   protected ApiContext<AbiquoApi> context;
-
-   /** The wrapped object. */
-   protected T target;
-
-   protected DomainWrapper(final ApiContext<AbiquoApi> context, final T target) {
-      super();
-      this.context = checkNotNull(context, "context");
-      this.target = checkNotNull(target, "target");
-   }
-
-   /**
-    * Returns the URI that identifies the transport object
-    * 
-    * @return The URI identifying the transport object
-    */
-   public URI getURI() {
-      RESTLink link = LinkUtils.getSelfLink(target);
-      return link == null ? null : URI.create(link.getHref());
-   }
-
-   /**
-    * Returns the wrapped object.
-    */
-   public T unwrap() {
-      return target;
-   }
-
-   /**
-    * Refresh the state of the current object.
-    */
-   @SuppressWarnings("unchecked")
-   public void refresh() {
-      RESTLink link = checkNotNull(LinkUtils.getSelfLink(target), ValidationErrors.MISSING_REQUIRED_LINK + " edit/self");
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<T> parser = new ParseXMLWithJAXB<T>(context.utils().xml(), TypeLiteral.get((Class<T>) target
-            .getClass()));
-
-      target = parser.apply(response);
-   }
-
-   /**
-    * Read the ID of the parent resource from the given link.
-    * 
-    * @param parentLinkRel
-    *           The link to the parent resource.
-    * @return The ID of the parent resource.
-    */
-   protected Integer getParentId(final String parentLinkRel) {
-      return target.getIdFromLink(parentLinkRel);
-   }
-
-   /**
-    * Wraps an object in the given wrapper class.
-    */
-   public static <T extends SingleResourceTransportDto, W extends DomainWrapper<T>> W wrap(
-         final ApiContext<AbiquoApi> context, final Class<W> wrapperClass, @Nullable final T target) {
-      if (target == null) {
-         return null;
-      }
-
-      try {
-         Invokable<W, W> cons = constructor(wrapperClass, ApiContext.class, target.getClass());
-         return cons.invoke(null, context, target);
-      } catch (InvocationTargetException e) {
-         throw new WrapperException(wrapperClass, target, e.getTargetException());
-      } catch (IllegalAccessException e) {
-         throw new WrapperException(wrapperClass, target, e);
-      }
-   }
-
-   /**
-    * Wrap a collection of objects to the given wrapper class.
-    */
-   public static <T extends SingleResourceTransportDto, W extends DomainWrapper<T>> Iterable<W> wrap(
-         final ApiContext<AbiquoApi> context, final Class<W> wrapperClass, @Nullable final Iterable<T> targets) {
-      if (targets == null) {
-         return null;
-      }
-
-      return transform(targets, new Function<T, W>() {
-         @Override
-         public W apply(final T input) {
-            return wrap(context, wrapperClass, input);
-         }
-      });
-   }
-
-   /**
-    * Unwrap a collection of objects.
-    */
-   public static <T extends SingleResourceTransportDto, W extends DomainWrapper<T>> Iterable<T> unwrap(
-         final Iterable<W> targets) {
-      return transform(targets, new Function<W, T>() {
-         @Override
-         public T apply(final W input) {
-            return input.unwrap();
-         }
-      });
-   }
-
-   /**
-    * Update or creates a link of "target" with the uri of a link from "source".
-    */
-   protected <T1 extends SingleResourceTransportDto, T2 extends SingleResourceTransportDto> void updateLink(
-         final T1 target, final String targetLinkRel, final T2 source, final String sourceLinkRel) {
-      RESTLink parent = null;
-
-      checkNotNull(source.searchLink(sourceLinkRel), ValidationErrors.MISSING_REQUIRED_LINK);
-
-      // Insert
-      if ((parent = target.searchLink(targetLinkRel)) == null) {
-         target.addLink(new RESTLink(targetLinkRel, source.searchLink(sourceLinkRel).getHref()));
-      }
-      // Replace
-      else {
-         parent.setHref(source.searchLink(sourceLinkRel).getHref());
-      }
-   }
-
-   /**
-    * Join a collection of {@link WrapperDto} objects in a single collection
-    * with all the elements of each wrapper object.
-    */
-   public static <T extends SingleResourceTransportDto> Iterable<T> join(
-         final Iterable<? extends WrapperDto<T>> collection) {
-      return concat(transform(collection, new Function<WrapperDto<T>, Collection<T>>() {
-         @Override
-         public Collection<T> apply(WrapperDto<T> input) {
-            return input.getCollection();
-         }
-      }));
-   }
-
-   /**
-    * Utility method to get an {@link AsyncTask} given an
-    * {@link AcceptedRequestDto}.
-    * 
-    * @param acceptedRequest
-    *           The accepted request dto.
-    * @return The async task.
-    */
-   protected AsyncTask<?, ?> getTask(final AcceptedRequestDto<String> acceptedRequest) {
-      RESTLink taskLink = acceptedRequest.getStatusLink();
-      checkNotNull(taskLink, ValidationErrors.MISSING_REQUIRED_LINK + AsyncTask.class);
-
-      // This will return null on untrackable tasks
-      TaskDto dto = context.getApi().getTaskApi().getTask(taskLink);
-      return newTask(context, dto);
-   }
-
-   /**
-    * Utility method to get all {@link AsyncTask} related to an
-    * {@link AcceptedRequestDto}.
-    * 
-    * @param acceptedRequest
-    *           The accepted request dto.
-    * @return The async task array.
-    */
-   protected AsyncTask<?, ?>[] getTasks(final AcceptedRequestDto<String> acceptedRequest) {
-      List<AsyncTask<?, ?>> tasks = Lists.newArrayList();
-
-      for (RESTLink link : acceptedRequest.getLinks()) {
-         // This will return null on untrackable tasks
-         TaskDto dto = context.getApi().getTaskApi().getTask(link);
-         if (dto != null) {
-            tasks.add(newTask(context, dto));
-         }
-      }
-
-      AsyncTask<?, ?>[] taskArr = new AsyncTask<?, ?>[tasks.size()];
-      return tasks.toArray(taskArr);
-   }
-
-   /**
-    * Creates a new {@link AsyncTask} for the given {@link TaskDto} and the
-    * given result class.
-    * 
-    * @param context
-    *           The API context.
-    * @param dto
-    *           The dto used to generate the domain object.
-    * @return The task domain object.
-    */
-   protected static AsyncTask<?, ?> newTask(final ApiContext<AbiquoApi> context, final TaskDto dto) {
-      // Can be null in untrackable tasks
-      if (dto == null) {
-         return null;
-      }
-
-      Class<? extends AsyncTask<?, ?>> taskClass = null;
-
-      switch (dto.getType().getOwnerType()) {
-         case CONVERSION:
-            taskClass = ConversionTask.class;
-            break;
-         case VIRTUAL_MACHINE_TEMPLATE:
-            taskClass = VirtualMachineTemplateTask.class;
-            break;
-         case VIRTUAL_MACHINE:
-            // A VirtualMachine task can generate a template (if task is an
-            // instance)
-            taskClass = dto.getType() == TaskType.INSTANCE || dto.getType() == TaskType.INSTANCE_PERSISTENT ? VirtualMachineTemplateTask.class
-                  : VirtualMachineTask.class;
-            break;
-      }
-
-      try {
-         Invokable<? extends AsyncTask<?, ?>, ? extends AsyncTask<?, ?>> cons = constructor(taskClass,
-               ApiContext.class, dto.getClass());
-         return cons.invoke(null, context, dto);
-      } catch (InvocationTargetException e) {
-         throw new WrapperException(taskClass, dto, e.getTargetException());
-      } catch (IllegalAccessException e) {
-         throw new WrapperException(taskClass, dto, e);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/PaginatedCollection.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/PaginatedCollection.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/PaginatedCollection.java
deleted file mode 100644
index ddf3933..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/PaginatedCollection.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.collect.PagedIterables.advance;
-import static org.jclouds.collect.PagedIterables.onlyPage;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.collect.IterableWithMarker;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.WrapperDto;
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-
-/**
- * This class represents a collection that is paginated.
- * <p>
- * Contains a single page of the collection, and all the information needed to
- * fetch the next page on demand.
- * 
- * 
- * @see PagedIterable
- */
-public class PaginatedCollection<T, W extends WrapperDto<T>> extends IterableWithMarker<T> {
-   protected final AbiquoApi api;
-   protected final W delegate;
-   protected final ParseXMLWithJAXB<W> parser;
-
-   public PaginatedCollection(AbiquoApi api, W delegate, ParseXMLWithJAXB<W> parser) {
-      this.api = checkNotNull(api, "api must not be null");
-      this.delegate = checkNotNull(delegate, "delegate must not be null");
-      this.parser = checkNotNull(parser, "parser must not be null");
-   }
-
-   @Override
-   public Iterator<T> iterator() {
-      return delegate.getCollection().iterator();
-   }
-
-   @Override
-   public Optional<Object> nextMarker() {
-      return Optional.<Object> fromNullable(delegate.searchLink("next"));
-   }
-
-   /**
-    * Transforms this {@link PaginatedCollection} into a {@link PagedIterable}
-    * so next the pages can be easily fetched.
-    * 
-    * @return A PagedIterable that is capable of fetching more pages.
-    */
-   public PagedIterable<T> toPagedIterable() {
-      return new ToPagedIterable<T, W>(api, parser).apply(this);
-   }
-
-   /**
-    * Returns a function that transforms the PaginatedCollection into a
-    * {@link PagedIterable}.
-    * <p>
-    * The PagedIterable will fetch the next pages based on the <code>next</code>
-    * link of the current object.
-    * <p>
-    * Subclasses may overwrite this one, to provide a concrete type for the
-    * parser parameter, so this function can be injected in the different api
-    * methods and be used as a transformer for the returned collection.
-    * 
-    */
-   public static class ToPagedIterable<T, W extends WrapperDto<T>> implements
-         Function<PaginatedCollection<T, W>, PagedIterable<T>> {
-      protected final AbiquoApi api;
-      protected final ParseXMLWithJAXB<W> parser;
-
-      public ToPagedIterable(AbiquoApi api, ParseXMLWithJAXB<W> parser) {
-         this.api = checkNotNull(api, "api must not be null");
-         this.parser = checkNotNull(parser, "parser must not be null");
-      }
-
-      @Override
-      public PagedIterable<T> apply(final PaginatedCollection<T, W> input) {
-         return input.nextMarker().isPresent() ? advance(input, nextPage(input)) : onlyPage(input);
-      }
-
-      protected Function<Object, IterableWithMarker<T>> nextPage(final PaginatedCollection<T, W> input) {
-         return new Function<Object, IterableWithMarker<T>>() {
-            @Override
-            public IterableWithMarker<T> apply(Object marker) {
-               checkArgument(marker instanceof RESTLink, "Marker must be a RESTLink");
-               RESTLink next = RESTLink.class.cast(marker);
-
-               // The Abiquo API does not provide the media types in the
-               // pagination links, but it will be the same type than the
-               // current page, so just set it.
-               next.setType(input.delegate.getMediaType());
-
-               W nextPage = parser.apply(api.get(next));
-               return new PaginatedCollection<T, W>(api, nextPage, parser);
-            }
-         };
-      }
-
-   }
-
-   // Delegate methods
-
-   public Integer getTotalSize() {
-      return delegate.getTotalSize();
-   }
-
-   public List<RESTLink> getLinks() {
-      return delegate.getLinks();
-   }
-
-   public RESTLink searchLink(String rel) {
-      return delegate.searchLink(rel);
-   }
-
-   public List<RESTLink> searchLinks(String rel) {
-      return delegate.searchLinks(rel);
-   }
-
-   public RESTLink searchLink(String rel, String title) {
-      return delegate.searchLink(rel, title);
-   }
-
-   public RESTLink searchLinkByHref(String href) {
-      return delegate.searchLinkByHref(href);
-   }
-
-   public Integer getIdFromLink(String rel) {
-      return delegate.getIdFromLink(rel);
-   }
-
-   public String getMediaType() {
-      return delegate.getMediaType();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/builder/LimitsBuilder.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/builder/LimitsBuilder.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/builder/LimitsBuilder.java
deleted file mode 100644
index 7b11d3c..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/builder/LimitsBuilder.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.builder;
-
-/**
- * Base class for all builders that represent limits.
- * 
- * @param <T>
- *           The type of the target builder.
- */
-public abstract class LimitsBuilder<T extends LimitsBuilder<T>> {
-   /** The default limits for enterprises (unlimited). */
-   protected static final int DEFAULT_LIMITS = 0;
-
-   protected Integer ramSoftLimitInMb = DEFAULT_LIMITS;
-
-   protected Integer ramHardLimitInMb = DEFAULT_LIMITS;
-
-   protected Integer cpuCountSoftLimit = DEFAULT_LIMITS;
-
-   protected Integer cpuCountHardLimit = DEFAULT_LIMITS;
-
-   protected Long hdSoftLimitInMb = Long.valueOf(DEFAULT_LIMITS);
-
-   protected Long hdHardLimitInMb = Long.valueOf(DEFAULT_LIMITS);
-
-   protected Long storageSoft = Long.valueOf(DEFAULT_LIMITS);
-
-   protected Long storageHard = Long.valueOf(DEFAULT_LIMITS);
-
-   protected Long vlansSoft = Long.valueOf(DEFAULT_LIMITS);
-
-   protected Long vlansHard = Long.valueOf(DEFAULT_LIMITS);
-
-   protected Long publicIpsSoft = Long.valueOf(DEFAULT_LIMITS);
-
-   protected Long publicIpsHard = Long.valueOf(DEFAULT_LIMITS);
-
-   @SuppressWarnings("unchecked")
-   public T ramLimits(final int soft, final int hard) {
-      this.ramSoftLimitInMb = soft;
-      this.ramHardLimitInMb = hard;
-      return (T) this;
-   }
-
-   @SuppressWarnings("unchecked")
-   public T cpuCountLimits(final int soft, final int hard) {
-      this.cpuCountSoftLimit = soft;
-      this.cpuCountHardLimit = hard;
-      return (T) this;
-   }
-
-   @SuppressWarnings("unchecked")
-   public T hdLimitsInMb(final long soft, final long hard) {
-      this.hdSoftLimitInMb = soft;
-      this.hdHardLimitInMb = hard;
-      return (T) this;
-   }
-
-   @SuppressWarnings("unchecked")
-   public T storageLimits(final long soft, final long hard) {
-      this.storageSoft = soft;
-      this.storageHard = hard;
-      return (T) this;
-   }
-
-   @SuppressWarnings("unchecked")
-   public T vlansLimits(final long soft, final long hard) {
-      this.vlansSoft = soft;
-      this.vlansHard = hard;
-      return (T) this;
-   }
-
-   @SuppressWarnings("unchecked")
-   public T publicIpsLimits(final long soft, final long hard) {
-      this.publicIpsSoft = soft;
-      this.publicIpsHard = hard;
-      return (T) this;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/Conversion.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/Conversion.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/Conversion.java
deleted file mode 100644
index 73abdd4..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/Conversion.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Date;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWithTasksWrapper;
-import org.jclouds.abiquo.domain.task.ConversionTask;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.ConversionState;
-import com.abiquo.model.enumerator.DiskFormatType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.appslibrary.ConversionDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds high level functionality to {@link ConversionDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/Conversion+Resource">
- *      http://community.abiquo.com/display/ABI20/Conversion+Resource</a>
- */
-public class Conversion extends DomainWithTasksWrapper<ConversionDto> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Conversion(final ApiContext<AbiquoApi> context, final ConversionDto target) {
-      super(context, target);
-   }
-
-   // Parent access
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Machine+Template+Resource"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Machine+Template+
-    *      Resource</a>
-    */
-   public VirtualMachineTemplate getVirtualMachineTemplate() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.VIRTUAL_MACHINE_TEMPLATE),
-            ValidationErrors.MISSING_REQUIRED_LINK + " " + ParentLinkName.VIRTUAL_MACHINE_TEMPLATE);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<VirtualMachineTemplateDto> parser = new ParseXMLWithJAXB<VirtualMachineTemplateDto>(
-            context.utils().xml(), TypeLiteral.get(VirtualMachineTemplateDto.class));
-
-      return wrap(context, VirtualMachineTemplate.class, parser.apply(response));
-   }
-
-   /**
-    * Starts a new BPM task to regenerate a failed conversion.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Conversion+Resource#ConversionResource-UpdateConversion"
-    *      > http://community.abiquo.com/display/ABI20/Conversion+Resource#
-    *      ConversionResource- UpdateConversion</a>
-    * @return The task reference to track its progress
-    */
-   public ConversionTask restartFailedConversion() {
-      return getVirtualMachineTemplate().requestConversion(getTargetFormat());
-   }
-
-   // Delegate methods
-
-   public String getSourcePath() {
-      return target.getSourcePath();
-   }
-
-   public ConversionState getState() {
-      return target.getState();
-   }
-
-   public String getTargetPath() {
-      return target.getTargetPath();
-   }
-
-   public Long getTargetSizeInBytes() {
-      return target.getTargetSizeInBytes();
-   }
-
-   public DiskFormatType getSourceFormat() {
-      return target.getSourceFormat();
-   }
-
-   public DiskFormatType getTargetFormat() {
-      return target.getTargetFormat();
-   }
-
-   public Date getStartTimestamp() {
-      return target.getStartTimestamp();
-   }
-
-   @Override
-   public String toString() {
-      return "Conversion [sourcePath=" + getSourcePath() + ", sourceFormat=" + getSourceFormat() + ", targetPath="
-            + getTargetPath() + ", targetFormat=" + getTargetFormat() + ", targetSizeInBytes=" + getTargetSizeInBytes()
-            + ", startTimestamp=" + getStartTimestamp() + ", state=" + getState() + "]";
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/HardDisk.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/HardDisk.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/HardDisk.java
deleted file mode 100644
index b08b850..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/HardDisk.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.infrastructure.storage.DiskManagementDto;
-
-/**
- * Represents a disk attached to a virtual machine.
- * <p>
- * This disks will be created when a virtual machine is deployed, and will be
- * destroyed when it is undeployed. If there is a need to use persistent
- * storage, a persistent {@link Volume} should be used instead.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/Hard+Disks+Resource">
- *      http://community.abiquo.com/display/ABI20/Hard+Disks+Resource</a>
- */
-public class HardDisk extends DomainWrapper<DiskManagementDto> {
-   /** The virtual datacenter where the hard disk belongs. */
-   private VirtualDatacenter virtualDatacenter;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected HardDisk(final ApiContext<AbiquoApi> context, final DiskManagementDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * Creates the hard disk in the selected virtual datacenter.
-    * <p>
-    * Once the hard disk has been created it can be attached to a virtual
-    * machine of the virtual datacenter.
-    */
-   public void save() {
-      target = context.getApi().getCloudApi().createHardDisk(virtualDatacenter.unwrap(), target);
-   }
-
-   /**
-    * Deletes the hard disk.
-    */
-   public void delete() {
-      context.getApi().getCloudApi().deleteHardDisk(target);
-      target = null;
-   }
-
-   // Parent access
-
-   /**
-    * Gets the virtual datacenter where the hard disk belongs to.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource#VirtualDatacenterResource-RetrieveaVirtualDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
-    *      Resource# VirtualDatacenterResource-RetrieveaVirtualDatacenter</a>
-    */
-   public VirtualDatacenter getVirtualDatacenter() {
-      Integer virtualDatacenterId = target.getIdFromLink(ParentLinkName.VIRTUAL_DATACENTER);
-      VirtualDatacenterDto dto = context.getApi().getCloudApi().getVirtualDatacenter(virtualDatacenterId);
-      virtualDatacenter = wrap(context, VirtualDatacenter.class, dto);
-      return virtualDatacenter;
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final VirtualDatacenter virtualDatacenter) {
-      return new Builder(context, virtualDatacenter);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private Long sizeInMb;
-
-      private VirtualDatacenter virtualDatacenter;
-
-      public Builder(final ApiContext<AbiquoApi> context, final VirtualDatacenter virtualDatacenter) {
-         super();
-         checkNotNull(virtualDatacenter, ValidationErrors.NULL_RESOURCE + VirtualDatacenter.class);
-         this.context = context;
-         this.virtualDatacenter = virtualDatacenter;
-      }
-
-      public Builder sizeInMb(final long sizeInMb) {
-         this.sizeInMb = sizeInMb;
-         return this;
-      }
-
-      public HardDisk build() {
-         DiskManagementDto dto = new DiskManagementDto();
-         dto.setSizeInMb(sizeInMb);
-
-         HardDisk hardDisk = new HardDisk(context, dto);
-         hardDisk.virtualDatacenter = virtualDatacenter;
-
-         return hardDisk;
-      }
-   }
-
-   // Delegate methods. Since a hard disk cannot be edited, setters are not
-   // visible
-
-   /**
-    * Returns the id of the hard disk.
-    */
-   public Integer getId() {
-      // TODO: DiskManagementDto does not have an id field
-      return target.getEditLink() == null ? null : target.getIdFromLink("edit");
-   }
-
-   /**
-    * Returns the size of the hard disk in MB.
-    */
-   public Long getSizeInMb() {
-      return target.getSizeInMb();
-   }
-
-   /**
-    * Returns the sequence number of the hard disk.
-    * <p>
-    * It will be computed when attaching the hard disk to a virtual machine and
-    * will determine the attachment order of the disk in the virtual machine.
-    */
-   public Integer getSequence() {
-      return target.getSequence();
-   }
-
-   @Override
-   public String toString() {
-      return "HardDisk [id=" + getId() + ", sizeInMb=" + getSizeInMb() + ", sequence=" + getSequence() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualAppliance.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualAppliance.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualAppliance.java
deleted file mode 100644
index 92be637..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualAppliance.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Arrays;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineOptions;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.task.AsyncTask;
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualApplianceState;
-import com.abiquo.server.core.cloud.VirtualApplianceStateDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.cloud.VirtualMachineTaskDto;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-
-/**
- * Represents a virtual appliance.
- * <p>
- * A virtual appliance is a logic container for virtual machines that together
- * make an appliance.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/Virtual+Appliance+Resource"
- *      >
- *      http://community.abiquo.com/display/ABI20/Virtual+Appliance+Resource</a>
- */
-public class VirtualAppliance extends DomainWrapper<VirtualApplianceDto> {
-   /** The virtual datacenter where the virtual appliance belongs. */
-   private VirtualDatacenter virtualDatacenter;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected VirtualAppliance(final ApiContext<AbiquoApi> context, final VirtualApplianceDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * Deletes the virtual appliance.
-    */
-   public void delete() {
-      context.getApi().getCloudApi().deleteVirtualAppliance(target);
-      target = null;
-   }
-
-   /**
-    * Creates the virtual appliance in the selected virtual datacenter.
-    */
-   public void save() {
-      target = context.getApi().getCloudApi().createVirtualAppliance(virtualDatacenter.unwrap(), target);
-   }
-
-   /**
-    * Updates the virtual appliance information when some of its properties have
-    * changed.
-    */
-   public void update() {
-      target = context.getApi().getCloudApi().updateVirtualAppliance(target);
-   }
-
-   // Parent access
-
-   /**
-    * Gets the virtual datacenter where the virtual appliance belongs to.
-    * 
-    * @return The virtual datacenter where the virtual appliance belongs to.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource#VirtualDatacenterResource-RetrieveaVirtualDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
-    *      Resource# VirtualDatacenterResource-RetrieveaVirtualDatacenter</a>
-    */
-   public VirtualDatacenter getVirtualDatacenter() {
-      Integer virtualDatacenterId = target.getIdFromLink(ParentLinkName.VIRTUAL_DATACENTER);
-      VirtualDatacenterDto dto = context.getApi().getCloudApi().getVirtualDatacenter(virtualDatacenterId);
-      virtualDatacenter = wrap(context, VirtualDatacenter.class, dto);
-      return virtualDatacenter;
-   }
-
-   /**
-    * Gets the enterprise where the virtual appliance belongs to.
-    * 
-    * @return The enterprise where the virtual appliance belongs to.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Enterprise+Resource#EnterpriseResource-RetrieveaEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/Enterprise+Resource#
-    *      EnterpriseResource- RetrieveaEnterprise</a>
-    */
-   public Enterprise getEnterprise() {
-      Integer enterpriseId = target.getIdFromLink(ParentLinkName.ENTERPRISE);
-      EnterpriseDto dto = context.getApi().getEnterpriseApi().getEnterprise(enterpriseId);
-      return wrap(context, Enterprise.class, dto);
-   }
-
-   /**
-    * Gets the current state of the virtual appliance.
-    * 
-    * @return The current state of the virtual appliance.
-    */
-   public VirtualApplianceState getState() {
-      VirtualApplianceStateDto stateDto = context.getApi().getCloudApi().getVirtualApplianceState(target);
-      return stateDto.getPower();
-   }
-
-   // Children access
-
-   /**
-    * Gets the list of virtual machines in the virtual appliance.
-    * 
-    * @return The list of virtual machines in the virtual appliance.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI18/Virtual+Machine+Resource#VirtualMachineResource-RetrievethelistofVirtualMachines."
-    *      > http://community.abiquo.com/display/ABI18/Virtual+Machine+Resource#
-    *      VirtualMachineResource -RetrievethelistofVirtualMachines.</a>
-    */
-   public Iterable<VirtualMachine> listVirtualMachines() {
-      PagedIterable<VirtualMachineWithNodeExtendedDto> vms = context.getApi().getCloudApi().listVirtualMachines(target);
-      return wrap(context, VirtualMachine.class, vms.concat());
-   }
-
-   /**
-    * Gets the list of virtual machines in the virtual appliance.
-    * 
-    * @return The list of virtual machines in the virtual appliance.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI18/Virtual+Machine+Resource#VirtualMachineResource-RetrievethelistofVirtualMachines."
-    *      > http://community.abiquo.com/display/ABI18/Virtual+Machine+Resource#
-    *      VirtualMachineResource -RetrievethelistofVirtualMachines.</a>
-    */
-   public Iterable<VirtualMachine> listVirtualMachines(final VirtualMachineOptions options) {
-      PaginatedCollection<VirtualMachineWithNodeExtendedDto, VirtualMachinesWithNodeExtendedDto> vms = context.getApi()
-            .getCloudApi().listVirtualMachines(target, options);
-      return wrap(context, VirtualMachine.class, vms.toPagedIterable().concat());
-   }
-
-   /**
-    * Gets a concrete virtual machine in the virtual appliance.
-    * 
-    * @param id
-    *           The id of the virtual machine.
-    * @return The requested virtual machine.
-    */
-   public VirtualMachine getVirtualMachine(final Integer id) {
-      VirtualMachineWithNodeExtendedDto vm = context.getApi().getCloudApi().getVirtualMachine(target, id);
-      return wrap(context, VirtualMachine.class, vm);
-   }
-
-   // Actions
-
-   /**
-    * Deploys the virtual appliance.
-    * <p>
-    * This method will start the deployment of all the virtual machines in the
-    * virtual appliance, and will return an {@link AsyncTask} reference for each
-    * deployment operation. The deployment will finish when all individual tasks
-    * finish.
-    * 
-    * @return The list of tasks corresponding to the deploy process of each
-    *         virtual machine in the appliance.
-    */
-   public VirtualMachineTask[] deploy() {
-      return deploy(false);
-   }
-
-   /**
-    * Deploys the virtual appliance.
-    * <p>
-    * This method will start the deployment of all the virtual machines in the
-    * virtual appliance, and will return an {@link AsyncTask} reference for each
-    * deploy operation. The deployment will finish when all individual tasks
-    * finish.
-    * 
-    * @param forceEnterpriseSoftLimits
-    *           Boolean indicating if the deployment must be executed even if
-    *           the enterprise soft limits are reached.
-    * @return The list of tasks corresponding to the deploy process of each
-    *         virtual machine in the appliance.
-    */
-   public VirtualMachineTask[] deploy(final boolean forceEnterpriseSoftLimits) {
-      VirtualMachineTaskDto force = new VirtualMachineTaskDto();
-      force.setForceEnterpriseSoftLimits(forceEnterpriseSoftLimits);
-
-      AcceptedRequestDto<String> response = context.getApi().getCloudApi().deployVirtualAppliance(unwrap(), force);
-
-      AsyncTask<?, ?>[] tasks = getTasks(response);
-      return Arrays.copyOf(tasks, tasks.length, VirtualMachineTask[].class);
-   }
-
-   /**
-    * Undeploys the virtual appliance.
-    * <p>
-    * This method will start the undeploy of all the virtual machines in the
-    * virtual appliance, and will return an {@link AsyncTask} reference for each
-    * undeploy operation. The undeploy will finish when all individual tasks
-    * finish.
-    * 
-    * @return The list of tasks corresponding to the undeploy process of each
-    *         virtual machine in the appliance.
-    */
-   public VirtualMachineTask[] undeploy() {
-      return undeploy(false);
-   }
-
-   /**
-    * Undeploys the virtual appliance.
-    * <p>
-    * This method will start the undeploy of all the virtual machines in the
-    * virtual appliance, and will return an {@link AsyncTask} reference for each
-    * undeploy operation. The undeploy will finish when all individual tasks
-    * finish.
-    * 
-    * @param forceUndeploy
-    *           Boolean flag to force the undeploy even if the virtual appliance
-    *           contains imported virtual machines.
-    * @return The list of tasks corresponding to the undeploy process of each
-    *         virtual machine in the appliance.
-    */
-   public VirtualMachineTask[] undeploy(final boolean forceUndeploy) {
-      VirtualMachineTaskDto force = new VirtualMachineTaskDto();
-      force.setForceUndeploy(forceUndeploy);
-
-      AcceptedRequestDto<String> response = context.getApi().getCloudApi().undeployVirtualAppliance(unwrap(), force);
-
-      AsyncTask<?, ?>[] tasks = getTasks(response);
-      return Arrays.copyOf(tasks, tasks.length, VirtualMachineTask[].class);
-   }
-
-   /**
-    * Returns a String message with the price info of the virtual appliance.
-    * 
-    * @return The price of the virtual appliance
-    */
-   public String getPrice() {
-      return context.getApi().getCloudApi().getVirtualAppliancePrice(target);
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final VirtualDatacenter virtualDatacenter) {
-      return new Builder(context, virtualDatacenter);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private String name;
-
-      private VirtualDatacenter virtualDatacenter;
-
-      public Builder(final ApiContext<AbiquoApi> context, final VirtualDatacenter virtualDatacenter) {
-         super();
-         checkNotNull(virtualDatacenter, ValidationErrors.NULL_RESOURCE + VirtualDatacenter.class);
-         this.virtualDatacenter = virtualDatacenter;
-         this.context = context;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder virtualDatacenter(final VirtualDatacenter virtualDatacenter) {
-         checkNotNull(virtualDatacenter, ValidationErrors.NULL_RESOURCE + VirtualDatacenter.class);
-         this.virtualDatacenter = virtualDatacenter;
-         return this;
-      }
-
-      public VirtualAppliance build() {
-         VirtualApplianceDto dto = new VirtualApplianceDto();
-         dto.setName(name);
-
-         VirtualAppliance virtualAppliance = new VirtualAppliance(context, dto);
-         virtualAppliance.virtualDatacenter = virtualDatacenter;
-
-         return virtualAppliance;
-      }
-
-      public static Builder fromVirtualAppliance(final VirtualAppliance in) {
-         return VirtualAppliance.builder(in.context, in.virtualDatacenter).name(in.getName());
-      }
-   }
-
-   // Delegate methods
-
-   public int getError() {
-      return target.getError();
-   }
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public void setHighDisponibility(final int highDisponibility) {
-      target.setHighDisponibility(highDisponibility);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public void setPublicApp(final int publicApp) {
-      target.setPublicApp(publicApp);
-   }
-
-   @Override
-   public String toString() {
-      return "VirtualAppliance [id=" + getId() + ", name=" + getName() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualDatacenter.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualDatacenter.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualDatacenter.java
deleted file mode 100644
index 36321aa..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualDatacenter.java
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.find;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWithLimitsWrapper;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.builder.LimitsBuilder;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineTemplateOptions;
-import org.jclouds.abiquo.domain.cloud.options.VolumeOptions;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.infrastructure.Tier;
-import org.jclouds.abiquo.domain.network.ExternalNetwork;
-import org.jclouds.abiquo.domain.network.Network;
-import org.jclouds.abiquo.domain.network.PrivateNetwork;
-import org.jclouds.abiquo.domain.network.PublicIp;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.enumerator.StatefulInclusion;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplatesDto;
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualAppliancesDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworksDto;
-import com.abiquo.server.core.infrastructure.storage.DiskManagementDto;
-import com.abiquo.server.core.infrastructure.storage.DisksManagementDto;
-import com.abiquo.server.core.infrastructure.storage.TierDto;
-import com.abiquo.server.core.infrastructure.storage.TiersDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.abiquo.server.core.infrastructure.storage.VolumesManagementDto;
-import com.google.common.base.Predicate;
-import com.google.common.collect.FluentIterable;
-
-/**
- * Represents a virtual datacenter.
- * <p>
- * Virtual datacenters expose a set of compute, storage and networking resources
- * that can be consumed by the tenants.
- * 
- * @see API: <a href=
- *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource">
- *      http
- *      ://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource</a>
- */
-public class VirtualDatacenter extends DomainWithLimitsWrapper<VirtualDatacenterDto> {
-   /** The enterprise where the rack belongs. */
-   private Enterprise enterprise;
-
-   /** The datacenter where the virtual datacenter will be deployed. */
-   private Datacenter datacenter;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected VirtualDatacenter(final ApiContext<AbiquoApi> context, final VirtualDatacenterDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * Delete the virtual datacenter.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource#VirtualDatacenterResource-DeleteanexistingVirtualDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
-    *      Resource#
-    *      VirtualDatacenterResource-DeleteanexistingVirtualDatacenter</a>
-    */
-   public void delete() {
-      context.getApi().getCloudApi().deleteVirtualDatacenter(target);
-      target = null;
-   }
-
-   /**
-    * Creates the virtual datacenter.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource#VirtualDatacenterResource-CreateanewVirtualDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
-    *      Resource# VirtualDatacenterResource-CreateanewVirtualDatacenter</a>
-    */
-   public void save() {
-      target = context.getApi().getCloudApi().createVirtualDatacenter(target, datacenter.unwrap(), enterprise.unwrap());
-   }
-
-   /**
-    * Updates the virtual datacenter information when some of its properties
-    * have changed.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource#VirtualDatacenterResource-UpdatesanexistingVirtualDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
-    *      Resource#
-    *      VirtualDatacenterResource-UpdatesanexistingVirtualDatacenter</a>
-    */
-   public void update() {
-      target = context.getApi().getCloudApi().updateVirtualDatacenter(target);
-   }
-
-   // Parent access
-
-   /**
-    * Gets the datacenter where this virtual datacenter is assigned.
-    * 
-    * @return The datacenter where this virtual datacenter is assigned.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Datacenter+Resource#DatacenterResource-RetrieveaDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Datacenter+Resource#
-    *      DatacenterResource- RetrieveaDatacenter</a>
-    */
-   public Datacenter getDatacenter() {
-      final Integer datacenterId = target.getIdFromLink(ParentLinkName.DATACENTER);
-      datacenter = find(getEnterprise().listAllowedDatacenters(), new Predicate<Datacenter>() {
-         @Override
-         public boolean apply(Datacenter input) {
-            return input.getId().equals(datacenterId);
-         }
-      });
-      return datacenter;
-   }
-
-   /**
-    * Gets the enterprise that owns this virtual datacenter.
-    * 
-    * @return The enterprise that owns this virtual datacenter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Enterprise+Resource#EnterpriseResource-RetrieveanEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/Enterprise+Resource#
-    *      EnterpriseResource- RetrieveanEnterprise</a>
-    */
-   public Enterprise getEnterprise() {
-      Integer enterpriseId = target.getIdFromLink(ParentLinkName.ENTERPRISE);
-      enterprise = wrap(context, Enterprise.class, context.getApi().getEnterpriseApi().getEnterprise(enterpriseId));
-      return enterprise;
-   }
-
-   // Children access
-
-   /**
-    * Lists all the virtual appliances in the virtual datacenter.
-    * 
-    * @return The list of virtual appliances in the virtual datacenter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Appliance+Resource#VirtualApplianceResource-RetrievethelistofVirtualAppliances"
-    *      >http://community.abiquo.com/display/ABI20/Virtual+Appliance+Resource
-    *      # VirtualApplianceResource-RetrievethelistofVirtualAppliances</a>
-    */
-   public Iterable<VirtualAppliance> listVirtualAppliances() {
-      VirtualAppliancesDto vapps = context.getApi().getCloudApi().listVirtualAppliances(target);
-      return wrap(context, VirtualAppliance.class, vapps.getCollection());
-   }
-
-   /**
-    * Gets the virtual appliance with the given id in the current virtual
-    * datacenter.
-    * 
-    * @param id
-    *           The id of the virtual appliance to get.
-    * @return The virtual appliance.
-    */
-   public VirtualAppliance getVirtualAppliance(final Integer id) {
-      VirtualApplianceDto vapp = context.getApi().getCloudApi().getVirtualAppliance(target, id);
-      return wrap(context, VirtualAppliance.class, vapp);
-   }
-
-   /**
-    * Lists the storage tiers that are available to the virtual datacenter.
-    * 
-    * @return The list of storage tiers that are available to the virtual
-    *         datacenter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource#VirtualDatacenterResource-Retrieveenabledtiers"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
-    *      Resource# VirtualDatacenterResource-Retrieveenabledtiers</a>
-    */
-   public Iterable<Tier> listStorageTiers() {
-      TiersDto tiers = context.getApi().getCloudApi().listStorageTiers(target);
-      return wrap(context, Tier.class, tiers.getCollection());
-   }
-
-   /**
-    * Gets the storage tier with the given id from the current virtual
-    * datacenter.
-    * 
-    * @param id
-    *           The id of the storage tier.
-    * @return The storage tier.
-    */
-   public Tier getStorageTier(final Integer id) {
-      TierDto tier = context.getApi().getCloudApi().getStorageTier(target, id);
-      return wrap(context, Tier.class, tier);
-   }
-
-   /**
-    * Lists all persistent volumes in the virtual datacenter.
-    * 
-    * @return The list of all persistent volumes in the virtual datacenter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Volume+Resource#VolumeResource-Retrievethelistofvolumes"
-    *      > http://community.abiquo.com/display/ABI20/Volume+Resource#
-    *      VolumeResource- Retrievethelistofvolumes</a>
-    */
-   public Iterable<Volume> listVolumes() {
-      PagedIterable<VolumeManagementDto> volumes = context.getApi().getCloudApi().listVolumes(target);
-      return wrap(context, Volume.class, volumes.concat());
-   }
-
-   public Iterable<Volume> listVolumes(VolumeOptions options) {
-      PaginatedCollection<VolumeManagementDto, VolumesManagementDto> volumes = context.getApi().getCloudApi()
-            .listVolumes(target, options);
-      return wrap(context, Volume.class, volumes.toPagedIterable().concat());
-   }
-
-   public Volume getVolume(final Integer id) {
-      VolumeManagementDto volume = context.getApi().getCloudApi().getVolume(target, id);
-      return wrap(context, Volume.class, volume);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Hard+Disks+Resource#HardDisksResource-GetthelistofHardDisksofaVirtualDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Hard+Disks+Resource#
-    *      HardDisksResource- GetthelistofHardDisksofaVirtualDatacenter</a>
-    */
-   public Iterable<HardDisk> listHardDisks() {
-      DisksManagementDto hardDisks = context.getApi().getCloudApi().listHardDisks(target);
-      return wrap(context, HardDisk.class, hardDisks.getCollection());
-   }
-
-   public HardDisk getHardDisk(final Integer id) {
-      DiskManagementDto hardDisk = context.getApi().getCloudApi().getHardDisk(target, id);
-      return wrap(context, HardDisk.class, hardDisk);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource#VirtualDatacenterResource-GetdefaultVLANusedbydefaultinVirtualDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
-    *      Resource#
-    *      VirtualDatacenterResource-GetdefaultVLANusedbydefaultinVirtualDatacenter
-    *      </a>
-    */
-   public Network<?> getDefaultNetwork() {
-      VLANNetworkDto network = context.getApi().getCloudApi().getDefaultNetwork(target);
-      return wrap(context, network.getType() == NetworkType.INTERNAL ? PrivateNetwork.class : ExternalNetwork.class,
-            network);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Private+Network+Resource#PrivateNetworkResource-RetrievealistofPrivateNetworks"
-    *      > http://community.abiquo.com/display/ABI20/Private+Network+Resource#
-    *      PrivateNetworkResource -RetrievealistofPrivateNetworks</a>
-    */
-   public Iterable<PrivateNetwork> listPrivateNetworks() {
-      VLANNetworksDto networks = context.getApi().getCloudApi().listPrivateNetworks(target);
-      return wrap(context, PrivateNetwork.class, networks.getCollection());
-   }
-
-   public PrivateNetwork getPrivateNetwork(final Integer id) {
-      VLANNetworkDto network = context.getApi().getCloudApi().getPrivateNetwork(target, id);
-      return wrap(context, PrivateNetwork.class, network);
-   }
-
-   public Iterable<VirtualMachineTemplate> listAvailableTemplates() {
-      PagedIterable<VirtualMachineTemplateDto> templates = context.getApi().getCloudApi()
-            .listAvailableTemplates(target);
-      return wrap(context, VirtualMachineTemplate.class, templates.concat());
-   }
-
-   public Iterable<VirtualMachineTemplate> listAvailableTemplates(final VirtualMachineTemplateOptions options) {
-      PaginatedCollection<VirtualMachineTemplateDto, VirtualMachineTemplatesDto> templates = context.getApi()
-            .getCloudApi().listAvailableTemplates(target, options);
-      return wrap(context, VirtualMachineTemplate.class, templates.toPagedIterable().concat());
-   }
-
-   public VirtualMachineTemplate getAvailableTemplate(final Integer id) {
-      PaginatedCollection<VirtualMachineTemplateDto, VirtualMachineTemplatesDto> templates = context.getApi()
-            .getCloudApi()
-            .listAvailableTemplates(target, VirtualMachineTemplateOptions.builder().idTemplate(id).build());
-
-      FluentIterable<VirtualMachineTemplateDto> all = templates.toPagedIterable().concat();
-      return wrap(context, VirtualMachineTemplate.class, all.first().orNull());
-   }
-
-   public VirtualMachineTemplate getAvailablePersistentTemplate(final Integer id) {
-      PaginatedCollection<VirtualMachineTemplateDto, VirtualMachineTemplatesDto> templates = context
-            .getApi()
-            .getCloudApi()
-            .listAvailableTemplates(target,
-                  VirtualMachineTemplateOptions.builder().idTemplate(id).persistent(StatefulInclusion.ALL).build());
-
-      FluentIterable<VirtualMachineTemplateDto> all = templates.toPagedIterable().concat();
-      return wrap(context, VirtualMachineTemplate.class, all.first().orNull());
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource#VirtualDatacenterResource-ListofPublicIPstopurchasebyVirtualDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
-    *      Resource#
-    *      VirtualDatacenterResource-ListofPublicIPstopurchasebyVirtualDatacenter
-    *      </a>
-    */
-   public Iterable<PublicIp> listAvailablePublicIps() {
-      PagedIterable<PublicIpDto> ips = context.getApi().getCloudApi().listAvailablePublicIps(target);
-      return wrap(context, PublicIp.class, ips.concat());
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource#VirtualDatacenterResource-ListofpurchasedPublicIPsbyVirtualDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
-    *      Resource#
-    *      VirtualDatacenterResource-ListofpurchasedPublicIPsbyVirtualDatacenter
-    *      </a>
-    */
-   public Iterable<PublicIp> listPurchasedPublicIps() {
-      PagedIterable<PublicIpDto> ips = context.getApi().getCloudApi().listPurchasedPublicIps(target);
-      return wrap(context, PublicIp.class, ips.concat());
-   }
-
-   public void purchasePublicIp(final PublicIp ip) {
-      checkNotNull(ip.unwrap().searchLink("purchase"), ValidationErrors.MISSING_REQUIRED_LINK);
-      context.getApi().getCloudApi().purchasePublicIp(ip.unwrap());
-   }
-
-   public void releasePublicIp(final PublicIp ip) {
-      checkNotNull(ip.unwrap().searchLink("release"), ValidationErrors.MISSING_REQUIRED_LINK);
-      context.getApi().getCloudApi().releasePublicIp(ip.unwrap());
-   }
-
-   // Actions
-
-   public void setDefaultNetwork(final Network<?> network) {
-      context.getApi().getCloudApi().setDefaultNetwork(target, network.unwrap());
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter,
-         final Enterprise enterprise) {
-      return new Builder(context, datacenter, enterprise);
-   }
-
-   public static class Builder extends LimitsBuilder<Builder> {
-      private ApiContext<AbiquoApi> context;
-
-      private String name;
-
-      private HypervisorType hypervisorType;
-
-      private Enterprise enterprise;
-
-      private Datacenter datacenter;
-
-      private PrivateNetwork network;
-
-      public Builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter, final Enterprise enterprise) {
-         super();
-         checkNotNull(datacenter, ValidationErrors.NULL_RESOURCE + Datacenter.class);
-         this.datacenter = datacenter;
-         checkNotNull(enterprise, ValidationErrors.NULL_RESOURCE + Enterprise.class);
-         this.enterprise = enterprise;
-         this.context = context;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder hypervisorType(final HypervisorType hypervisorType) {
-         this.hypervisorType = hypervisorType;
-         return this;
-      }
-
-      public Builder datacenter(final Datacenter datacenter) {
-         checkNotNull(datacenter, ValidationErrors.NULL_RESOURCE + Datacenter.class);
-         this.datacenter = datacenter;
-         return this;
-      }
-
-      public Builder enterprise(final Enterprise enterprise) {
-         checkNotNull(enterprise, ValidationErrors.NULL_RESOURCE + Enterprise.class);
-         this.enterprise = enterprise;
-         return this;
-      }
-
-      public Builder network(final PrivateNetwork network) {
-         checkNotNull(network, ValidationErrors.NULL_RESOURCE + PrivateNetwork.class);
-         this.network = network;
-         return this;
-      }
-
-      public VirtualDatacenter build() {
-         VirtualDatacenterDto dto = new VirtualDatacenterDto();
-         dto.setName(name);
-         dto.setRamLimitsInMb(ramSoftLimitInMb, ramHardLimitInMb);
-         dto.setCpuCountLimits(cpuCountSoftLimit, cpuCountHardLimit);
-         dto.setHdLimitsInMb(hdSoftLimitInMb, hdHardLimitInMb);
-         dto.setStorageLimits(storageSoft, storageHard);
-         dto.setVlansLimits(vlansSoft, vlansHard);
-         dto.setPublicIPLimits(publicIpsSoft, publicIpsHard);
-         dto.setName(name);
-         dto.setHypervisorType(hypervisorType);
-         dto.setVlan(network.unwrap());
-
-         VirtualDatacenter virtualDatacenter = new VirtualDatacenter(context, dto);
-         virtualDatacenter.datacenter = datacenter;
-         virtualDatacenter.enterprise = enterprise;
-
-         return virtualDatacenter;
-      }
-
-      public static Builder fromVirtualDatacenter(final VirtualDatacenter in) {
-         return VirtualDatacenter.builder(in.context, in.datacenter, in.enterprise).name(in.getName())
-               .ramLimits(in.getRamSoftLimitInMb(), in.getRamHardLimitInMb())
-               .cpuCountLimits(in.getCpuCountSoftLimit(), in.getCpuCountHardLimit())
-               .hdLimitsInMb(in.getHdSoftLimitInBytes(), in.getHdHardLimitInBytes())
-               .storageLimits(in.getStorageSoft(), in.getStorageHard())
-               .vlansLimits(in.getVlansSoft(), in.getVlansHard())
-               .publicIpsLimits(in.getPublicIpsSoft(), in.getPublicIpsHard()).hypervisorType(in.getHypervisorType());
-      }
-   }
-
-   // Delegate methods
-
-   public HypervisorType getHypervisorType() {
-      return target.getHypervisorType();
-   }
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public void setHypervisorType(final HypervisorType hypervisorType) {
-      target.setHypervisorType(hypervisorType);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   @Override
-   public String toString() {
-      return "VirtualDatacenter [id=" + getId() + ", type=" + getHypervisorType() + ", name=" + getName() + "]";
-   }
-
-}


[18/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Rack.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Rack.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Rack.java
deleted file mode 100644
index 881e357..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Rack.java
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.infrastructure.MachineDto;
-import com.abiquo.server.core.infrastructure.MachinesDto;
-import com.abiquo.server.core.infrastructure.RackDto;
-
-/**
- * Adds high level functionality to {@link RackDto}. Represents unmanaged racks
- * in the Abiquo platform.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/RackResource">
- *      http://community.abiquo.com/display/ABI20/RackResource</a>
- */
-public class Rack extends DomainWrapper<RackDto> {
-   /** The default minimum VLAN id. */
-   private static final int DEFAULT_VLAN_ID_MIN = 2;
-
-   /** The default maximum VLAN id. */
-   private static final int DEFAULT_VLAN_ID_MAX = 4094;
-
-   /** The default maximum VLAN per virtual datacenter. */
-   private static final int DEFAULT_VLAN_PER_VDC = 1;
-
-   /** The default nrsq factor. */
-   private static final int DEFAULT_NRSQ = 10;
-
-   /** The datacenter where the rack belongs. */
-   private Datacenter datacenter;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Rack(final ApiContext<AbiquoApi> context, final RackDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * Delete the unmanaged rack.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RackResource#RackResource-DeleteaRack"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/Rack+Resource#RackResource
-    *      #RackResource- DeleteaRack</a>
-    */
-   public void delete() {
-      context.getApi().getInfrastructureApi().deleteRack(target);
-      target = null;
-   }
-
-   /**
-    * Create a new unmanaged rack in Abiquo.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RackResource#RackResource-CreateanewRack"
-    *      > http://community.abiquo.com/display/ABI20/RackResource#RackResource
-    *      -CreateanewRack</a>
-    */
-   public void save() {
-      target = context.getApi().getInfrastructureApi().createRack(datacenter.unwrap(), target);
-   }
-
-   /**
-    * Update rack information in the server with the data from this rack.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RackResource#RackResource-UpdateanexistingRack"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/RackResource#RackResource-
-    *      UpdateanexistingRack </a>
-    */
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateRack(target);
-   }
-
-   // Parent access
-   /**
-    * Retrieve the datacenter where this rack is.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrieveadatacenter"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrieveadatacenter</a>
-    */
-   public Datacenter getDatacenter() {
-      Integer datacenterId = target.getIdFromLink(ParentLinkName.DATACENTER);
-      return wrap(context, Datacenter.class, context.getApi().getInfrastructureApi().getDatacenter(datacenterId));
-   }
-
-   // Children access
-
-   /**
-    * Retrieve the list of physical machines in this rack.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/MachineResource#MachineResource-RetrievealistofMachines"
-    *      > http://community.abiquo.com/display/ABI20/MachineResource#
-    *      MachineResource- RetrievealistofMachines</a>
-    */
-   public Iterable<Machine> listMachines() {
-      MachinesDto machines = context.getApi().getInfrastructureApi().listMachines(target);
-      return wrap(context, Machine.class, machines.getCollection());
-   }
-
-   /**
-    * Retrieve a single physical machine.
-    * 
-    * @param id
-    *           Unique ID of the physical machine in this rack.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/MachineResource#MachineResource-RetrieveaMachine"
-    *      > http://community.abiquo.com/display/ABI20/MachineResource#
-    *      MachineResource-RetrieveaMachine </a>
-    * @return Unmanaged rack with the given id or <code>null</code> if it does
-    *         not exist.
-    */
-   public Machine getMachine(final Integer id) {
-      MachineDto machine = context.getApi().getInfrastructureApi().getMachine(target, id);
-      return wrap(context, Machine.class, machine);
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-      return new Builder(context, datacenter);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private Integer id;
-
-      private String name;
-
-      private String shortDescription;
-
-      private boolean haEnabled = false;
-
-      private Integer nrsq = DEFAULT_NRSQ;
-
-      private Integer vlanIdMax = DEFAULT_VLAN_ID_MAX;
-
-      private Integer vlanIdMin = DEFAULT_VLAN_ID_MIN;
-
-      private Integer vlanPerVdcReserved = DEFAULT_VLAN_PER_VDC;
-
-      private String vlansIdAvoided;
-
-      private Datacenter datacenter;
-
-      public Builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-         super();
-         checkNotNull(datacenter, ValidationErrors.NULL_RESOURCE + Datacenter.class);
-         this.datacenter = datacenter;
-         this.context = context;
-      }
-
-      public Builder id(final Integer id) {
-         this.id = id;
-         return this;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder shortDescription(final String shortDescription) {
-         this.shortDescription = shortDescription;
-         return this;
-      }
-
-      public Builder haEnabled(final boolean haEnabled) {
-         this.haEnabled = haEnabled;
-         return this;
-      }
-
-      public Builder nrsq(final int nrsq) {
-         this.nrsq = nrsq;
-         return this;
-      }
-
-      public Builder vlanIdMax(final int vlanIdMax) {
-         this.vlanIdMax = vlanIdMax;
-         return this;
-      }
-
-      public Builder vlanIdMin(final int vlanIdMin) {
-         this.vlanIdMin = vlanIdMin;
-         return this;
-      }
-
-      public Builder vlanPerVdcReserved(final int vlanPerVdcExpected) {
-         this.vlanPerVdcReserved = vlanPerVdcExpected;
-         return this;
-      }
-
-      public Builder vlansIdAvoided(final String vlansIdAvoided) {
-         this.vlansIdAvoided = vlansIdAvoided;
-         return this;
-      }
-
-      public Builder datacenter(final Datacenter datacenter) {
-         checkNotNull(datacenter, ValidationErrors.NULL_RESOURCE + Datacenter.class);
-         this.datacenter = datacenter;
-         return this;
-      }
-
-      public Rack build() {
-         RackDto dto = new RackDto();
-         dto.setId(id);
-         dto.setName(name);
-         dto.setShortDescription(shortDescription);
-         dto.setHaEnabled(haEnabled);
-         dto.setNrsq(nrsq);
-         dto.setVlanIdMax(vlanIdMax);
-         dto.setVlanIdMin(vlanIdMin);
-         dto.setVlanPerVdcReserved(vlanPerVdcReserved);
-         dto.setVlansIdAvoided(vlansIdAvoided);
-         Rack rack = new Rack(context, dto);
-         rack.datacenter = datacenter;
-         return rack;
-      }
-
-      public static Builder fromRack(final Rack in) {
-         return Rack.builder(in.context, in.datacenter).id(in.getId()).name(in.getName())
-               .shortDescription(in.getShortDescription()).haEnabled(in.isHaEnabled()).nrsq(in.getNrsq())
-               .vlanIdMax(in.getVlanIdMax()).vlanIdMin(in.getVlanIdMin())
-               .vlanPerVdcReserved(in.getVlanPerVdcReserved()).vlansIdAvoided(in.getVlansIdAvoided());
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getShortDescription() {
-      return target.getShortDescription();
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public void setShortDescription(final String description) {
-      target.setShortDescription(description);
-   }
-
-   public void setHaEnabled(final boolean haEnabled) {
-      target.setHaEnabled(haEnabled);
-   }
-
-   public boolean isHaEnabled() {
-      return target.isHaEnabled();
-   }
-
-   public Integer getNrsq() {
-      return target.getNrsq();
-   }
-
-   public Integer getVlanIdMax() {
-      return target.getVlanIdMax();
-   }
-
-   public Integer getVlanIdMin() {
-      return target.getVlanIdMin();
-   }
-
-   public Integer getVlanPerVdcReserved() {
-      return target.getVlanPerVdcReserved();
-   }
-
-   public String getVlansIdAvoided() {
-      return target.getVlansIdAvoided();
-   }
-
-   public void setNrsq(final Integer nrsq) {
-      target.setNrsq(nrsq);
-   }
-
-   public void setVlanIdMax(final Integer vlanIdMax) {
-      target.setVlanIdMax(vlanIdMax);
-   }
-
-   public void setVlanIdMin(final Integer vlanIdMin) {
-      target.setVlanIdMin(vlanIdMin);
-   }
-
-   public void setVlanPerVdcReserved(final Integer vlanPerVdcReserved) {
-      target.setVlanPerVdcReserved(vlanPerVdcReserved);
-   }
-
-   public void setVlansIdAvoided(final String vlansIdAvoided) {
-      target.setVlansIdAvoided(vlansIdAvoided);
-   }
-
-   @Override
-   public String toString() {
-      return "Rack [id=" + getId() + ", name=" + getName() + ", description=" + getShortDescription() + ", haEnabled="
-            + isHaEnabled() + ", nrsq=" + getNrsq() + ", vlanIdMax=" + getVlanIdMax() + ", vlanIdMin=" + getVlanIdMin()
-            + ", vlanPerVdcReserved=" + getVlanPerVdcReserved() + ", vlansIdAvoided=" + getVlansIdAvoided() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/RemoteService.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/RemoteService.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/RemoteService.java
deleted file mode 100644
index 5c0c8ef..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/RemoteService.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.RemoteServiceType;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.RemoteServiceDto;
-
-/**
- * Adds high level functionality to {@link RemoteServiceDto}. The Remote Service
- * resource offers the functionality of managing the remote services of a
- * datacenter in a logical way.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/RemoteServiceResource">
- *      http://community.abiquo.com/display/ABI20/RemoteServiceResource</a>
- */
-public class RemoteService extends DomainWrapper<RemoteServiceDto> {
-   /** The default status. */
-   private static final int DEFAULT_STATUS = 0;
-
-   /** The datacenter using the remote service. */
-   private Datacenter datacenter;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected RemoteService(final ApiContext<AbiquoApi> context, final RemoteServiceDto target) {
-      super(context, target);
-   }
-
-   /**
-    * Delete the remote service.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RemoteServiceResource#RemoteServiceResource-DeleteaRemoteService"
-    *      > http://community.abiquo.com/display/ABI20/RemoteServiceResource#
-    *      RemoteServiceResource- DeleteaRemoteService</a>
-    */
-   public void delete() {
-      context.getApi().getInfrastructureApi().deleteRemoteService(target);
-      target = null;
-   }
-
-   /**
-    * Create the remote service.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RemoteServiceResource#RemoteServiceResource-CreateaRemoteService"
-    *      > http://community.abiquo.com/display/ABI20/RemoteServiceResource#
-    *      RemoteServiceResource- CreateaRemoteService</a>
-    */
-   public void save() {
-      target = context.getApi().getInfrastructureApi().createRemoteService(datacenter.unwrap(), target);
-   }
-
-   /**
-    * Update remote service information in the server with the data from this
-    * remote service.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RemoteServiceResource#RemoteServiceResource-UpdateanexistingRemoteService"
-    *      > http://community.abiquo.com/display/ABI20/RemoteServiceResource#
-    *      RemoteServiceResource- UpdateanexistingRemoteService</a>
-    */
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateRemoteService(target);
-   }
-
-   /**
-    * Check remote service availability.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/RemoteServiceResource#RemoteServiceResource-CheckthestatusofaRemoteService"
-    *      > http://community.abiquo.com/display/ABI20/RemoteServiceResource#
-    *      RemoteServiceResource- CheckthestatusofaRemoteService</a>
-    */
-   public boolean isAvailable() {
-      // If the remote service can not be checked, assume it is available
-      return !getType().canBeChecked() ? true : context.getApi().getInfrastructureApi().isAvailable(target);
-   }
-
-   // Parent access
-
-   /**
-    * Retrieve the datacenter using this remotes service.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrieveadatacenter"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrieveadatacenter</a>
-    */
-   public Datacenter getDatacenter() {
-      Integer datacenterId = target.getIdFromLink(ParentLinkName.DATACENTER);
-      DatacenterDto dto = context.getApi().getInfrastructureApi().getDatacenter(datacenterId);
-      datacenter = wrap(context, Datacenter.class, dto);
-      return datacenter;
-   }
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-      return new Builder(context, datacenter);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private Integer id;
-
-      private Datacenter datacenter;
-
-      private String ip;
-
-      private Integer port;
-
-      private RemoteServiceType type;
-
-      private Integer status = DEFAULT_STATUS;
-
-      // To be used only internally by the builder
-      private String uri;
-
-      public Builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-         super();
-         checkNotNull(datacenter, ValidationErrors.NULL_RESOURCE + Datacenter.class);
-         this.datacenter = datacenter;
-         this.context = context;
-      }
-
-      public Builder datacenter(final Datacenter datacenter) {
-         checkNotNull(datacenter, ValidationErrors.NULL_RESOURCE + Datacenter.class);
-         this.datacenter = datacenter;
-         return this;
-      }
-
-      public Builder status(final int status) {
-         this.status = status;
-         return this;
-      }
-
-      public Builder type(final RemoteServiceType type) {
-         this.type = type;
-         return this;
-      }
-
-      public Builder ip(final String ip) {
-         this.ip = ip;
-         return this;
-      }
-
-      public Builder port(final int port) {
-         this.port = port;
-         return this;
-      }
-
-      private String generateUri(final String ip, final Integer port, final RemoteServiceType type) {
-         return type.getDefaultProtocol() + ip + ":" + port + "/" + type.getServiceMapping();
-      }
-
-      public RemoteService build() {
-         if (uri == null) {
-            checkNotNull(ip, ValidationErrors.MISSING_REQUIRED_FIELD + "ip");
-            checkNotNull(type, ValidationErrors.MISSING_REQUIRED_FIELD + "type");
-
-            uri = generateUri(ip, port == null ? type.getDefaultPort() : port, type);
-         }
-
-         RemoteServiceDto dto = new RemoteServiceDto();
-         dto.setId(id);
-         dto.setType(type);
-         dto.setUri(uri);
-         dto.setStatus(status);
-         RemoteService remoteservice = new RemoteService(context, dto);
-         remoteservice.datacenter = datacenter;
-         return remoteservice;
-      }
-
-      public static Builder fromRemoteService(final RemoteService in) {
-         Builder builder = RemoteService.builder(in.context, in.getDatacenter()).status(in.getStatus())
-               .type(in.getType());
-         builder.uri = in.getUri();
-         return builder;
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public RemoteServiceType getType() {
-      return target.getType();
-   }
-
-   public int getStatus() {
-      return target.getStatus();
-   }
-
-   public String getUri() {
-      return target.getUri();
-   }
-
-   public void setStatus(final int status) {
-      target.setStatus(status);
-   }
-
-   public void setType(final RemoteServiceType type) {
-      target.setType(type);
-   }
-
-   public void setUri(final String uri) {
-      target.setUri(uri);
-   }
-
-   @Override
-   public String toString() {
-      return "RemoteService [id=" + getId() + ", available=" + isAvailable() + ", type=" + getType() + ", status="
-            + getStatus() + ", uri" + getUri() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StorageDevice.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StorageDevice.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StorageDevice.java
deleted file mode 100644
index 03d1456..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StorageDevice.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.infrastructure.options.StoragePoolOptions;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDeviceDto;
-import com.abiquo.server.core.infrastructure.storage.StoragePoolDto;
-import com.abiquo.server.core.infrastructure.storage.StoragePoolsDto;
-import com.abiquo.server.core.infrastructure.storage.TiersDto;
-
-/**
- * Adds high level functionality to {@link StorageDeviceDto}. The Storage Device
- * Resource offers the functionality of managing the external storage.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/StorageDeviceResource">
- *      http://community.abiquo.com/display/ABI20/StorageDeviceResource</a>
- */
-public class StorageDevice extends DomainWrapper<StorageDeviceDto> {
-   /** The datacenter where the storage device is. */
-   private Datacenter datacenter;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected StorageDevice(final ApiContext<AbiquoApi> context, final StorageDeviceDto target) {
-      super(context, target);
-   }
-
-   /**
-    * Delete the storage device.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StorageDeviceResource#StorageDeviceResource-Deleteastoragedevice"
-    *      > http://community.abiquo.com/display/ABI20/StorageDeviceResource#
-    *      StorageDeviceResource- Deleteastoragedevice</a>
-    */
-   public void delete() {
-      context.getApi().getInfrastructureApi().deleteStorageDevice(target);
-      target = null;
-   }
-
-   /**
-    * Create a new storage device.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StorageDeviceResource#StorageDeviceResource-Createastoragedevice"
-    *      > http://community.abiquo.com/display/ABI20/StorageDeviceResource#
-    *      StorageDeviceResource- Createastoragedevice</a>
-    */
-   public void save() {
-      target = context.getApi().getInfrastructureApi().createStorageDevice(datacenter.unwrap(), target);
-   }
-
-   /**
-    * Update storage device information in the server with the data from this
-    * device.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StorageDeviceResource#StorageDeviceResource-Updateastoragedevice"
-    *      > http://community.abiquo.com/display/ABI20/StorageDeviceResource#
-    *      StorageDeviceResource- Updateastoragedevice</a>
-    */
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateStorageDevice(target);
-   }
-
-   // Parent access
-
-   /**
-    * Retrieve the datacenter where this storage device is.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrieveadatacenter"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrieveadatacenter</a>
-    */
-   public Datacenter getDatacenter() {
-      Integer datacenterId = target.getIdFromLink(ParentLinkName.DATACENTER);
-      DatacenterDto dto = context.getApi().getInfrastructureApi().getDatacenter(datacenterId);
-      datacenter = wrap(context, Datacenter.class, dto);
-      return datacenter;
-   }
-
-   // Children access
-
-   /**
-    * Retrieve the list of storage pools in this device (synchronized with the
-    * device).
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StoragePoolResource#StoragePoolResource-Retrievestoragepools"
-    *      > http://community.abiquo.com/display/ABI20/StoragePoolResource#
-    *      StoragePoolResource- Retrievestoragepools</a>
-    * @return Synchronized list of storage pools in this device.
-    */
-   public Iterable<StoragePool> listRemoteStoragePools() {
-      StoragePoolsDto storagePools = context.getApi().getInfrastructureApi()
-            .listStoragePools(target, StoragePoolOptions.builder().sync(true).build());
-
-      Iterable<StoragePool> storagePoolList = wrap(context, StoragePool.class, storagePools.getCollection());
-
-      for (StoragePool storagePool : storagePoolList) {
-         storagePool.storageDevice = this;
-      }
-
-      return storagePoolList;
-   }
-
-   /**
-    * Retrieve the list of storage pools in this device from Abiquo database
-    * (may not be synchronized with the device).
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StoragePoolResource#StoragePoolResource-Retrievestoragepools"
-    *      > http://community.abiquo.com/display/ABI20/StoragePoolResource#
-    *      StoragePoolResource- Retrievestoragepools</a>
-    * @return Unsynchronized list of storage pools in this device.
-    */
-   public Iterable<StoragePool> listStoragePools() {
-      StoragePoolsDto storagePools = context.getApi().getInfrastructureApi()
-            .listStoragePools(target, StoragePoolOptions.builder().sync(false).build());
-      return wrap(context, StoragePool.class, storagePools.getCollection());
-   }
-
-   /**
-    * Retrieve a single storage pool in this device from Abiquo database.
-    * 
-    * @param id
-    *           Unique ID of the storage device in this datacenter.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StoragePoolResource#StoragePoolResource-Retrievearegisteredpool"
-    *      > http://community.abiquo.com/display/ABI20/StoragePoolResource#
-    *      StoragePoolResource- Retrievearegisteredpool</a>
-    * @return Storage pool with the given id or <code>null</code> if it does not
-    *         exist.
-    */
-   public StoragePool getStoragePool(final String id) {
-      StoragePoolDto storagePool = context.getApi().getInfrastructureApi().getStoragePool(target, id);
-      return wrap(context, StoragePool.class, storagePool);
-   }
-
-   /**
-    * Retrieve the list of tiers in the datacenter using this device.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/TierResource#TierResource-Retrievethelistoftiers"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/TierResource#TierResource-
-    *      Retrievethelistoftiers </a>
-    * @return List of tiers in the datacenter using this device.
-    */
-   public Iterable<Tier> listTiersFromDatacenter() {
-      DatacenterDto datacenter;
-
-      if (this.datacenter == null) {
-         datacenter = new DatacenterDto();
-         datacenter.setId(target.getIdFromLink(ParentLinkName.DATACENTER));
-      } else {
-         datacenter = this.getDatacenter().unwrap();
-      }
-
-      TiersDto dto = context.getApi().getInfrastructureApi().listTiers(datacenter);
-      return DomainWrapper.wrap(context, Tier.class, dto.getCollection());
-   }
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-      return new Builder(context, datacenter);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private Datacenter datacenter;
-
-      private String iscsiIp;
-
-      private Integer iscsiPort;
-
-      private String managementIp;
-
-      private Integer managementPort;
-
-      private String name;
-
-      private String password;
-
-      private String type;
-
-      private String username;
-
-      public Builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-         super();
-         checkNotNull(datacenter, ValidationErrors.NULL_RESOURCE + Datacenter.class);
-         this.datacenter = datacenter;
-         this.context = context;
-      }
-
-      public Builder datacenter(final Datacenter datacenter) {
-         checkNotNull(datacenter, ValidationErrors.NULL_RESOURCE + Datacenter.class);
-         this.datacenter = datacenter;
-         return this;
-      }
-
-      public Builder iscsiIp(final String iscsiIp) {
-         this.iscsiIp = iscsiIp;
-         return this;
-      }
-
-      public Builder iscsiPort(final int iscsiPort) {
-         this.iscsiPort = iscsiPort;
-         return this;
-      }
-
-      public Builder password(final String password) {
-         this.password = password;
-         return this;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder managementPort(final int managementPort) {
-         this.managementPort = managementPort;
-         return this;
-      }
-
-      public Builder managementIp(final String managementIp) {
-         this.managementIp = managementIp;
-         return this;
-      }
-
-      public Builder type(final String type) {
-         this.type = type;
-         return this;
-      }
-
-      public Builder username(final String username) {
-         this.username = username;
-         return this;
-      }
-
-      public StorageDevice build() {
-         StorageDeviceDto dto = new StorageDeviceDto();
-         dto.setIscsiIp(iscsiIp);
-         dto.setIscsiPort(iscsiPort);
-         dto.setManagementIp(managementIp);
-         dto.setManagementPort(managementPort);
-         dto.setName(name);
-         dto.setPassword(password);
-         dto.setStorageTechnology(type);
-         dto.setUsername(username);
-         StorageDevice storageDevice = new StorageDevice(context, dto);
-         storageDevice.datacenter = datacenter;
-         return storageDevice;
-      }
-
-      public static Builder fromStorageDevice(final StorageDevice in) {
-         Builder builder = StorageDevice.builder(in.context, in.getDatacenter()).iscsiIp(in.getIscsiIp())
-               .iscsiPort(in.getIscsiPort()).managementIp(in.getManagementIp()).managementPort(in.getManagementPort())
-               .name(in.getName()).password(in.getPassword()).type(in.getType()).username(in.getUsername());
-
-         return builder;
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getIscsiIp() {
-      return target.getIscsiIp();
-   }
-
-   public int getIscsiPort() {
-      return target.getIscsiPort();
-   }
-
-   public String getManagementIp() {
-      return target.getManagementIp();
-   }
-
-   public int getManagementPort() {
-      return target.getManagementPort();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getPassword() {
-      return target.getPassword();
-   }
-
-   public String getType() {
-      return target.getStorageTechnology();
-   }
-
-   public String getUsername() {
-      return target.getUsername();
-   }
-
-   public void setIscsiIp(final String iscsiIp) {
-      target.setIscsiIp(iscsiIp);
-   }
-
-   public void setIscsiPort(final int iscsiPort) {
-      target.setIscsiPort(iscsiPort);
-   }
-
-   public void setManagementIp(final String managementIp) {
-      target.setManagementIp(managementIp);
-   }
-
-   public void setManagementPort(final int managementPort) {
-      target.setManagementPort(managementPort);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public void setPassword(final String password) {
-      target.setPassword(password);
-   }
-
-   public void setType(final String type) {
-      target.setStorageTechnology(type);
-   }
-
-   public void setUsername(final String username) {
-      target.setUsername(username);
-   }
-
-   @Override
-   public String toString() {
-      return "StorageDevice [id=" + getId() + ", iscsiIp=" + getIscsiIp() + ", iscsiPort=" + getIscsiPort()
-            + ", managementIp=" + getManagementIp() + ", managementPort=" + getManagementPort() + ", name=" + getName()
-            + ", password=" + getPassword() + ", type=" + getType() + ", user=" + getUsername() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StorageDeviceMetadata.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StorageDeviceMetadata.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StorageDeviceMetadata.java
deleted file mode 100644
index 7690b3c..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StorageDeviceMetadata.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.infrastructure.storage.StorageDeviceMetadataDto;
-
-/**
- * metadata describing a Storage Device.
- */
-public class StorageDeviceMetadata extends DomainWrapper<StorageDeviceMetadataDto> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected StorageDeviceMetadata(final ApiContext<AbiquoApi> context, final StorageDeviceMetadataDto target) {
-      super(context, target);
-   }
-
-   // Delegate methods
-
-   public String getType() {
-      return target.getType();
-   }
-
-   public int getDefaultManagementPort() {
-      return target.getDefaultManagementPort();
-   }
-
-   public int getDefaultIscsiPort() {
-      return target.getDefaultIscsiPort();
-   }
-
-   public boolean requiresAuthentication() {
-      return target.isRequiresAuthentication();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StoragePool.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StoragePool.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StoragePool.java
deleted file mode 100644
index 0c639b3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/StoragePool.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.config.Privilege;
-import org.jclouds.abiquo.domain.infrastructure.options.StoragePoolOptions;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.storage.StorageDeviceDto;
-import com.abiquo.server.core.infrastructure.storage.StoragePoolDto;
-import com.abiquo.server.core.infrastructure.storage.TierDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds high level functionality to {@link StoragePoolDto}. The Storage Pool
- * Resource allows you to perform any administrative task for remote pools.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/StoragePoolResource">
- *      http://community.abiquo.com/display/ABI20/StoragePoolResource</a>
- */
-public class StoragePool extends DomainWrapper<StoragePoolDto> {
-
-   /** The datacenter where the storage device is. */
-   // Package protected to allow the storage device to be set automatically when
-   // discovering the
-   // pools in a device.
-   StorageDevice storageDevice;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected StoragePool(final ApiContext<AbiquoApi> context, final StoragePoolDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * Delete the storage pool.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StoragePoolResource#StoragePoolResource-Deleteastoragepool"
-    *      > http://community.abiquo.com/display/ABI20/StoragePoolResource#
-    *      StoragePoolResource- Deleteastoragepool</a>
-    */
-   public void delete() {
-      context.getApi().getInfrastructureApi().deleteStoragePool(target);
-      target = null;
-   }
-
-   /**
-    * Create a storage pool. Create a storage pool means registering an existing
-    * storage pool obtained from {@link StorageDevice#listRemoteStoragePools}
-    * method and saving it. The Storage Pools must be associated with a Tier
-    * using {@link #setTier}.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StoragePoolResource#StoragePoolResource-Createastoragepoolwithatierlink"
-    *      > http://community.abiquo.com/display/ABI20/StoragePoolResource#
-    *      StoragePoolResource- Createastoragepoolwithatierlink</a>
-    */
-   public void save() {
-      target = context.getApi().getInfrastructureApi().createStoragePool(storageDevice.unwrap(), target);
-   }
-
-   /**
-    * Update pool information in the server with the data from this pool.
-    * Storage pool parameters cannot be updated by a user, so the parameters are
-    * only a representation of the remote pool. Although the whole storage pool
-    * entity is sent to the API in the update call, the only thing a user can
-    * change is the tier that the pool belongs to by calling {@link #setTier}.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Storage+Pool+Resource#StoragePoolResource-UpdateaStoragePool"
-    *      > http://community.abiquo.com/display/ABI20/Storage+Pool+Resource#
-    *      StoragePoolResource- UpdateaStoragePool</a>
-    */
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateStoragePool(target);
-   }
-
-   @Override
-   public void refresh() {
-      target = context.getApi().getInfrastructureApi()
-            .refreshStoragePool(target, StoragePoolOptions.builder().sync(true).build());
-   }
-
-   /**
-    * Define the tier in which the pool will be added.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StoragePoolResource#StoragePoolResource-Createastoragepoolwithatierlink"
-    *      > http://community.abiquo.com/display/ABI20/StoragePoolResource#
-    *      StoragePoolResource- Createastoragepoolwithatierlink</a>
-    */
-   public void setTier(final Tier tier) {
-      checkNotNull(tier, ValidationErrors.NULL_RESOURCE + Privilege.class);
-      checkNotNull(tier.getId(), ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + Tier.class);
-
-      this.updateLink(target, ParentLinkName.TIER, tier.unwrap(), "edit");
-   }
-
-   // Parent access
-
-   /**
-    * Get the device where the pool belongs.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StorageDeviceResource#StorageDeviceResource-Retrieveastoragedevice"
-    *      > http://community.abiquo.com/display/ABI20/StorageDeviceResource#
-    *      StorageDeviceResource- Retrieveastoragedevice</a>
-    */
-   public StorageDevice getStorageDevice() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.STORAGE_DEVICE),
-            ValidationErrors.MISSING_REQUIRED_LINK + " " + ParentLinkName.STORAGE_DEVICE);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<StorageDeviceDto> parser = new ParseXMLWithJAXB<StorageDeviceDto>(context.utils().xml(),
-            TypeLiteral.get(StorageDeviceDto.class));
-
-      return wrap(context, StorageDevice.class, parser.apply(response));
-   }
-
-   // Children access
-
-   /**
-    * Get the tier assigned to the pool. The storage pool needs to be persisted
-    * in Abiquo first.
-    * 
-    * @return The tier assigned to this storage pool.
-    */
-   public Tier getTier() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.TIER), ValidationErrors.MISSING_REQUIRED_LINK + " "
-            + ParentLinkName.TIER);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<TierDto> parser = new ParseXMLWithJAXB<TierDto>(context.utils().xml(),
-            TypeLiteral.get(TierDto.class));
-
-      return wrap(context, Tier.class, parser.apply(response));
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final StorageDevice storageDevice) {
-      return new Builder(context, storageDevice);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-      private StorageDevice storageDevice;
-      private String name;
-      private Long totalSizeInMb;
-
-      public Builder(final ApiContext<AbiquoApi> context, final StorageDevice storageDevice) {
-         super();
-         checkNotNull(storageDevice, ValidationErrors.NULL_RESOURCE + StorageDevice.class);
-         this.storageDevice = storageDevice;
-         this.context = context;
-      }
-
-      public Builder storageDevice(final StorageDevice storageDevice) {
-         checkNotNull(storageDevice, ValidationErrors.NULL_RESOURCE + StorageDevice.class);
-         this.storageDevice = storageDevice;
-         return this;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder totalSizeInMb(final long totalSizeInMb) {
-         this.totalSizeInMb = totalSizeInMb;
-         return this;
-      }
-
-      public StoragePool build() {
-         StoragePoolDto dto = new StoragePoolDto();
-         dto.setName(name);
-         dto.setTotalSizeInMb(totalSizeInMb);
-         StoragePool storagePool = new StoragePool(context, dto);
-         storagePool.storageDevice = storageDevice;
-         return storagePool;
-      }
-
-      public static Builder fromStoragePool(final StoragePool in) {
-         Builder builder = StoragePool.builder(in.context, in.getStorageDevice()).totalSizeInMb(in.getTotalSizeInMb());
-
-         return builder;
-      }
-   }
-
-   // Delegate methods
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public long getTotalSizeInMb() {
-      return target.getTotalSizeInMb();
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public void setTotalSizeInMb(final long totalSizeInMb) {
-      target.setTotalSizeInMb(totalSizeInMb);
-   }
-
-   // Readonly property
-   public String getUUID() {
-      return target.getIdStorage();
-   }
-
-   @Override
-   public String toString() {
-      return "StoragePool [name=" + getName() + ", totalSizeInMb=" + getTotalSizeInMb() + ", uuid=" + getUUID() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Tier.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Tier.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Tier.java
deleted file mode 100644
index 5858e1c..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/Tier.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.storage.StoragePoolsDto;
-import com.abiquo.server.core.infrastructure.storage.TierDto;
-
-/**
- * Adds high level functionality to {@link TierDto}. The Tier Resource offers
- * the functionality of managing the logic of QoS volume management. These are
- * only logical levels of QoS and the real QoS (networking speed, volume
- * replication, availability) must be configured manually in the infrastructure.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/TierResource">
- *      http://community.abiquo.com/display/ABI20/TierResource</a>
- */
-public class Tier extends DomainWrapper<TierDto> {
-   /** The datacenter where the tier belongs. */
-   private Datacenter datacenter;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Tier(final ApiContext<AbiquoApi> context, final TierDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * Update tier information in the server with the data from this tier.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/TierResource#TierResource-Updateatier"
-    *      >
-    *      http://community.abiquo.com/display/ABI20/TierResource#TierResource-
-    *      Updateatier</a>
-    */
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateTier(target);
-   }
-
-   /**
-    * Retrieve the list of storage pools in this tier.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/StoragePoolResource#StoragePoolResource-Retrievestoragepools"
-    *      > http://community.abiquo.com/display/ABI20/StoragePoolResource#
-    *      StoragePoolResource- Retrievestoragepools</a>
-    * @return List of storage pools in this tier.
-    */
-   public Iterable<StoragePool> listStoragePools() {
-      StoragePoolsDto storagePools = context.getApi().getInfrastructureApi().listStoragePools(target);
-      return wrap(context, StoragePool.class, storagePools.getCollection());
-   }
-
-   // Parent access
-
-   /**
-    * Retrieve the datacenter where this tier is.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrieveadatacenter"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrieveadatacenter</a>
-    */
-   public Datacenter getDatacenter() {
-      Integer datacenterId = target.getIdFromLink(ParentLinkName.DATACENTER);
-      DatacenterDto dto = context.getApi().getInfrastructureApi().getDatacenter(datacenterId);
-      datacenter = wrap(context, Datacenter.class, dto);
-      return datacenter;
-   }
-
-   // Delegate methods
-
-   public String getDescription() {
-      return target.getDescription();
-   }
-
-   public boolean getEnabled() {
-      return target.getEnabled();
-   }
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public void setDescription(final String description) {
-      target.setDescription(description);
-   }
-
-   public void setEnabled(final boolean enabled) {
-      target.setEnabled(enabled);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   @Override
-   public String toString() {
-      return "Tier [id=" + getId() + ", description=" + getDescription() + ", enabled=" + getEnabled() + ", name="
-            + getName() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/DatacenterOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/DatacenterOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/DatacenterOptions.java
deleted file mode 100644
index 528480a..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/DatacenterOptions.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query datacenters.
- */
-public class DatacenterOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      DatacenterOptions options = new DatacenterOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-      private String ip;
-
-      public Builder ip(final String ip) {
-         this.ip = ip;
-         return this;
-      }
-
-      public DatacenterOptions build() {
-         DatacenterOptions options = new DatacenterOptions();
-         if (ip != null) {
-            options.queryParameters.put("ip", ip);
-         }
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/IpmiOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/IpmiOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/IpmiOptions.java
deleted file mode 100644
index 9d77c98..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/IpmiOptions.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query ipmi config.
- */
-public class IpmiOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      IpmiOptions options = new IpmiOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-      private Integer port;
-
-      /**
-       * Set the optional hypervisor port.
-       */
-      public Builder port(final int port) {
-         this.port = port;
-         return this;
-      }
-
-      public IpmiOptions build() {
-         IpmiOptions options = new IpmiOptions();
-         if (port != null) {
-            options.queryParameters.put("port", port.toString());
-         }
-
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/MachineOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/MachineOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/MachineOptions.java
deleted file mode 100644
index f008a70..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/MachineOptions.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query machines.
- */
-public class MachineOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      MachineOptions options = new MachineOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-      private Integer port;
-
-      private Boolean sync;
-
-      /**
-       * Set the optional hypervisor port.
-       */
-      public Builder port(final int port) {
-         this.port = port;
-         return this;
-      }
-
-      /**
-       * Set the optional sync param.
-       */
-      public Builder sync(final boolean sync) {
-         this.sync = sync;
-         return this;
-      }
-
-      public MachineOptions build() {
-         MachineOptions options = new MachineOptions();
-         if (port != null) {
-            options.queryParameters.put("port", port.toString());
-         }
-
-         if (sync != null) {
-            options.queryParameters.put("sync", sync.toString());
-         }
-
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/StoragePoolOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/StoragePoolOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/StoragePoolOptions.java
deleted file mode 100644
index abe6fe7..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/infrastructure/options/StoragePoolOptions.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query storage pools.
- */
-
-public class StoragePoolOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      StoragePoolOptions options = new StoragePoolOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-      private Boolean sync;
-
-      /**
-       * Set the optional sync param.
-       */
-      public Builder sync(final boolean sync) {
-         this.sync = sync;
-         return this;
-      }
-
-      public StoragePoolOptions build() {
-         StoragePoolOptions options = new StoragePoolOptions();
-         if (sync != null) {
-            options.queryParameters.put("sync", sync.toString());
-         }
-
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/AbstractPublicIp.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/AbstractPublicIp.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/AbstractPublicIp.java
deleted file mode 100644
index 28849b1..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/AbstractPublicIp.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.infrastructure.network.AbstractInfrastructureIpDto;
-
-/**
- * Adds generic high level functionality to {@link AbstractInfrastructureIpDto}.
- */
-public abstract class AbstractPublicIp<T extends AbstractInfrastructureIpDto, N extends Network<?>> extends Ip<T, N> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected AbstractPublicIp(final ApiContext<AbiquoApi> context, final T target) {
-      super(context, target);
-   }
-
-   // Delegate methods
-
-   public boolean isAvailable() {
-      return target.isAvailable();
-   }
-
-   public boolean isQuarantine() {
-      return target.isQuarantine();
-   }
-
-   public void setAvailable(final boolean available) {
-      target.setAvailable(available);
-   }
-
-   public void setQuarantine(final boolean quarantine) {
-      target.setQuarantine(quarantine);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/ExternalIp.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/ExternalIp.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/ExternalIp.java
deleted file mode 100644
index 42ba2db..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/ExternalIp.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.network.ExternalIpDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds generic high level functionality to {@link ExternalIpDto}.
- */
-public class ExternalIp extends AbstractPublicIp<ExternalIpDto, ExternalNetwork> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected ExternalIp(final ApiContext<AbiquoApi> context, final ExternalIpDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   @Override
-   public ExternalNetwork getNetwork() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.EXTERNAL_NETWORK),
-            ValidationErrors.MISSING_REQUIRED_LINK + " " + ParentLinkName.EXTERNAL_NETWORK);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<VLANNetworkDto> parser = new ParseXMLWithJAXB<VLANNetworkDto>(context.utils().xml(),
-            TypeLiteral.get(VLANNetworkDto.class));
-
-      return wrap(context, ExternalNetwork.class, parser.apply(response));
-   }
-
-   @Override
-   public NetworkType getNetworkType() {
-      return NetworkType.EXTERNAL;
-   }
-
-   @Override
-   public String toString() {
-      return "ExternalIp [networkType=" + getNetworkType() + ", available=" + isAvailable() + ", quarantine="
-            + isQuarantine() + ", id=" + getId() + ", ip=" + getIp() + ", mac=" + getMac() + ", name=" + getName()
-            + ", networkName=" + getNetworkName() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/ExternalNetwork.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/ExternalNetwork.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/ExternalNetwork.java
deleted file mode 100644
index b481ef2..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/ExternalNetwork.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.network.ExternalIpDto;
-import com.abiquo.server.core.infrastructure.network.ExternalIpsDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.google.common.base.Optional;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds high level functionality to external {@link VLANNetworkDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/Public+Network+Resource"
- *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource</a>
- */
-public class ExternalNetwork extends Network<ExternalIp> {
-   /** The datacenter where the network belongs. */
-   private Datacenter datacenter;
-
-   /** The enterprise where the network belongs. */
-   private Enterprise enterprise;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected ExternalNetwork(final ApiContext<AbiquoApi> context, final VLANNetworkDto target) {
-      super(context, target);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Public+Network+Resource#PublicNetworkResource-DeleteanExternalNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource#
-    *      PublicNetworkResource -DeleteanExternalNetwork</a>
-    */
-   @Override
-   public void delete() {
-      context.getApi().getInfrastructureApi().deleteNetwork(target);
-      target = null;
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Public+Network+Resource#PublicNetworkResource-CreateanewExternalNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource#
-    *      PublicNetworkResource -CreateanewExternalNetwork</a>
-    */
-   @Override
-   public void save() {
-      this.addEnterpriseLink();
-      target = context.getApi().getInfrastructureApi().createNetwork(datacenter.unwrap(), target);
-   }
-
-   /**
-    * @see API: <a href=
-    *      " http://community.abiquo.com/display/ABI20/Public+Network+Resource#PublicNetworkResource-UpdateanExternalNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource#
-    *      PublicNetworkResource -UpdateanExternalNetwork</a>
-    */
-   @Override
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateNetwork(target);
-   }
-
-   @Override
-   public Iterable<ExternalIp> listIps() {
-      PagedIterable<ExternalIpDto> ips = context.getApi().getInfrastructureApi().listExternalIps(target);
-      return wrap(context, ExternalIp.class, ips.concat());
-   }
-
-   @Override
-   public Iterable<ExternalIp> listIps(final IpOptions options) {
-      PaginatedCollection<ExternalIpDto, ExternalIpsDto> ips = context.getApi().getInfrastructureApi()
-            .listExternalIps(target, options);
-      return wrap(context, ExternalIp.class, ips.toPagedIterable().concat());
-   }
-
-   @Override
-   public ExternalIp getIp(final Integer id) {
-      ExternalIpDto ip = context.getApi().getInfrastructureApi().getExternalIp(target, id);
-      return wrap(context, ExternalIp.class, ip);
-   }
-
-   // Parent access
-
-   public Enterprise getEnterprise() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.ENTERPRISE), ValidationErrors.MISSING_REQUIRED_LINK
-            + " " + ParentLinkName.ENTERPRISE);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<EnterpriseDto> parser = new ParseXMLWithJAXB<EnterpriseDto>(context.utils().xml(),
-            TypeLiteral.get(EnterpriseDto.class));
-
-      enterprise = wrap(context, Enterprise.class, parser.apply(response));
-      return enterprise;
-   }
-
-   public Datacenter getDatacenter() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.DATACENTER), ValidationErrors.MISSING_REQUIRED_LINK
-            + " " + ParentLinkName.DATACENTER);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<DatacenterDto> parser = new ParseXMLWithJAXB<DatacenterDto>(context.utils().xml(),
-            TypeLiteral.get(DatacenterDto.class));
-
-      datacenter = wrap(context, Datacenter.class, parser.apply(response));
-      return datacenter;
-   }
-
-   private void addEnterpriseLink() {
-      checkNotNull(enterprise, ValidationErrors.NULL_RESOURCE + Enterprise.class);
-      checkNotNull(enterprise.getId(), ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + Enterprise.class);
-
-      RESTLink link = enterprise.unwrap().getEditLink();
-      checkNotNull(link, ValidationErrors.MISSING_REQUIRED_LINK);
-
-      target.addLink(new RESTLink("enterprise", link.getHref()));
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter,
-         final Enterprise enterprise) {
-      return new Builder(context, datacenter, enterprise);
-   }
-
-   public static class Builder extends NetworkBuilder<Builder> {
-      private Datacenter datacenter;
-
-      private Enterprise enterprise;
-
-      private Optional<NetworkServiceType> networkServiceType = Optional.absent();
-
-      public Builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter, final Enterprise enterprise) {
-         super(context);
-         this.datacenter = checkNotNull(datacenter,
-               ValidationErrors.NULL_RESOURCE + Datacenter.class.getCanonicalName());
-         this.enterprise = checkNotNull(enterprise,
-               ValidationErrors.NULL_RESOURCE + Enterprise.class.getCanonicalName());
-         this.context = context;
-      }
-
-      public Builder datacenter(final Datacenter datacenter) {
-         this.datacenter = checkNotNull(datacenter,
-               ValidationErrors.NULL_RESOURCE + Datacenter.class.getCanonicalName());
-         return this;
-      }
-
-      public Builder enterprise(final Enterprise enterprise) {
-         this.enterprise = checkNotNull(enterprise,
-               ValidationErrors.NULL_RESOURCE + Enterprise.class.getCanonicalName());
-         return this;
-      }
-
-      public Builder networkServiceType(final NetworkServiceType networkServiceType) {
-         this.networkServiceType = Optional.of(networkServiceType);
-         return this;
-      }
-
-      public ExternalNetwork build() {
-         VLANNetworkDto dto = new VLANNetworkDto();
-         dto.setName(name);
-         dto.setTag(tag);
-         dto.setGateway(gateway);
-         dto.setAddress(address);
-         dto.setMask(mask);
-         dto.setPrimaryDNS(primaryDNS);
-         dto.setSecondaryDNS(secondaryDNS);
-         dto.setSufixDNS(suffixDNS);
-         dto.setDefaultNetwork(defaultNetwork == null ? Boolean.FALSE : defaultNetwork);
-         dto.setUnmanaged(Boolean.FALSE);
-         dto.setType(NetworkType.EXTERNAL);
-
-         NetworkServiceType nst = networkServiceType.or(datacenter.defaultNetworkServiceType());
-         dto.addLink(new RESTLink("networkservicetype", nst.unwrap().getEditLink().getHref()));
-
-         ExternalNetwork network = new ExternalNetwork(context, dto);
-         network.datacenter = datacenter;
-         network.enterprise = enterprise;
-
-         return network;
-      }
-
-      public static Builder fromExternalNetwork(final ExternalNetwork in) {
-         return ExternalNetwork.builder(in.context, in.datacenter, in.enterprise).name(in.getName()).tag(in.getTag())
-               .gateway(in.getGateway()).address(in.getAddress()).mask(in.getMask()).primaryDNS(in.getPrimaryDNS())
-               .secondaryDNS(in.getSecondaryDNS()).suffixDNS(in.getSuffixDNS()).defaultNetwork(in.getDefaultNetwork());
-      }
-   }
-
-   @Override
-   public String toString() {
-      return "External " + super.toString();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Ip.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Ip.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Ip.java
deleted file mode 100644
index b39d088..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Ip.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.server.core.infrastructure.network.AbstractIpDto;
-
-/**
- * Adds generic high level functionality to {@link AbstractIpDto}.
- */
-public abstract class Ip<T extends AbstractIpDto, N extends Network<?>> extends DomainWrapper<T> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Ip(final ApiContext<AbiquoApi> context, final T target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   public abstract N getNetwork();
-
-   public abstract NetworkType getNetworkType();
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getIp() {
-      return target.getIp();
-   }
-
-   public String getMac() {
-      return target.getMac();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getNetworkName() {
-      return target.getNetworkName();
-   }
-
-   @Override
-   public String toString() {
-      return "Ip [id=" + getId() + ", ip=" + getIp() + ", mac=" + getMac() + ", name=" + getName() + ", networkName="
-            + getNetworkName() + "]";
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Network.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Network.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Network.java
deleted file mode 100644
index f9646b6..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Network.java
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.transform;
-
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.abiquo.predicates.IpPredicates;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.google.common.base.Function;
-
-/**
- * Adds generic high level functionality to {@link VLANNetworkDto}.
- */
-public abstract class Network<T extends Ip<?, ?>> extends DomainWrapper<VLANNetworkDto> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Network(final ApiContext<AbiquoApi> context, final VLANNetworkDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   public abstract void save();
-
-   public abstract void update();
-
-   public abstract void delete();
-
-   public abstract Iterable<T> listIps();
-
-   public abstract Iterable<T> listIps(IpOptions options);
-
-   public abstract T getIp(Integer id);
-
-   public Iterable<T> listUnusedIps() {
-      return filter(listIps(), IpPredicates.<T> notUsed());
-   }
-
-   // Builder
-
-   public static class NetworkBuilder<T extends NetworkBuilder<T>> {
-      protected ApiContext<AbiquoApi> context;
-
-      protected String name;
-
-      protected Integer tag;
-
-      protected String gateway;
-
-      protected String address;
-
-      protected Integer mask;
-
-      protected String primaryDNS;
-
-      protected String secondaryDNS;
-
-      protected String suffixDNS;
-
-      protected Boolean defaultNetwork;
-
-      public NetworkBuilder(final ApiContext<AbiquoApi> context) {
-         super();
-         this.context = context;
-      }
-
-      @SuppressWarnings("unchecked")
-      public T name(final String name) {
-         this.name = name;
-         return (T) this;
-      }
-
-      @SuppressWarnings("unchecked")
-      public T tag(final Integer tag) {
-         this.tag = tag;
-         return (T) this;
-      }
-
-      @SuppressWarnings("unchecked")
-      public T gateway(final String gateway) {
-         this.gateway = gateway;
-         return (T) this;
-      }
-
-      @SuppressWarnings("unchecked")
-      public T address(final String address) {
-         this.address = address;
-         return (T) this;
-      }
-
-      @SuppressWarnings("unchecked")
-      public T mask(final int mask) {
-         this.mask = mask;
-         return (T) this;
-      }
-
-      @SuppressWarnings("unchecked")
-      public T primaryDNS(final String primaryDNS) {
-         this.primaryDNS = primaryDNS;
-         return (T) this;
-      }
-
-      @SuppressWarnings("unchecked")
-      public T secondaryDNS(final String secondaryDNS) {
-         this.secondaryDNS = secondaryDNS;
-         return (T) this;
-      }
-
-      @SuppressWarnings("unchecked")
-      public T suffixDNS(final String suffixDNS) {
-         this.suffixDNS = suffixDNS;
-         return (T) this;
-      }
-
-      @SuppressWarnings("unchecked")
-      public T defaultNetwork(final Boolean defaultNetwork) {
-         this.defaultNetwork = defaultNetwork;
-         return (T) this;
-      }
-   }
-
-   public PrivateNetwork toPrivateNetwork() {
-      checkArgument(target.getType().equals(NetworkType.INTERNAL),
-            ValidationErrors.INVALID_NETWORK_TYPE + target.getType());
-
-      return wrap(context, PrivateNetwork.class, target);
-
-   }
-
-   public ExternalNetwork toExternalNetwork() {
-      checkArgument(target.getType().equals(NetworkType.EXTERNAL),
-            ValidationErrors.INVALID_NETWORK_TYPE + target.getType());
-
-      return wrap(context, ExternalNetwork.class, target);
-
-   }
-
-   public PublicNetwork toPublicNetwork() {
-      checkArgument(target.getType().equals(NetworkType.PUBLIC),
-            ValidationErrors.INVALID_NETWORK_TYPE + target.getType());
-
-      return wrap(context, PublicNetwork.class, target);
-
-   }
-
-   public UnmanagedNetwork toUnmanagedNetwork() {
-      checkArgument(target.getType().equals(NetworkType.UNMANAGED),
-            ValidationErrors.INVALID_NETWORK_TYPE + target.getType());
-
-      return wrap(context, UnmanagedNetwork.class, target);
-
-   }
-
-   // Delegate methods
-
-   public String getAddress() {
-      return target.getAddress();
-   }
-
-   public Boolean getDefaultNetwork() {
-      return target.getDefaultNetwork();
-   }
-
-   public String getGateway() {
-      return target.getGateway();
-   }
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public Integer getMask() {
-      return target.getMask();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getPrimaryDNS() {
-      return target.getPrimaryDNS();
-   }
-
-   public String getSecondaryDNS() {
-      return target.getSecondaryDNS();
-   }
-
-   public String getSuffixDNS() {
-      return target.getSufixDNS();
-   }
-
-   public Integer getTag() {
-      return target.getTag();
-   }
-
-   public NetworkType getType() {
-      return target.getType();
-   }
-
-   public void setAddress(final String address) {
-      target.setAddress(address);
-   }
-
-   public void setDefaultNetwork(final Boolean defaultNetwork) {
-      target.setDefaultNetwork(defaultNetwork);
-   }
-
-   public void setGateway(final String gateway) {
-      target.setGateway(gateway);
-   }
-
-   public void setMask(final Integer mask) {
-      target.setMask(mask);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public void setPrimaryDNS(final String primaryDNS) {
-      target.setPrimaryDNS(primaryDNS);
-   }
-
-   public void setSecondaryDNS(final String secondaryDNS) {
-      target.setSecondaryDNS(secondaryDNS);
-   }
-
-   public void setSuffixDNS(final String suffixDNS) {
-      target.setSufixDNS(suffixDNS);
-   }
-
-   public void setTag(final Integer tag) {
-      target.setTag(tag);
-   }
-
-   @Override
-   public String toString() {
-      return "Network [id=" + getId() + ", address=" + getAddress() + ", defaultNetwork=" + getDefaultNetwork()
-            + ", gateway=" + getGateway() + ", mask=" + getMask() + ", name=" + getName() + ", primaryDNS="
-            + getPrimaryDNS() + ", secondaryDNS=" + getSecondaryDNS() + ", suffixDNS=" + getSuffixDNS() + ", tag="
-            + getTag() + ", type=" + getType() + "]";
-   }
-
-   public static Network<?> wrapNetwork(final ApiContext<AbiquoApi> context, final VLANNetworkDto dto) {
-      if (dto == null) {
-         return null;
-      }
-
-      Network<?> network = null;
-
-      switch (dto.getType()) {
-         case EXTERNAL:
-            network = wrap(context, ExternalNetwork.class, dto);
-            break;
-         case EXTERNAL_UNMANAGED:
-            // TODO: How do we manage External && unmanaged networks ?
-            throw new UnsupportedOperationException("EXTERNAL_UNMANAGED networks not supported yet");
-         case INTERNAL:
-            network = wrap(context, PrivateNetwork.class, dto);
-            break;
-         case PUBLIC:
-            network = wrap(context, PublicNetwork.class, dto);
-            break;
-         case UNMANAGED:
-            network = wrap(context, UnmanagedNetwork.class, dto);
-            break;
-      }
-
-      return network;
-   }
-
-   public static Iterable<Network<?>> wrapNetworks(final ApiContext<AbiquoApi> context, final List<VLANNetworkDto> dtos) {
-      return transform(dtos, new Function<VLANNetworkDto, Network<?>>() {
-         @Override
-         public Network<?> apply(VLANNetworkDto input) {
-            return wrapNetwork(context, input);
-         }
-      });
-   }
-}


[04/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureApiTest.java
deleted file mode 100644
index fa8a3e8..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureApiTest.java
+++ /dev/null
@@ -1,1277 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.reflect.Reflection2.method;
-
-import java.io.IOException;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.AbiquoFallbacks.FalseIfNotAvailable;
-import org.jclouds.abiquo.AbiquoFallbacks.PropagateAbiquoExceptionOnNotFoundOr4xx;
-import org.jclouds.abiquo.domain.EnterpriseResources;
-import org.jclouds.abiquo.domain.InfrastructureResources;
-import org.jclouds.abiquo.domain.NetworkResources;
-import org.jclouds.abiquo.domain.infrastructure.options.DatacenterOptions;
-import org.jclouds.abiquo.domain.infrastructure.options.IpmiOptions;
-import org.jclouds.abiquo.domain.infrastructure.options.MachineOptions;
-import org.jclouds.abiquo.domain.infrastructure.options.StoragePoolOptions;
-import org.jclouds.abiquo.domain.network.options.NetworkOptions;
-import org.jclouds.fallbacks.MapHttp4xxCodesToExceptions;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.http.functions.ReleasePayloadAndReturn;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-import org.jclouds.http.functions.ReturnTrueIf2xx;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.enumerator.RemoteServiceType;
-import com.abiquo.server.core.cloud.HypervisorTypesDto;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.DatacentersLimitsDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.DatacentersDto;
-import com.abiquo.server.core.infrastructure.MachineDto;
-import com.abiquo.server.core.infrastructure.MachineIpmiStateDto;
-import com.abiquo.server.core.infrastructure.MachineStateDto;
-import com.abiquo.server.core.infrastructure.MachinesDto;
-import com.abiquo.server.core.infrastructure.RackDto;
-import com.abiquo.server.core.infrastructure.RacksDto;
-import com.abiquo.server.core.infrastructure.RemoteServiceDto;
-import com.abiquo.server.core.infrastructure.RemoteServicesDto;
-import com.abiquo.server.core.infrastructure.network.ExternalIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworksDto;
-import com.abiquo.server.core.infrastructure.network.VlanTagAvailabilityDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDeviceDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDevicesDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDevicesMetadataDto;
-import com.abiquo.server.core.infrastructure.storage.StoragePoolDto;
-import com.abiquo.server.core.infrastructure.storage.StoragePoolsDto;
-import com.abiquo.server.core.infrastructure.storage.TierDto;
-import com.abiquo.server.core.infrastructure.storage.TiersDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Tests annotation parsing of {@code InfrastructureApi}
- */
-@Test(groups = "unit", testName = "InfrastructureApiTest")
-public class InfrastructureApiTest extends BaseAbiquoApiTest<InfrastructureApi> {
-   /*********************** Datacenter ***********************/
-
-   public void testListDatacenters() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listDatacenters");
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.of()));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacentersDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCreateDatacenter() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "createDatacenter", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/datacenters HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacenterDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.datacenterPostPayload()), DatacenterDto.class,
-            DatacenterDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetDatacenter() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getDatacenter", Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacenterDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateDatacenter() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "updateDatacenter", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/datacenters/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacenterDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.datacenterPutPayload()), DatacenterDto.class,
-            DatacenterDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteDatacenter() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "deleteDatacenter", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/datacenters/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListLimitsDatacenter() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listLimits", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/action/getLimits HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacentersLimitsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Hypervisor ***********************/
-
-   public void testGetHypervisorTypeFromMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getHypervisorTypeFromMachine", DatacenterDto.class,
-            DatacenterOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(
-            method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(),
-                  DatacenterOptions.builder().ip("10.60.1.120").build())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/action/hypervisor?ip=10.60.1.120 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MediaType.TEXT_PLAIN + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReturnStringIf2xx.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetHypervisorTypesFromDatacenter() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getHypervisorTypes", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/hypervisors HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + HypervisorTypesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Managed Rack ***********************/
-
-   public void testListRacks() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listRacks", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/racks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RacksDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCreateRack() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "createRack", DatacenterDto.class, RackDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(), InfrastructureResources.rackPost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/datacenters/1/racks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RackDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.rackPostPayload()), RackDto.class,
-            RackDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetRack() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getRack", DatacenterDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/racks/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RackDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateRack() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "updateRack", RackDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.rackPut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/datacenters/1/racks/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RackDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.rackPutPayload()), RackDto.class,
-            RackDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteRack() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "deleteRack", RackDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.rackPut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/datacenters/1/racks/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Remote Service **********************/
-
-   public void testListRemoteServices() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listRemoteServices", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/remoteservices HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RemoteServicesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCreateRemoteService() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "createRemoteService", DatacenterDto.class,
-            RemoteServiceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(
-            method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(),
-                  InfrastructureResources.remoteServicePost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/datacenters/1/remoteservices HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RemoteServiceDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.remoteServicePostPayload()),
-            RemoteServiceDto.class, RemoteServiceDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetRemoteService() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getRemoteService", DatacenterDto.class,
-            RemoteServiceType.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            InfrastructureResources.datacenterPut(), RemoteServiceType.STORAGE_SYSTEM_MONITOR)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/remoteservices/storagesystemmonitor HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RemoteServiceDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateRemoteService() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "updateRemoteService", RemoteServiceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.remoteServicePut())));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/admin/datacenters/1/remoteservices/nodecollector HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RemoteServiceDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.remoteServicePutPayload()),
-            RemoteServiceDto.class, RemoteServiceDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteRemoteService() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "deleteRemoteService", RemoteServiceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.remoteServicePut())));
-
-      assertRequestLineEquals(request,
-            "DELETE http://localhost/api/admin/datacenters/1/remoteservices/nodecollector HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testIsAvailableRemoteService() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "isAvailable", RemoteServiceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.remoteServicePut())));
-
-      String checkUri = InfrastructureResources.remoteServicePut().searchLink("check").getHref();
-      assertRequestLineEquals(request, String.format("GET %s HTTP/1.1", checkUri));
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReturnTrueIf2xx.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, FalseIfNotAvailable.class);
-
-      checkFilters(request);
-   }
-
-   /*********************** Machine ***********************/
-
-   public void testDiscoverSingleMachineWithoutOptions() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "discoverSingleMachine", DatacenterDto.class,
-            String.class, HypervisorType.class, String.class, String.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            InfrastructureResources.datacenterPut(), "10.60.1.222", HypervisorType.XENSERVER, "user", "pass")));
-
-      String baseUrl = "http://localhost/api/admin/datacenters/1/action/discoversingle";
-      String query = "ip=10.60.1.222&hypervisor=XENSERVER&user=user&password=pass";
-      String expectedRequest = String.format("GET %s?%s HTTP/1.1", baseUrl, query);
-
-      assertRequestLineEquals(request, expectedRequest);
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, PropagateAbiquoExceptionOnNotFoundOr4xx.class);
-
-      checkFilters(request);
-   }
-
-   public void testDiscoverSingleMachineAllParams() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "discoverSingleMachine", DatacenterDto.class,
-            String.class, HypervisorType.class, String.class, String.class, MachineOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            InfrastructureResources.datacenterPut(), "80.80.80.80", HypervisorType.KVM, "user", "pass", MachineOptions
-                  .builder().port(8889).build())));
-
-      String baseUrl = "http://localhost/api/admin/datacenters/1/action/discoversingle";
-      String query = "ip=80.80.80.80&hypervisor=KVM&user=user&password=pass&port=8889";
-      String expectedRequest = String.format("GET %s?%s HTTP/1.1", baseUrl, query);
-
-      assertRequestLineEquals(request, expectedRequest);
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, PropagateAbiquoExceptionOnNotFoundOr4xx.class);
-
-      checkFilters(request);
-   }
-
-   public void testDiscoverSingleMachineDefaultValues() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "discoverSingleMachine", DatacenterDto.class,
-            String.class, HypervisorType.class, String.class, String.class, MachineOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            InfrastructureResources.datacenterPut(), "80.80.80.80", HypervisorType.KVM, "user", "pass", MachineOptions
-                  .builder().build())));
-
-      String baseUrl = "http://localhost/api/admin/datacenters/1/action/discoversingle";
-      String query = "ip=80.80.80.80&hypervisor=KVM&user=user&password=pass";
-      String expectedRequest = String.format("GET %s?%s HTTP/1.1", baseUrl, query);
-
-      assertRequestLineEquals(request, expectedRequest);
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, PropagateAbiquoExceptionOnNotFoundOr4xx.class);
-
-      checkFilters(request);
-   }
-
-   public void testDiscoverMultipleMachinesWithoutOptions() throws SecurityException, NoSuchMethodException,
-         IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "discoverMultipleMachines", DatacenterDto.class,
-            String.class, String.class, HypervisorType.class, String.class, String.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            InfrastructureResources.datacenterPut(), "10.60.1.222", "10.60.1.250", HypervisorType.XENSERVER, "user",
-            "pass")));
-
-      String baseUrl = "http://localhost/api/admin/datacenters/1/action/discovermultiple";
-      String query = "ipFrom=10.60.1.222&ipTo=10.60.1.250&hypervisor=XENSERVER&user=user&password=pass";
-      String expectedRequest = String.format("GET %s?%s HTTP/1.1", baseUrl, query);
-
-      assertRequestLineEquals(request, expectedRequest);
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachinesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, PropagateAbiquoExceptionOnNotFoundOr4xx.class);
-
-      checkFilters(request);
-   }
-
-   public void testDiscoverMultipleMachinesAllParams() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "discoverMultipleMachines", DatacenterDto.class,
-            String.class, String.class, HypervisorType.class, String.class, String.class, MachineOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            InfrastructureResources.datacenterPut(), "80.80.80.80", "80.80.80.86", HypervisorType.KVM, "user", "pass",
-            MachineOptions.builder().port(8889).build())));
-
-      String baseUrl = "http://localhost/api/admin/datacenters/1/action/discovermultiple";
-      String query = "ipFrom=80.80.80.80&ipTo=80.80.80.86&hypervisor=KVM&user=user&password=pass&port=8889";
-      String expectedRequest = String.format("GET %s?%s HTTP/1.1", baseUrl, query);
-
-      assertRequestLineEquals(request, expectedRequest);
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachinesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, PropagateAbiquoExceptionOnNotFoundOr4xx.class);
-
-      checkFilters(request);
-   }
-
-   public void testCheckMachineStateWithoutOptions() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "checkMachineState", DatacenterDto.class, String.class,
-            HypervisorType.class, String.class, String.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            InfrastructureResources.datacenterPut(), "10.60.1.222", HypervisorType.XENSERVER, "user", "pass")));
-
-      String baseUrl = "http://localhost/api/admin/datacenters/1/action/checkmachinestate";
-      String query = "ip=10.60.1.222&hypervisor=XENSERVER&user=user&password=pass";
-      String expectedRequest = String.format("GET %s?%s HTTP/1.1", baseUrl, query);
-
-      assertRequestLineEquals(request, expectedRequest);
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineStateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, PropagateAbiquoExceptionOnNotFoundOr4xx.class);
-
-      checkFilters(request);
-   }
-
-   public void testCheckMachineStateAllParams() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "checkMachineState", DatacenterDto.class, String.class,
-            HypervisorType.class, String.class, String.class, MachineOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            InfrastructureResources.datacenterPut(), "10.60.1.222", HypervisorType.XENSERVER, "user", "pass",
-            MachineOptions.builder().port(8889).build())));
-
-      String baseUrl = "http://localhost/api/admin/datacenters/1/action/checkmachinestate";
-      String query = "ip=10.60.1.222&hypervisor=XENSERVER&user=user&password=pass&port=8889";
-      String expectedRequest = String.format("GET %s?%s HTTP/1.1", baseUrl, query);
-
-      assertRequestLineEquals(request, expectedRequest);
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineStateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, PropagateAbiquoExceptionOnNotFoundOr4xx.class);
-
-      checkFilters(request);
-   }
-
-   public void testCheckMachineIpmiStateWithoutOptions() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "checkMachineIpmiState", DatacenterDto.class,
-            String.class, String.class, String.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(), "10.60.1.222", "user", "pass")));
-
-      String baseUrl = "http://localhost/api/admin/datacenters/1/action/checkmachineipmistate";
-      String query = "ip=10.60.1.222&user=user&password=pass";
-      String expectedRequest = String.format("GET %s?%s HTTP/1.1", baseUrl, query);
-
-      assertRequestLineEquals(request, expectedRequest);
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineIpmiStateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, PropagateAbiquoExceptionOnNotFoundOr4xx.class);
-
-      checkFilters(request);
-   }
-
-   public void testCheckMachineIpmiStateWithALLOptions() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "checkMachineIpmiState", DatacenterDto.class,
-            String.class, String.class, String.class, IpmiOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            InfrastructureResources.datacenterPut(), "10.60.1.222", "user", "pass", IpmiOptions.builder().port(8889)
-                  .build())));
-
-      String baseUrl = "http://localhost/api/admin/datacenters/1/action/checkmachineipmistate";
-      String query = "ip=10.60.1.222&user=user&password=pass&port=8889";
-      String expectedRequest = String.format("GET %s?%s HTTP/1.1", baseUrl, query);
-
-      assertRequestLineEquals(request, expectedRequest);
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineIpmiStateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, PropagateAbiquoExceptionOnNotFoundOr4xx.class);
-
-      checkFilters(request);
-   }
-
-   public void testListMachines() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listMachines", RackDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.rackPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/racks/1/machines HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachinesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getMachine", RackDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.rackPut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/racks/1/machines/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testCheckMachineState() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "checkMachineState", MachineDto.class, boolean.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.machinePut(), true)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/checkstate?sync=true HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineStateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCheckMachineIpmiState() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "checkMachineIpmiState", MachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.machinePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/checkipmistate HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineIpmiStateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCreateMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "createMachine", RackDto.class, MachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.rackPut(), InfrastructureResources.machinePost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/datacenters/1/racks/1/machines HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.machinePostPayload()), MachineDto.class,
-            MachineDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "updateMachine", MachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.machinePut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/datacenters/1/racks/1/machines/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.machinePutPayload()), MachineDto.class,
-            MachineDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteMachine() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "deleteMachine", MachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.machinePut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/datacenters/1/racks/1/machines/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testReserveMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "reserveMachine", EnterpriseDto.class, MachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut(), InfrastructureResources.machinePut())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/enterprises/1/reservedmachines HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachineDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.machinePutPayload()), MachineDto.class,
-            MachineDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCancelReservation() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "cancelReservation", EnterpriseDto.class,
-            MachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut(), InfrastructureResources.machinePut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/enterprises/1/reservedmachines/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListVirtualMachinesByMachine() throws SecurityException, NoSuchMethodException, IOException {
-      MachineOptions options = MachineOptions.builder().sync(true).build();
-
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listVirtualMachinesByMachine", MachineDto.class,
-            MachineOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.machinePut(), options)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/racks/1/machines/1/virtualmachines?sync=true HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualMachinesWithNodeExtendedDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetVirtualMachineByMachine() throws SecurityException, NoSuchMethodException, IOException {
-
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getVirtualMachine", MachineDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.machinePut(), 1)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/racks/1/machines/1/virtualmachines/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   /*********************** Storage Device ***********************/
-
-   public void testListStorageDevices() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listStorageDevices", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/storage/devices HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StorageDevicesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListSupportedStorageDevices() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listSupportedStorageDevices", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/storage/devices/action/supported HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StorageDevicesMetadataDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCreateStorageDevice() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "createStorageDevice", DatacenterDto.class,
-            StorageDeviceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(
-            method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(),
-                  InfrastructureResources.storageDevicePost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/datacenters/1/storage/devices HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StorageDeviceDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.storageDevicePostPayload()),
-            StorageDeviceDto.class, StorageDeviceDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteStorageDevice() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "deleteStorageDevice", StorageDeviceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.storageDevicePut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/datacenters/1/storage/devices/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateStorageDevice() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "updateStorageDevice", StorageDeviceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.storageDevicePut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/datacenters/1/storage/devices/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StorageDeviceDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.storageDevicePutPayload()),
-            StorageDeviceDto.class, StorageDeviceDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetStorageDevice() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getStorageDevice", DatacenterDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/storage/devices/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StorageDeviceDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   /*********************** Tier ***********************/
-
-   public void testListTiers() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listTiers", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/storage/tiers HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TiersDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateTier() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "updateTier", TierDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.tierPut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/datacenters/1/storage/tiers/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TierDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.tierPutPayload()), TierDto.class,
-            TierDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetTier() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getTier", DatacenterDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/storage/tiers/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TierDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   /*********************** StoragePool ***********************/
-
-   public void testListSyncStoragePools() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listStoragePools", StorageDeviceDto.class,
-            StoragePoolOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(
-            method,
-            ImmutableList.<Object> of(InfrastructureResources.storageDevicePut(),
-                  StoragePoolOptions.builder().sync(true).build())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/storage/devices/1/pools?sync=true HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StoragePoolsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListStoragePoolsFromTier() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listStoragePools", TierDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(
-            method,
-            ImmutableList.<Object> of(InfrastructureResources.tierPut(), StoragePoolOptions.builder().sync(true)
-                  .build())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/storage/tiers/1/pools HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StoragePoolsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListStoragePoolsNoParams() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listStoragePools", StorageDeviceDto.class,
-            StoragePoolOptions.class);
-      GeneratedHttpRequest request = processor
-            .apply(Invocation.create(method, ImmutableList.<Object> of(InfrastructureResources.storageDevicePut(),
-                  StoragePoolOptions.builder().build())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/storage/devices/1/pools HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StoragePoolsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCreateStoragePool() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "createStoragePool", StorageDeviceDto.class,
-            StoragePoolDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(
-            method,
-            ImmutableList.<Object> of(InfrastructureResources.storageDevicePut(),
-                  InfrastructureResources.storagePoolPost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/datacenters/1/storage/devices/1/pools HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StoragePoolDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.storagePoolPostPayload()), StoragePoolDto.class,
-            StoragePoolDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateStoragePool() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "updateStoragePool", StoragePoolDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.storagePoolPut())));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/admin/datacenters/1/storage/devices/1/pools/tururututu HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StoragePoolDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(InfrastructureResources.storagePoolPutPayload()), StoragePoolDto.class,
-            StoragePoolDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteStoragePool() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "deleteStoragePool", StoragePoolDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.storagePoolPut())));
-
-      assertRequestLineEquals(request,
-            "DELETE http://localhost/api/admin/datacenters/1/storage/devices/1/pools/tururututu HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetStoragePool() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getStoragePool", StorageDeviceDto.class, String.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            InfrastructureResources.storageDevicePut(), InfrastructureResources.storagePoolPut().getIdStorage())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/storage/devices/1/pools/tururututu HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StoragePoolDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testRefreshStoragePool() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "refreshStoragePool", StoragePoolDto.class,
-            StoragePoolOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(
-            method,
-            ImmutableList.<Object> of(InfrastructureResources.storagePoolPut(), StoragePoolOptions.builder().sync(true)
-                  .build())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/storage/devices/1/pools/tururututu?sync=true HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + StoragePoolDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
-      checkFilters(request);
-   }
-
-   /*********************** Network ***********************/
-
-   public void testListNetworks() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listNetworks", DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/network HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworksDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListNetworksWithOptions() throws SecurityException, NoSuchMethodException, IOException {
-      NetworkOptions options = NetworkOptions.builder().type(NetworkType.PUBLIC).build();
-
-      Invokable<?, ?> method = method(InfrastructureApi.class, "listNetworks", DatacenterDto.class,
-            NetworkOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(), options)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/network?type=PUBLIC HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworksDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetNetworks() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getNetwork", DatacenterDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/network/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworkDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testCreateNetwork() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "createNetwork", DatacenterDto.class,
-            VLANNetworkDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(), NetworkResources.vlanPost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/datacenters/1/network HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworkDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(NetworkResources.vlanNetworkPostPayload()), VLANNetworkDto.class,
-            VLANNetworkDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateNetwork() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "updateNetwork", VLANNetworkDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(NetworkResources.publicNetworkPut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/datacenters/1/network/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworkDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(NetworkResources.publicNetworkPutPayload()), VLANNetworkDto.class,
-            VLANNetworkDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteNetwork() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "deleteNetwork", VLANNetworkDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(NetworkResources.publicNetworkPut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/datacenters/1/network/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCheckTagAvailability() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "checkTagAvailability", DatacenterDto.class,
-            Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(InfrastructureResources.datacenterPut(), 2)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/datacenters/1/network/action/checkavailability?tag=2 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VlanTagAvailabilityDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
-      checkFilters(request);
-   }
-
-   /*********************** Network IPs ***********************/
-
-   public void testGetPublicIp() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getPublicIp", VLANNetworkDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(NetworkResources.publicNetworkPut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters/1/network/1/ips/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + PublicIpDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetExternalIp() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getExternalIp", VLANNetworkDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(NetworkResources.externalNetworkPut(), 1)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/limits/1/externalnetworks/1/ips/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + ExternalIpDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetUnmanagedIp() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(InfrastructureApi.class, "getUnmanagedIp", VLANNetworkDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(NetworkResources.externalNetworkPut(), 1)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/limits/1/externalnetworks/1/ips/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + UnmanagedIpDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/TaskApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/TaskApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/TaskApiTest.java
deleted file mode 100644
index df5dca3..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/TaskApiTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.jclouds.reflect.Reflection2.method;
-
-import java.io.IOException;
-
-import org.jclouds.abiquo.AbiquoFallbacks.NullOn303;
-import org.jclouds.abiquo.domain.CloudResources;
-import org.jclouds.abiquo.domain.TemplateResources;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.SingleResourceTransportDto;
-import com.abiquo.server.core.task.TaskDto;
-import com.abiquo.server.core.task.TasksDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Tests annotation parsing of {@code TaskApi}
- */
-@Test(groups = "unit", testName = "TaskApiTest")
-public class TaskApiTest extends BaseAbiquoApiTest<TaskApi> {
-   /*********************** Task ***********************/
-
-   public void testGetTaskVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(TaskApi.class, "getTask", RESTLink.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(new RESTLink("task",
-                  "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1"
-                        + "/tasks/169f1877-5f17-4f62-9563-974001295c54"))));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/"
-                  + "tasks/169f1877-5f17-4f62-9563-974001295c54 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TaskDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOn303.class);
-
-      checkFilters(request);
-   }
-
-   public void testListTasksVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(TaskApi.class, "listTasks", SingleResourceTransportDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/tasks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TasksDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetTaskVirtualMachineTemplate() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(TaskApi.class, "getTask", RESTLink.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(new RESTLink("task",
-                  "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1/"
-                        + "tasks/169f1877-5f17-4f62-9563-974001295c54"))));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1"
-                  + "/tasks/169f1877-5f17-4f62-9563-974001295c54 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TaskDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOn303.class);
-
-      checkFilters(request);
-   }
-
-   public void testListTasksVirtualMachineTemplate() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(TaskApi.class, "listTasks", SingleResourceTransportDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(TemplateResources.virtualMachineTemplatePut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1/datacenterrepositories/1/"
-            + "virtualmachinetemplates/1/tasks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TasksDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateApiExpectTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateApiExpectTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateApiExpectTest.java
deleted file mode 100644
index 3185504..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateApiExpectTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineTemplateOptions;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplatesDto;
-
-/**
- * Expect tests for the {@link VirtualMachineTemplateApi}.
- */
-@Test(groups = "unit", testName = "VirtualMachineTemplateApiExpectTest")
-public class VirtualMachineTemplateApiExpectTest extends BaseAbiquoApiExpectTest<VirtualMachineTemplateApi> {
-
-   public void testListVirtualMachineTemplatesWithPaginationOptions() {
-      VirtualMachineTemplateApi api = requestSendsResponse(
-            HttpRequest
-                  .builder()
-                  .method("GET")
-                  .endpoint(
-                        URI.create("http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachineTemplatesDto.MEDIA_TYPE)) //
-                  .addQueryParam("limit", "1") //
-                  .addQueryParam("has", "text") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/templates-page.xml",
-                              normalize(VirtualMachineTemplatesDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualMachineTemplateOptions options = VirtualMachineTemplateOptions.builder().limit(1).has("text").build();
-      PaginatedCollection<VirtualMachineTemplateDto, VirtualMachineTemplatesDto> result = api
-            .listVirtualMachineTemplates(1, 1, options);
-
-      assertEquals(result.size(), 1);
-      assertEquals(result.getTotalSize().intValue(), 2);
-      assertEquals(result.get(0).getId().intValue(), 151);
-      assertNotNull(result.searchLink("first"));
-      assertNotNull(result.searchLink("last"));
-      assertNotNull(result.searchLink("next"));
-   }
-
-   public void testListVirtualMachineTemplatesReturns2xx() {
-      VirtualMachineTemplateApi api = requestsSendResponses(
-            HttpRequest
-                  .builder()
-                  .method("GET")
-                  .endpoint(
-                        URI.create("http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachineTemplatesDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/templates-page.xml",
-                              normalize(VirtualMachineTemplatesDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest
-                  .builder()
-                  .method("GET")
-                  .endpoint(
-                        URI.create("http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachineTemplatesDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/templates-lastpage.xml",
-                              normalize(VirtualMachineTemplatesDto.MEDIA_TYPE))) //
-                  .build());
-
-      PagedIterable<VirtualMachineTemplateDto> result = api.listVirtualMachineTemplates(1, 1);
-      List<VirtualMachineTemplateDto> all = result.concat().toList();
-
-      assertEquals(all.size(), 2);
-      assertEquals(all.get(0).getId().intValue(), 151);
-      assertEquals(all.get(1).getId().intValue(), 152);
-   }
-
-   @Override
-   protected VirtualMachineTemplateApi clientFrom(AbiquoApi api) {
-      return api.getVirtualMachineTemplateApi();
-   }
-
-}


[11/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindVolumeRefsToPayloadTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindVolumeRefsToPayloadTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindVolumeRefsToPayloadTest.java
deleted file mode 100644
index 47d1841..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindVolumeRefsToPayloadTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.abiquo.util.Assert.assertPayloadEquals;
-
-import java.io.IOException;
-import java.net.URI;
-
-import org.jclouds.abiquo.domain.CloudResources;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.xml.internal.JAXBParser;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-
-/**
- * Unit tests for the {@link BindVolumeRefsToPayload} binder.
- */
-@Test(groups = "unit", testName = "BindVolumeRefsToPayloadTest")
-public class BindVolumeRefsToPayloadTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      BindVolumeRefsToPayload binder = new BindVolumeRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidTypeInput() {
-      BindVolumeRefsToPayload binder = new BindVolumeRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, new Object());
-   }
-
-   public void testBindEmptyArray() throws IOException {
-      BindVolumeRefsToPayload binder = new BindVolumeRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, new VolumeManagementDto[] {});
-      assertPayloadEquals(request.getPayload(), withHeader("<links/>"), LinksDto.class);
-   }
-
-   public void testBindSingleVolume() throws IOException {
-      VolumeManagementDto volume = CloudResources.volumePut();
-      BindVolumeRefsToPayload binder = new BindVolumeRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, new VolumeManagementDto[] { volume });
-      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + volume.getEditLink().getHref()
-            + "\" rel=\"" + binder.getRelToUse(volume) + "\"/></links>"), LinksDto.class);
-   }
-
-   public void testBindMultipleVolumes() throws IOException {
-      VolumeManagementDto volume = CloudResources.volumePut();
-      BindVolumeRefsToPayload binder = new BindVolumeRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, new VolumeManagementDto[] { volume, volume });
-      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + volume.getEditLink().getHref()
-            + "\" rel=\"" + binder.getRelToUse(volume) + "\"/></links>"), LinksDto.class);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/AppendMachineIdToPathTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/AppendMachineIdToPathTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/AppendMachineIdToPathTest.java
deleted file mode 100644
index 8b3e4bd..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/AppendMachineIdToPathTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.infrastructure;
-
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-
-import org.jclouds.abiquo.functions.infrastructure.ParseMachineId;
-import org.jclouds.http.HttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.infrastructure.MachineDto;
-
-/**
- * Unit tests for the {@link AppendMachineIdToPath} binder.
- */
-@Test(groups = "unit", testName = "AppendMachineIdToPathTest")
-public class AppendMachineIdToPathTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testGetValueWithNullInput() {
-      AppendMachineIdToPath binder = new AppendMachineIdToPath(new ParseMachineId());
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.getValue(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testGetValueWithInvalidInput() {
-      AppendMachineIdToPath binder = new AppendMachineIdToPath(new ParseMachineId());
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.getValue(request, new Object());
-   }
-
-   public void testGetValue() {
-      AppendMachineIdToPath binder = new AppendMachineIdToPath(new ParseMachineId());
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-
-      MachineDto machine = new MachineDto();
-      machine.setId(5);
-      assertEquals(binder.getValue(request, machine), "5");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/AppendRemoteServiceTypeToPathTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/AppendRemoteServiceTypeToPathTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/AppendRemoteServiceTypeToPathTest.java
deleted file mode 100644
index f79a431..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/AppendRemoteServiceTypeToPathTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.infrastructure;
-
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-
-import org.jclouds.abiquo.functions.infrastructure.ParseRemoteServiceType;
-import org.jclouds.http.HttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.RemoteServiceType;
-
-/**
- * Unit tests for the {@link AppendRemoteServiceTypeToPath} binder.
- */
-@Test(groups = "unit", testName = "AppendRemoteServiceTypeToPathTest")
-public class AppendRemoteServiceTypeToPathTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testGetValueWithNullInput() {
-      AppendRemoteServiceTypeToPath binder = new AppendRemoteServiceTypeToPath(new ParseRemoteServiceType());
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.getValue(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testGetValueWithInvalidInput() {
-      AppendRemoteServiceTypeToPath binder = new AppendRemoteServiceTypeToPath(new ParseRemoteServiceType());
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.getValue(request, new Object());
-   }
-
-   public void testGetValue() {
-      AppendRemoteServiceTypeToPath binder = new AppendRemoteServiceTypeToPath(new ParseRemoteServiceType());
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-
-      assertEquals(binder.getValue(request, RemoteServiceType.VIRTUAL_SYSTEM_MONITOR), "virtualsystemmonitor");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPathTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPathTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPathTest.java
deleted file mode 100644
index 41c2386..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPathTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.infrastructure;
-
-import static org.jclouds.reflect.Reflection2.method;
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-
-import javax.ws.rs.HttpMethod;
-
-import org.jclouds.abiquo.features.InfrastructureApi;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Unit tests for the {@link BindSupportedDevicesLinkToPath} class.
- */
-@Test(groups = "unit", testName = "BindSupportedDevicesLinkToPathTest")
-public class BindSupportedDevicesLinkToPathTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testGetNewEnpointNullInput() {
-      BindSupportedDevicesLinkToPath binder = new BindSupportedDevicesLinkToPath();
-      binder.getNewEndpoint(null, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testGetNewEnpointInvalidInput() {
-      BindSupportedDevicesLinkToPath binder = new BindSupportedDevicesLinkToPath();
-      binder.getNewEndpoint(null, new Object());
-   }
-
-   public void testGetNewEnpoint() throws Exception {
-      DatacenterDto datacenter = new DatacenterDto();
-      datacenter.addLink(new RESTLink("devices", "http://foo/bar"));
-
-      BindSupportedDevicesLinkToPath binder = new BindSupportedDevicesLinkToPath();
-
-      Invokable<?, ?> withEndpointLink = method(InfrastructureApi.class, "listSupportedStorageDevices",
-            DatacenterDto.class);
-
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(withEndpointLink, ImmutableList.<Object> of(datacenter)))
-            .method(HttpMethod.GET).endpoint(URI.create("http://foo/bar")).build();
-
-      assertEquals(binder.getNewEndpoint(request, datacenter), "http://foo/bar/action/supported");
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testGetNewEnpointWithoutLink() throws Exception {
-      DatacenterDto datacenter = new DatacenterDto();
-
-      BindSupportedDevicesLinkToPath binder = new BindSupportedDevicesLinkToPath();
-
-      Invokable<?, ?> withEndpointLink = method(InfrastructureApi.class, "listSupportedStorageDevices",
-            DatacenterDto.class);
-
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(withEndpointLink, ImmutableList.<Object> of(datacenter)))
-            .method(HttpMethod.GET).endpoint(URI.create("http://foo/bar")).build();
-
-      assertEquals(binder.getNewEndpoint(request, datacenter), "http://foo/bar/action/supported");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/compute/AbiquoComputeServiceLiveTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/compute/AbiquoComputeServiceLiveTest.java b/abiquo/src/test/java/org/jclouds/abiquo/compute/AbiquoComputeServiceLiveTest.java
deleted file mode 100644
index f4d0252..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/compute/AbiquoComputeServiceLiveTest.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute;
-
-import static org.jclouds.compute.util.ComputeServiceUtils.getCores;
-import static org.testng.Assert.assertEquals;
-
-import java.util.Properties;
-
-import org.jclouds.Constants;
-import org.jclouds.compute.domain.ComputeType;
-import org.jclouds.compute.domain.ExecResponse;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.internal.BaseComputeServiceLiveTest;
-import org.jclouds.logging.config.LoggingModule;
-import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
-import org.jclouds.sshj.config.SshjSshClientModule;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-/**
- * Live tests for the Abiquo ComputeService.
- */
-@Test(groups = "live", testName = "AbiquoComputeServiceLiveTest", singleThreaded = true)
-// Since the base class has test configuration, even if we disable tests here,
-// or comment them out, the ones in the base class will be executed.
-// This class is still a work in progress and will fail until the race condition
-// (when creating the virtual appliance) in the AbiquoComputeServiceAdapter is
-// fixed and a proper test environment is configured.
-public abstract class AbiquoComputeServiceLiveTest extends BaseComputeServiceLiveTest {
-   public AbiquoComputeServiceLiveTest() {
-      provider = "abiquo";
-   }
-
-   @Override
-   protected Properties setupProperties() {
-      Properties overrides = super.setupProperties();
-      overrides.put(Constants.PROPERTY_MAX_RETRIES, "0");
-      return overrides;
-   }
-
-   @Override
-   protected LoggingModule getLoggingModule() {
-      return new SLF4JLoggingModule();
-   }
-
-   @Override
-   protected Module getSshModule() {
-      return new SshjSshClientModule();
-   }
-
-   @Override
-   public void testListSizes() throws Exception {
-      for (Hardware hardware : client.listHardwareProfiles()) {
-         assert hardware.getProviderId() != null : hardware;
-         assert getCores(hardware) > 0 : hardware;
-         assert hardware.getVolumes().size() >= 0 : hardware;
-         // There are some small images in Abiquo that have less than 1GB of RAM
-         // assert hardware.getRam() > 0 : hardware;
-         assertEquals(hardware.getType(), ComputeType.HARDWARE);
-      }
-   }
-
-   // Abiquo does not set the hostname
-   @Override
-   protected void checkResponseEqualsHostname(final ExecResponse execResponse, final NodeMetadata node) {
-      assert node.getHostname() == null : node + " with hostname: " + node.getHostname();
-   }
-
-   // Abiquo does not support metadata
-   @Override
-   protected void checkUserMetadataContains(final NodeMetadata node, final ImmutableMap<String, String> userMetadata) {
-      assert node.getUserMetadata().equals(ImmutableMap.<String, String> of()) : String.format(
-            "node userMetadata did not match %s %s", userMetadata, node);
-   }
-
-   // Abiquo does not support tags
-   @Override
-   protected void checkTagsInNodeEquals(final NodeMetadata node, final ImmutableSet<String> tags) {
-      assert node.getTags().equals(ImmutableSet.<String> of()) : String.format("node tags did not match %s %s", tags,
-            node);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/DatacenterToLocationTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/DatacenterToLocationTest.java b/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/DatacenterToLocationTest.java
deleted file mode 100644
index 105cc7d..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/DatacenterToLocationTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LocationScope;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link DatacenterToLocation} function.
- */
-@Test(groups = "unit", testName = "DatacenterToLocationTest")
-public class DatacenterToLocationTest {
-   @SuppressWarnings("unchecked")
-   public void testDatacenterToLocation() {
-      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
-      DatacenterToLocation function = new DatacenterToLocation();
-
-      Datacenter datacenter = Datacenter.builder(context).name("dc").location("New York").build();
-      datacenter.unwrap().setId(5);
-      Location location = function.apply(datacenter);
-
-      assertEquals(location.getId(), "5");
-      assertEquals(location.getScope(), LocationScope.REGION);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualDatacenterToLocationTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualDatacenterToLocationTest.java b/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualDatacenterToLocationTest.java
deleted file mode 100644
index 5b7beb1..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualDatacenterToLocationTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.testng.Assert.assertEquals;
-
-import java.util.Collections;
-import java.util.Map;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.network.PrivateNetwork;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LocationScope;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-
-/**
- * Unit tests for the {@link VirtualDatacenterToLocation} function.
- */
-@Test(groups = "unit", testName = "VirtualDatacenterToLocationTest")
-public class VirtualDatacenterToLocationTest {
-   public void testVirtualDatacenterToLocation() {
-      Function<Datacenter, Location> dcToLocation = mockDatacenterToLocation();
-      Supplier<Map<Integer, Datacenter>> regionMap = mockRegionMap();
-      VirtualDatacenterToLocation function = new VirtualDatacenterToLocation(dcToLocation, regionMap);
-
-      VirtualDatacenter vdc = mockVirtualDatacenter();
-
-      Location location = function.apply(vdc);
-
-      verify(regionMap);
-      verify(dcToLocation);
-
-      assertEquals(location.getId(), "5");
-      assertEquals(location.getScope(), LocationScope.ZONE);
-   }
-
-   @SuppressWarnings("unchecked")
-   private static VirtualDatacenter mockVirtualDatacenter() {
-      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
-      Datacenter datacenter = EasyMock.createMock(Datacenter.class);
-      Enterprise enterprise = EasyMock.createMock(Enterprise.class);
-      PrivateNetwork network = EasyMock.createMock(PrivateNetwork.class);
-
-      VirtualDatacenter vdc = VirtualDatacenter.builder(context, datacenter, enterprise) //
-            .network(network) //
-            .name("mock").build();
-      vdc.unwrap().setId(5);
-
-      return vdc;
-   }
-
-   @SuppressWarnings("unchecked")
-   private static Function<Datacenter, Location> mockDatacenterToLocation() {
-      Function<Datacenter, Location> mock = EasyMock.createMock(Function.class);
-      expect(mock.apply(anyObject(Datacenter.class))).andReturn(null);
-      replay(mock);
-      return mock;
-   }
-
-   @SuppressWarnings("unchecked")
-   private static Supplier<Map<Integer, Datacenter>> mockRegionMap() {
-      Supplier<Map<Integer, Datacenter>> mock = EasyMock.createMock(Supplier.class);
-      expect(mock.get()).andReturn(Collections.EMPTY_MAP);
-      replay(mock);
-      return mock;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineStateToNodeStateTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineStateToNodeStateTest.java b/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineStateToNodeStateTest.java
deleted file mode 100644
index 0cbcb62..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineStateToNodeStateTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.compute.domain.NodeMetadata.Status;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-
-/**
- * Unit tests for the {@link VirtualMachineStateToNodeState} function.
- */
-@Test(groups = "unit", testName = "VirtualMachineStateToNodeStateTest")
-public class VirtualMachineStateToNodeStateTest {
-   public void testVirtualMachineStateToNodeState() {
-      VirtualMachineStateToNodeState function = new VirtualMachineStateToNodeState();
-
-      assertEquals(function.apply(VirtualMachineState.ALLOCATED), Status.PENDING);
-      assertEquals(function.apply(VirtualMachineState.LOCKED), Status.PENDING);
-      assertEquals(function.apply(VirtualMachineState.CONFIGURED), Status.PENDING);
-      assertEquals(function.apply(VirtualMachineState.ON), Status.RUNNING);
-      assertEquals(function.apply(VirtualMachineState.OFF), Status.SUSPENDED);
-      assertEquals(function.apply(VirtualMachineState.PAUSED), Status.SUSPENDED);
-      assertEquals(function.apply(VirtualMachineState.NOT_ALLOCATED), Status.PENDING);
-      assertEquals(function.apply(VirtualMachineState.UNKNOWN), Status.UNRECOGNIZED);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateInVirtualDatacenterToHardwareTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateInVirtualDatacenterToHardwareTest.java b/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateInVirtualDatacenterToHardwareTest.java
deleted file mode 100644
index 8a7bd4a..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateInVirtualDatacenterToHardwareTest.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-
-import java.net.URI;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplateInVirtualDatacenter;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Volume;
-import org.jclouds.domain.Location;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the
- * {@link VirtualMachineTemplateInVirtualDatacenterToHardware} function.
- */
-@Test(groups = "unit", testName = "VirtualMachineTemplateInVirtualDatacenterToHardwareTest")
-public class VirtualMachineTemplateInVirtualDatacenterToHardwareTest {
-   @SuppressWarnings("unchecked")
-   public void testVirtualMachineTemplateToHardware() {
-      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
-      Function<VirtualDatacenter, Location> vdcToLocation = mockVirtualDatacenterToLocation();
-      VirtualMachineTemplateInVirtualDatacenterToHardware function = new VirtualMachineTemplateInVirtualDatacenterToHardware(
-            vdcToLocation);
-
-      VirtualMachineTemplateDto dto = new VirtualMachineTemplateDto();
-      dto.setId(5);
-      dto.setName("Template");
-      dto.setDescription("Template description");
-      dto.setHdRequired(50L * 1024 * 1024 * 1024); // 50 GB
-      dto.setCpuRequired(5);
-      dto.setRamRequired(2048);
-      dto.addLink(new RESTLink("edit", "http://foo/bar"));
-      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);
-
-      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
-      vdcDto.setId(6);
-      vdcDto.setHypervisorType(HypervisorType.VMX_04);
-      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);
-
-      Hardware hardware = function.apply(new VirtualMachineTemplateInVirtualDatacenter(template, vdc));
-
-      verify(vdcToLocation);
-
-      assertEquals(hardware.getProviderId(), template.getId().toString());
-      assertEquals(hardware.getId(), template.getId() + "/" + vdc.getId());
-      assertEquals(hardware.getName(), template.getName());
-      assertEquals(hardware.getUri(), URI.create("http://foo/bar"));
-
-      assertEquals(hardware.getRam(), template.getRamRequired().intValue());
-      assertEquals(hardware.getProcessors().size(), 1);
-      assertEquals(hardware.getProcessors().get(0).getCores(), (double) template.getCpuRequired());
-      assertEquals(hardware.getProcessors().get(0).getSpeed(),
-            VirtualMachineTemplateInVirtualDatacenterToHardware.DEFAULT_CORE_SPEED);
-
-      assertEquals(hardware.getVolumes().size(), 1);
-      assertEquals(hardware.getVolumes().get(0).getSize(), 50F);
-      assertEquals(hardware.getVolumes().get(0).getType(), Volume.Type.LOCAL);
-      assertEquals(hardware.getVolumes().get(0).isBootDevice(), true);
-      assertEquals(hardware.getVolumes().get(0).isDurable(), false);
-   }
-
-   @SuppressWarnings("unchecked")
-   public void testConvertWithoutEditLink() {
-      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
-      Function<VirtualDatacenter, Location> vdcToLocation = mockVirtualDatacenterToLocation();
-      VirtualMachineTemplateInVirtualDatacenterToHardware function = new VirtualMachineTemplateInVirtualDatacenterToHardware(
-            vdcToLocation);
-
-      VirtualMachineTemplateDto dto = new VirtualMachineTemplateDto();
-      dto.setId(5);
-      dto.setName("Template");
-      dto.setDescription("Template description");
-      dto.setHdRequired(50L * 1024 * 1024 * 1024); // 50 GB
-      dto.setCpuRequired(5);
-      dto.setRamRequired(2048);
-      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, dto);
-
-      VirtualDatacenterDto vdcDto = new VirtualDatacenterDto();
-      vdcDto.setId(6);
-      vdcDto.setHypervisorType(HypervisorType.VMX_04);
-      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, vdcDto);
-
-      Hardware hardware = function.apply(new VirtualMachineTemplateInVirtualDatacenter(template, vdc));
-
-      verify(vdcToLocation);
-
-      assertNull(hardware.getUri());
-   }
-
-   @SuppressWarnings("unchecked")
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testConvertWithoutId() {
-      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
-      Function<VirtualDatacenter, Location> vdcToLocation = mockVirtualDatacenterToLocation();
-      VirtualMachineTemplateInVirtualDatacenterToHardware function = new VirtualMachineTemplateInVirtualDatacenterToHardware(
-            vdcToLocation);
-
-      VirtualMachineTemplate template = wrap(context, VirtualMachineTemplate.class, new VirtualMachineTemplateDto());
-      VirtualDatacenter vdc = wrap(context, VirtualDatacenter.class, new VirtualDatacenterDto());
-
-      function.apply(new VirtualMachineTemplateInVirtualDatacenter(template, vdc));
-   }
-
-   @SuppressWarnings("unchecked")
-   private static Function<VirtualDatacenter, Location> mockVirtualDatacenterToLocation() {
-      Function<VirtualDatacenter, Location> mock = EasyMock.createMock(Function.class);
-      expect(mock.apply(anyObject(VirtualDatacenter.class))).andReturn(null);
-      replay(mock);
-      return mock;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateToImageTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateToImageTest.java b/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateToImageTest.java
deleted file mode 100644
index a684039..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateToImageTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-
-import java.net.URI;
-import java.util.Collections;
-import java.util.Map;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.OperatingSystem;
-import org.jclouds.domain.Location;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-
-/**
- * Unit tests for the {@link VirtualMachineTemplateToImage} class.
- */
-@Test(groups = "unit", testName = "VirtualMachineTemplateToImageTest")
-public class VirtualMachineTemplateToImageTest {
-   @SuppressWarnings("unchecked")
-   public void testVirtualMachineTemplateToImage() {
-      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
-      Function<Datacenter, Location> dcToLocation = mockDatacenterToLocation();
-      Supplier<Map<Integer, Datacenter>> regionMap = mockRegionMap();
-      VirtualMachineTemplateToImage function = new VirtualMachineTemplateToImage(dcToLocation, regionMap);
-
-      VirtualMachineTemplateDto dto = new VirtualMachineTemplateDto();
-      dto.setId(5);
-      dto.setName("Template");
-      dto.setDescription("Template description");
-      dto.addLink(new RESTLink("diskfile", "http://foo/bar"));
-      dto.addLink(new RESTLink("datacenter", "http://foo/bar/4"));
-
-      Image image = function.apply(wrap(context, VirtualMachineTemplate.class, dto));
-
-      verify(regionMap);
-      verify(dcToLocation);
-
-      assertEquals(image.getId(), dto.getId().toString());
-      assertEquals(image.getName(), dto.getName());
-      assertEquals(image.getDescription(), dto.getDescription());
-      assertEquals(image.getUri(), URI.create("http://foo/bar"));
-      assertEquals(image.getOperatingSystem(), OperatingSystem.builder().description(dto.getName()).build());
-   }
-
-   @SuppressWarnings("unchecked")
-   public void testConvertWithoutDownloadLink() {
-      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
-      Function<Datacenter, Location> dcToLocation = mockDatacenterToLocation();
-      Supplier<Map<Integer, Datacenter>> regionMap = mockRegionMap();
-      VirtualMachineTemplateToImage function = new VirtualMachineTemplateToImage(dcToLocation, regionMap);
-
-      VirtualMachineTemplateDto dto = new VirtualMachineTemplateDto();
-      dto.setId(5);
-      dto.setName("Template");
-      dto.setDescription("Template description");
-      dto.addLink(new RESTLink("datacenter", "http://foo/bar/4"));
-
-      Image image = function.apply(wrap(context, VirtualMachineTemplate.class, dto));
-
-      verify(regionMap);
-      verify(dcToLocation);
-
-      assertNull(image.getUri());
-   }
-
-   @SuppressWarnings("unchecked")
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testConvertWithoutId() {
-      ApiContext<AbiquoApi> context = EasyMock.createMock(ApiContext.class);
-      Function<Datacenter, Location> dcToLocation = mockDatacenterToLocation();
-      Supplier<Map<Integer, Datacenter>> regionMap = mockRegionMap();
-      VirtualMachineTemplateToImage function = new VirtualMachineTemplateToImage(dcToLocation, regionMap);
-
-      VirtualMachineTemplateDto dto = new VirtualMachineTemplateDto();
-      function.apply(wrap(context, VirtualMachineTemplate.class, dto));
-   }
-
-   @SuppressWarnings("unchecked")
-   private static Function<Datacenter, Location> mockDatacenterToLocation() {
-      Function<Datacenter, Location> mock = EasyMock.createMock(Function.class);
-      expect(mock.apply(anyObject(Datacenter.class))).andReturn(null);
-      replay(mock);
-      return mock;
-   }
-
-   @SuppressWarnings("unchecked")
-   private static Supplier<Map<Integer, Datacenter>> mockRegionMap() {
-      Supplier<Map<Integer, Datacenter>> mock = EasyMock.createMock(Supplier.class);
-      expect(mock.get()).andReturn(Collections.EMPTY_MAP);
-      replay(mock);
-      return mock;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineToNodeMetadataTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineToNodeMetadataTest.java b/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineToNodeMetadataTest.java
deleted file mode 100644
index 392cd25..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/compute/functions/VirtualMachineToNodeMetadataTest.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplateInVirtualDatacenter;
-import org.jclouds.abiquo.domain.network.ExternalIp;
-import org.jclouds.abiquo.domain.network.Ip;
-import org.jclouds.abiquo.domain.network.PrivateIp;
-import org.jclouds.abiquo.domain.network.PublicIp;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.HardwareBuilder;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.NodeMetadata.Status;
-import org.jclouds.domain.Location;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.infrastructure.network.ExternalIpDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-
-/**
- * Unit tests for the {@link VirtualMachineToNodeMetadata} class.
- */
-@Test(groups = "unit", testName = "VirtualMachineToNodeMetadataTest")
-public class VirtualMachineToNodeMetadataTest {
-   private VirtualMachineToNodeMetadata function;
-
-   private VirtualMachineWithNodeExtendedDto vm;
-
-   private PrivateIpDto privNic;
-
-   private PublicIpDto pubNic;
-
-   private ExternalIpDto extNic;
-
-   private Hardware hardware;
-
-   @BeforeMethod
-   public void setup() {
-      vm = new VirtualMachineWithNodeExtendedDto();
-      vm.setNodeName("VM");
-      vm.setName("Internal name");
-      vm.setId(5);
-      vm.setVdrpPort(22);
-      vm.setRam(2048);
-      vm.setCpu(2);
-      vm.setState(VirtualMachineState.ON);
-      vm.addLink(new RESTLink("edit", "http://foo/bar"));
-
-      privNic = new PrivateIpDto();
-      privNic.setIp("192.168.1.2");
-      privNic.setMac("2a:6e:40:69:84:e0");
-
-      pubNic = new PublicIpDto();
-      pubNic.setIp("80.80.80.80");
-      pubNic.setMac("2a:6e:40:69:84:e1");
-
-      extNic = new ExternalIpDto();
-      extNic.setIp("10.10.10.10");
-      extNic.setMac("2a:6e:40:69:84:e2");
-
-      hardware = new HardwareBuilder() //
-            .ids("1") //
-            .build();
-
-      function = new VirtualMachineToNodeMetadata(templateToImage(), templateToHardware(), stateToNodeState(),
-            virtualDatacenterToLocation());
-   }
-
-   public void testVirtualMachineToNodeMetadata() {
-      VirtualAppliance vapp = EasyMock.createMock(VirtualAppliance.class);
-      VirtualMachine mockVm = mockVirtualMachine(vapp);
-
-      NodeMetadata node = function.apply(mockVm);
-
-      verify(mockVm);
-
-      assertEquals(node.getId(), vm.getId().toString());
-      assertEquals(node.getUri(), URI.create("http://foo/bar"));
-      assertEquals(node.getName(), vm.getNodeName());
-      assertEquals(node.getGroup(), "VAPP");
-      assertEquals(node.getLocation().getId(), "1");
-      assertEquals(node.getLocation().getDescription(), "Mock Location");
-      assertEquals(node.getImageId(), "1");
-      assertEquals(node.getHardware().getId(), "1");
-      assertEquals(node.getHardware().getRam(), vm.getRam().intValue());
-      assertEquals(node.getHardware().getProcessors().get(0).getCores(), (double) vm.getCpu());
-      assertEquals(node.getLoginPort(), vm.getVdrpPort());
-      assertEquals(node.getPrivateAddresses().size(), 1);
-      assertEquals(node.getPublicAddresses().size(), 2);
-      assertEquals(Iterables.get(node.getPrivateAddresses(), 0), privNic.getIp());
-      assertEquals(Iterables.get(node.getPublicAddresses(), 0), pubNic.getIp());
-      assertEquals(Iterables.get(node.getPublicAddresses(), 1), extNic.getIp());
-   }
-
-   private VirtualMachineTemplateToImage templateToImage() {
-      VirtualMachineTemplateToImage templateToImage = EasyMock.createMock(VirtualMachineTemplateToImage.class);
-      Image image = EasyMock.createMock(Image.class);
-
-      expect(image.getId()).andReturn("1");
-      expect(image.getOperatingSystem()).andReturn(null);
-      expect(templateToImage.apply(anyObject(VirtualMachineTemplate.class))).andReturn(image);
-
-      replay(image);
-      replay(templateToImage);
-
-      return templateToImage;
-   }
-
-   private VirtualMachineTemplateInVirtualDatacenterToHardware templateToHardware() {
-      VirtualMachineTemplateInVirtualDatacenterToHardware virtualMachineTemplateToHardware = EasyMock
-            .createMock(VirtualMachineTemplateInVirtualDatacenterToHardware.class);
-
-      expect(virtualMachineTemplateToHardware.apply(anyObject(VirtualMachineTemplateInVirtualDatacenter.class)))
-            .andReturn(hardware);
-
-      replay(virtualMachineTemplateToHardware);
-
-      return virtualMachineTemplateToHardware;
-   }
-
-   private VirtualDatacenterToLocation virtualDatacenterToLocation() {
-      VirtualDatacenterToLocation datacenterToLocation = EasyMock.createMock(VirtualDatacenterToLocation.class);
-      Location location = EasyMock.createMock(Location.class);
-
-      expect(location.getId()).andReturn("1");
-      expect(location.getDescription()).andReturn("Mock Location");
-
-      expect(datacenterToLocation.apply(anyObject(VirtualDatacenter.class))).andReturn(location);
-
-      replay(location);
-      replay(datacenterToLocation);
-
-      return datacenterToLocation;
-   }
-
-   private VirtualMachineStateToNodeState stateToNodeState() {
-      VirtualMachineStateToNodeState stateToNodeState = EasyMock.createMock(VirtualMachineStateToNodeState.class);
-      expect(stateToNodeState.apply(anyObject(VirtualMachineState.class))).andReturn(Status.RUNNING);
-      replay(stateToNodeState);
-      return stateToNodeState;
-   }
-
-   private VirtualDatacenter mockVirtualDatacenter() {
-      VirtualDatacenter vdc = EasyMock.createMock(VirtualDatacenter.class);
-      expect(vdc.getHypervisorType()).andReturn(HypervisorType.VMX_04);
-      expect(vdc.getDatacenter()).andReturn(null);
-      replay(vdc);
-      return vdc;
-   }
-
-   private VirtualMachineTemplate mockTemplate() {
-      return EasyMock.createMock(VirtualMachineTemplate.class);
-   }
-
-   @SuppressWarnings("unchecked")
-   private VirtualMachine mockVirtualMachine(final VirtualAppliance vapp) {
-      VirtualMachine mockVm = EasyMock.createMock(VirtualMachine.class);
-
-      Ip<?, ?> mockPrivNic = wrap(EasyMock.createMock(ApiContext.class), PrivateIp.class, privNic);
-      Ip<?, ?> mockPubNic = wrap(EasyMock.createMock(ApiContext.class), PublicIp.class, pubNic);
-      Ip<?, ?> mockExtNic = wrap(EasyMock.createMock(ApiContext.class), ExternalIp.class, extNic);
-
-      expect(mockVm.getId()).andReturn(vm.getId());
-      expect(mockVm.getURI()).andReturn(URI.create(vm.getEditLink().getHref()));
-      expect(mockVm.getNameLabel()).andReturn(vm.getNodeName());
-      expect(mockVm.getTemplate()).andReturn(mockTemplate());
-      expect(mockVm.getState()).andReturn(vm.getState());
-      expect(mockVm.listAttachedNics()).andReturn(ImmutableList.<Ip<?, ?>> of(mockPubNic, mockPrivNic, mockExtNic));
-      expect(mockVm.getVirtualAppliance()).andReturn(vapp);
-      expect(vapp.getName()).andReturn("VAPP");
-      expect(mockVm.getVirtualDatacenter()).andReturn(mockVirtualDatacenter());
-      expect(mockVm.getRam()).andReturn(vm.getRam());
-      expect(mockVm.getCpu()).andReturn(vm.getCpu());
-
-      replay(mockVm);
-      replay(vapp);
-
-      return mockVm;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/compute/options/AbiquoTemplateOptionsTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/compute/options/AbiquoTemplateOptionsTest.java b/abiquo/src/test/java/org/jclouds/abiquo/compute/options/AbiquoTemplateOptionsTest.java
deleted file mode 100644
index 38d2a2a..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/compute/options/AbiquoTemplateOptionsTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.options;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.compute.options.TemplateOptions;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link AbiquoTemplateOptions} class.
- */
-@Test(groups = "unit", testName = "AbiquoTemplateOptionsTest")
-public class AbiquoTemplateOptionsTest {
-   public void testAs() {
-      TemplateOptions options = new AbiquoTemplateOptions();
-      assertEquals(options.as(AbiquoTemplateOptions.class), options);
-   }
-
-   public void testOverrideCores() {
-      TemplateOptions options = new AbiquoTemplateOptions().overrideCores(5);
-      assertEquals(options.as(AbiquoTemplateOptions.class).getOverrideCores(), Integer.valueOf(5));
-   }
-
-   public void testOverrideRam() {
-      TemplateOptions options = new AbiquoTemplateOptions().overrideRam(2048);
-      assertEquals(options.as(AbiquoTemplateOptions.class).getOverrideRam(), Integer.valueOf(2048));
-   }
-
-   public void testVncPassword() {
-      TemplateOptions options = new AbiquoTemplateOptions().vncPassword("foo");
-      assertEquals(options.as(AbiquoTemplateOptions.class).getVncPassword(), "foo");
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/config/SchedulerModuleTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/config/SchedulerModuleTest.java b/abiquo/src/test/java/org/jclouds/abiquo/config/SchedulerModuleTest.java
deleted file mode 100644
index d9147b8..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/config/SchedulerModuleTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.config;
-
-import static org.testng.Assert.assertNotNull;
-
-import java.util.concurrent.ScheduledExecutorService;
-
-import org.jclouds.Constants;
-import org.jclouds.abiquo.internal.BaseInjectionTest;
-import org.testng.annotations.Test;
-
-import com.google.inject.Key;
-import com.google.inject.name.Names;
-
-/**
- * Unit tests for the {@link SchedulerModule} class.
- */
-@Test(groups = "unit", testName = "SchedulerModuleTest")
-public class SchedulerModuleTest extends BaseInjectionTest {
-   public void testScheduledExecutorIsProvided() {
-      assertNotNull(injector.getInstance(Key.get(ScheduledExecutorService.class,
-            Names.named(Constants.PROPERTY_SCHEDULER_THREADS))));
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/AbiquoVersionLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/AbiquoVersionLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/AbiquoVersionLiveApiTest.java
deleted file mode 100644
index 25f76be..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/AbiquoVersionLiveApiTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.fail;
-
-import java.util.Properties;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.internal.BaseAbiquoLiveApiTest;
-import org.testng.annotations.Test;
-
-/**
- * Live integration tests for the Abiquo versioning support.
- */
-@Test(groups = "api", testName = "AbiquoVersionLiveApiTest")
-public class AbiquoVersionLiveApiTest extends BaseAbiquoLiveApiTest {
-   @Override
-   protected Properties setupProperties() {
-      Properties overrides = super.setupProperties();
-      overrides.setProperty("abiquo.api-version", "0.0");
-      return overrides;
-   }
-
-   public void testUnsupportedVersion() {
-      try {
-         view.getAdministrationService().getCurrentUser();
-         fail("Unsupported versions in mime types should not be allowed");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.NOT_ACCEPTABLE, "406-NOT-ACCEPTABLE");
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/AdminResources.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/AdminResources.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/AdminResources.java
deleted file mode 100644
index 3766cbd..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/AdminResources.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import static org.jclouds.abiquo.domain.DomainUtils.link;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.enterprise.DatacenterLimitsDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.enterprise.RoleDto;
-import com.abiquo.server.core.enterprise.UserDto;
-
-/**
- * Enterprise domain utilities.
- */
-public class AdminResources {
-   public static RoleDto rolePost() {
-      RoleDto role = new RoleDto();
-      role.addLink(new RESTLink("privileges", "http://localhost/api/admin/roles/1/action/privileges"));
-      role.setName("HAWAIAN_ADMIN");
-      return role;
-   }
-
-   public static RoleDto rolePut() {
-      RoleDto role = rolePost();
-      role.setId(1);
-      role.addLink(new RESTLink("edit", "http://localhost/api/admin/roles/1"));
-
-      return role;
-   }
-
-   public static String rolePostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<role>");
-      buffer.append(link("/admin/roles/1/action/privileges", "privileges"));
-      buffer.append("<blocked>false</blocked>");
-      buffer.append("<name>HAWAIAN_ADMIN</name>");
-      buffer.append("</role>");
-      return buffer.toString();
-   }
-
-   public static String rolePutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<role>");
-      buffer.append(link("/admin/roles/1/action/privileges", "privileges"));
-      buffer.append(link("/admin/roles/1", "edit"));
-      buffer.append("<blocked>false</blocked>");
-      buffer.append("<id>1</id>");
-      buffer.append("<name>HAWAIAN_ADMIN</name>");
-      buffer.append("</role>");
-      return buffer.toString();
-   }
-
-   public static DatacenterLimitsDto datacenterLimitsPost() {
-      DatacenterLimitsDto limits = new DatacenterLimitsDto();
-      limits.setCpuCountLimits(0, 0);
-      limits.setHdLimitsInMb(0, 0);
-      limits.setPublicIPLimits(0, 0);
-      limits.setRamLimitsInMb(0, 0);
-      limits.setStorageLimits(0, 0);
-      limits.setVlansLimits(0, 0);
-      limits.setRepositoryHardLimitsInMb(0);
-      limits.setRepositorySoftLimitsInMb(0);
-      return limits;
-   }
-
-   public static DatacenterLimitsDto datacenterLimitsPut(final EnterpriseDto enterprise) {
-      DatacenterLimitsDto limits = datacenterLimitsPost();
-      limits.setId(1);
-      limits.addLink(new RESTLink("edit", "http://localhost/api/admin/enterprises/" + enterprise.getId() + "/limits/1"));
-      return limits;
-   }
-
-   public static String datacenterLimitsPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<limit>");
-      buffer.append("<cpuHard>0</cpuHard>");
-      buffer.append("<cpuSoft>0</cpuSoft>");
-      buffer.append("<hdHard>0</hdHard>");
-      buffer.append("<hdSoft>0</hdSoft>");
-      buffer.append("<publicIpsHard>0</publicIpsHard>");
-      buffer.append("<publicIpsSoft>0</publicIpsSoft>");
-      buffer.append("<ramHard>0</ramHard>");
-      buffer.append("<ramSoft>0</ramSoft>");
-      buffer.append("<storageHard>0</storageHard>");
-      buffer.append("<storageSoft>0</storageSoft>");
-      buffer.append("<vlansHard>0</vlansHard>");
-      buffer.append("<vlansSoft>0</vlansSoft>");
-      buffer.append("<repositoryHard>0</repositoryHard>");
-      buffer.append("<repositorySoft>0</repositorySoft>");
-      buffer.append("</limit>");
-      return buffer.toString();
-   }
-
-   public static String datacenterLimitsPutPayload(final EnterpriseDto enterprise) {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<limit>");
-      buffer.append(link("/admin/enterprises/" + enterprise.getId() + "/limits/1", "edit"));
-      buffer.append("<cpuHard>0</cpuHard>");
-      buffer.append("<cpuSoft>0</cpuSoft>");
-      buffer.append("<hdHard>0</hdHard>");
-      buffer.append("<hdSoft>0</hdSoft>");
-      buffer.append("<publicIpsHard>0</publicIpsHard>");
-      buffer.append("<publicIpsSoft>0</publicIpsSoft>");
-      buffer.append("<ramHard>0</ramHard>");
-      buffer.append("<ramSoft>0</ramSoft>");
-      buffer.append("<storageHard>0</storageHard>");
-      buffer.append("<storageSoft>0</storageSoft>");
-      buffer.append("<vlansHard>0</vlansHard>");
-      buffer.append("<vlansSoft>0</vlansSoft>");
-      buffer.append("<id>1</id>");
-      buffer.append("<repositoryHard>0</repositoryHard>");
-      buffer.append("<repositorySoft>0</repositorySoft>");
-      buffer.append("</limit>");
-      return buffer.toString();
-   }
-
-   public static String userPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<user>");
-      buffer.append(link("/admin/roles/1", "role"));
-      buffer.append("<active>true</active>");
-      buffer.append("<authType>ABIQUO</authType>");
-      buffer.append("<description>A hawaian user</description>");
-      buffer.append("<email>abe.joha@aloha.com</email>");
-      buffer.append("<locale>en_US</locale>");
-      buffer.append("<name>Aberahama</name>");
-      buffer.append("<nick>abejo</nick>");
-      buffer.append("<password>c69a39bd64ffb77ea7ee3369dce742f3</password>");
-      buffer.append("<surname>Johanson</surname>");
-      buffer.append("</user>");
-      return buffer.toString();
-   }
-
-   public static UserDto userPost() {
-      UserDto user = new UserDto();
-      user.setName("Aberahama");
-      user.setSurname("Johanson");
-      user.setDescription("A hawaian user");
-      user.setEmail("abe.joha@aloha.com");
-      user.setNick("abejo");
-      user.setAuthType("ABIQUO");
-      user.setLocale("en_US");
-      user.setActive(true);
-      user.setPassword("c69a39bd64ffb77ea7ee3369dce742f3");
-      user.addLink(new RESTLink("role", "http://localhost/api/admin/roles/1"));
-      return user;
-   }
-
-   public static String userPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<user>");
-      buffer.append(link("/admin/roles/1", "role"));
-      buffer.append(link("/admin/enterprises/1/users/1", "edit"));
-      buffer.append(link("/admin/enterprises/1", "enterprise"));
-      buffer.append(link("/admin/enterprises/1/users/1/action/virtualmachines", "virtualmachines"));
-      buffer.append("<active>true</active>");
-      buffer.append("<authType>ABIQUO</authType>");
-      buffer.append("<description>A hawaian user</description>");
-      buffer.append("<email>abe.joha@aloha.com</email>");
-      buffer.append("<id>1</id>");
-      buffer.append("<locale>en_US</locale>");
-      buffer.append("<name>Aberahama</name>");
-      buffer.append("<nick>abejo</nick>");
-      buffer.append("<password>c69a39bd64ffb77ea7ee3369dce742f3</password>");
-      buffer.append("<surname>Johanson</surname>");
-      buffer.append("</user>");
-      return buffer.toString();
-   }
-
-   public static UserDto userPut() {
-      UserDto user = userPost();
-      user.setId(1);
-      user.addLink(new RESTLink("edit", "http://localhost/api/admin/enterprises/1/users/1"));
-      user.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
-      user.addLink(new RESTLink("virtualmachines",
-            "http://localhost/api/admin/enterprises/1/users/1/action/virtualmachines"));
-      return user;
-   }
-}


[03/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateApiTest.java
deleted file mode 100644
index 85b771e..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/VirtualMachineTemplateApiTest.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.reflect.Reflection2.method;
-
-import java.io.IOException;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.domain.TemplateResources;
-import org.jclouds.abiquo.domain.cloud.options.ConversionOptions;
-import org.jclouds.abiquo.functions.ReturnTaskReferenceOrNull;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.http.functions.ReleasePayloadAndReturn;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.ConversionState;
-import com.abiquo.model.enumerator.DiskFormatType;
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.abiquo.server.core.appslibrary.ConversionDto;
-import com.abiquo.server.core.appslibrary.ConversionsDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplatePersistentDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Tests annotation parsing of {@code VirtualMachineTemplateApi}
- */
-@Test(groups = "unit", testName = "VirtualMachineTemplateApiTest")
-public class VirtualMachineTemplateApiTest extends BaseAbiquoApiTest<VirtualMachineTemplateApi> {
-   /*********************** Virtual Machine Template ***********************/
-
-   public void testGetVirtualMachineTemplate() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(VirtualMachineTemplateApi.class, "getVirtualMachineTemplate", Integer.class,
-            Integer.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(1, 1, 1)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualMachineTemplateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateVirtualMachineTemplate() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(VirtualMachineTemplateApi.class, "updateVirtualMachineTemplate",
-            VirtualMachineTemplateDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(TemplateResources.virtualMachineTemplatePut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/enterprises/1/datacenterrepositories/1/"
-            + "virtualmachinetemplates/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualMachineTemplateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(TemplateResources.virtualMachineTemplatePutPayload()),
-            VirtualMachineTemplateDto.class, VirtualMachineTemplateDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteVirtualMachineTemplate() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(VirtualMachineTemplateApi.class, "deleteVirtualMachineTemplate",
-            VirtualMachineTemplateDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(TemplateResources.virtualMachineTemplatePut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/enterprises/1/datacenterrepositories/1/"
-            + "virtualmachinetemplates/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCreatePersistentVirtualMachineTemplate() throws SecurityException, NoSuchMethodException,
-         IOException {
-      Invokable<?, ?> method = method(VirtualMachineTemplateApi.class, "createPersistentVirtualMachineTemplate",
-            Integer.class, Integer.class, VirtualMachineTemplatePersistentDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(1, 1, TemplateResources.persistentData())));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(TemplateResources.persistentPayload()),
-            VirtualMachineTemplatePersistentDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Conversions ***********************/
-
-   public void testRequestConversion() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(VirtualMachineTemplateApi.class, "requestConversion",
-            VirtualMachineTemplateDto.class, DiskFormatType.class, ConversionDto.class);
-
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            TemplateResources.virtualMachineTemplatePut(), DiskFormatType.VMDK_STREAM_OPTIMIZED,
-            TemplateResources.conversionPut())));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/"
-                  + "1/conversions/VMDK_STREAM_OPTIMIZED HTTP/1.1");
-
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(TemplateResources.conversionPutPlayload()),
-            ConversionDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ReturnTaskReferenceOrNull.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListConversions() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(VirtualMachineTemplateApi.class, "listConversions",
-            VirtualMachineTemplateDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(TemplateResources.virtualMachineTemplatePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/"
-                  + "1/conversions HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + ConversionsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListConversionsWithOptions() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(VirtualMachineTemplateApi.class, "listConversions",
-            VirtualMachineTemplateDto.class, ConversionOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(
-            method,
-            ImmutableList.<Object> of(TemplateResources.virtualMachineTemplatePut(), ConversionOptions.builder()
-                  .hypervisorType(HypervisorType.XENSERVER).conversionState(ConversionState.FINISHED).build())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/"
-                  + "1/conversions" + "?hypervisor=XENSERVER&state=FINISHED HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + ConversionsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetConversion() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(VirtualMachineTemplateApi.class, "getConversion",
-            VirtualMachineTemplateDto.class, DiskFormatType.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(TemplateResources.virtualMachineTemplatePut(), DiskFormatType.RAW)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1/datacenterrepositories/1/"
-            + "virtualmachinetemplates/1/conversions/RAW HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + ConversionDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/functions/ReturnTaskReferenceOrNullTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/functions/ReturnTaskReferenceOrNullTest.java b/abiquo/src/test/java/org/jclouds/abiquo/functions/ReturnTaskReferenceOrNullTest.java
deleted file mode 100644
index c2f07c8..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/functions/ReturnTaskReferenceOrNullTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import java.io.IOException;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.easymock.EasyMock;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.io.Payload;
-import org.jclouds.io.Payloads;
-import org.jclouds.xml.internal.JAXBParser;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.google.common.base.Function;
-import com.google.common.io.ByteSource;
-import com.google.inject.TypeLiteral;
-
-/**
- * Unit tests for the {@link ReturnTaskReferenceOrNull} function.
- */
-@Test(groups = "unit", testName = "ReturnTaskReferenceOrNullTest")
-public class ReturnTaskReferenceOrNullTest {
-   public void testReturnNullIfNoContent() {
-      Function<HttpResponse, AcceptedRequestDto<String>> function = new ReturnTaskReferenceOrNull(new JAXBParser(
-            "false"), createTypeLiteral());
-
-      HttpResponse response = EasyMock.createMock(HttpResponse.class);
-
-      expect(response.getStatusCode()).andReturn(Status.NO_CONTENT.getStatusCode());
-      expect(response.getPayload()).andReturn(null);
-
-      replay(response);
-
-      assertNull(function.apply(response));
-
-      verify(response);
-   }
-
-   public void testReturnTaskIfAccepted() throws IOException {
-      JAXBParser parser = new JAXBParser("false");
-      AcceptedRequestDto<?> task = new AcceptedRequestDto<String>();
-      Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(parser.toXML(task).getBytes()));
-
-      Function<HttpResponse, AcceptedRequestDto<String>> function = new ReturnTaskReferenceOrNull(parser,
-            createTypeLiteral());
-
-      HttpResponse response = EasyMock.createMock(HttpResponse.class);
-
-      expect(response.getStatusCode()).andReturn(Status.ACCEPTED.getStatusCode());
-      // Get payload is called three times: one to deserialize it, and twice to
-      // release it
-      expect(response.getPayload()).andReturn(payload);
-      expect(response.getPayload()).andReturn(payload);
-      expect(response.getPayload()).andReturn(payload);
-
-      replay(response);
-
-      assertTrue(function.apply(response) instanceof AcceptedRequestDto);
-
-      verify(response);
-   }
-
-   private static TypeLiteral<AcceptedRequestDto<String>> createTypeLiteral() {
-      return new TypeLiteral<AcceptedRequestDto<String>>() {
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/functions/auth/GetTokenFromApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/functions/auth/GetTokenFromApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/functions/auth/GetTokenFromApiTest.java
index d365db1..25c68ba 100644
--- a/abiquo/src/test/java/org/jclouds/abiquo/functions/auth/GetTokenFromApiTest.java
+++ b/abiquo/src/test/java/org/jclouds/abiquo/functions/auth/GetTokenFromApiTest.java
@@ -24,7 +24,7 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 
-import javax.ws.rs.core.Cookie;
+import java.net.HttpCookie;
 
 import org.easymock.EasyMock;
 import org.jclouds.http.HttpResponse;
@@ -45,7 +45,7 @@ public class GetTokenFromApiTest {
       expect(response.getHeaders()).andReturn(ImmutableMultimap.<String, String> of());
       replay(response);
 
-      Optional<Cookie> token = readAuthenticationToken(response);
+      Optional<HttpCookie> token = readAuthenticationToken(response);
       assertFalse(token.isPresent());
 
       verify(response);
@@ -56,30 +56,30 @@ public class GetTokenFromApiTest {
       expect(response.getHeaders()).andReturn(ImmutableMultimap.<String, String> of("Accept", "application/xml"));
       replay(response);
 
-      Optional<Cookie> token = readAuthenticationToken(response);
+      Optional<HttpCookie> token = readAuthenticationToken(response);
       assertFalse(token.isPresent());
 
       verify(response);
    }
 
-   public void testGetTokenWithOtherCookie() {
+   public void testGetTokenWithOtherHttpCookie() {
       HttpResponse response = EasyMock.createMock(HttpResponse.class);
       expect(response.getHeaders()).andReturn(ImmutableMultimap.<String, String> of(HttpHeaders.SET_COOKIE, "foo=bar"));
       replay(response);
 
-      Optional<Cookie> token = readAuthenticationToken(response);
+      Optional<HttpCookie> token = readAuthenticationToken(response);
       assertFalse(token.isPresent());
 
       verify(response);
    }
 
-   public void testGetTokenWithAuthenticationCookie() {
+   public void testGetTokenWithAuthenticationHttpCookie() {
       HttpResponse response = EasyMock.createMock(HttpResponse.class);
       expect(response.getHeaders()).andReturn(
             ImmutableMultimap.<String, String> of(HttpHeaders.SET_COOKIE, "auth=the-token"));
       replay(response);
 
-      Optional<Cookie> token = readAuthenticationToken(response);
+      Optional<HttpCookie> token = readAuthenticationToken(response);
       assertTrue(token.isPresent());
       assertEquals(token.get().getName(), "auth");
       assertEquals(token.get().getValue(), "the-token");

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/functions/enterprise/ParseEnterpriseIdTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/functions/enterprise/ParseEnterpriseIdTest.java b/abiquo/src/test/java/org/jclouds/abiquo/functions/enterprise/ParseEnterpriseIdTest.java
deleted file mode 100644
index ab73725..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/functions/enterprise/ParseEnterpriseIdTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.enterprise;
-
-import static org.testng.Assert.assertEquals;
-
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link ParseEnterpriseId} function.
- */
-@Test(groups = "unit", testName = "ParseEnterpriseIdTest")
-public class ParseEnterpriseIdTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      Function<Object, String> parser = new ParseEnterpriseId();
-      parser.apply(null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidInputType() {
-      Function<Object, String> parser = new ParseEnterpriseId();
-      parser.apply(new Object());
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidId() {
-      Function<Object, String> parser = new ParseEnterpriseId();
-      parser.apply(new EnterpriseDto());
-   }
-
-   public void testValidId() {
-      Function<Object, String> parser = new ParseEnterpriseId();
-
-      EnterpriseDto enterprise = new EnterpriseDto();
-      enterprise.setId(5);
-      assertEquals(parser.apply(enterprise), "5");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseDatacenterIdTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseDatacenterIdTest.java b/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseDatacenterIdTest.java
deleted file mode 100644
index 4419418..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseDatacenterIdTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.infrastructure;
-
-import static org.testng.Assert.assertEquals;
-
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link ParseDatacenterId} function.
- */
-@Test(groups = "unit", testName = "ParseDatacenterIdTest")
-public class ParseDatacenterIdTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      Function<Object, String> parser = new ParseDatacenterId();
-      parser.apply(null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidInputType() {
-      Function<Object, String> parser = new ParseDatacenterId();
-      parser.apply(new Object());
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidId() {
-      Function<Object, String> parser = new ParseDatacenterId();
-      parser.apply(new DatacenterDto());
-   }
-
-   public void testValidId() {
-      Function<Object, String> parser = new ParseDatacenterId();
-
-      DatacenterDto datacenter = new DatacenterDto();
-      datacenter.setId(5);
-      assertEquals(parser.apply(datacenter), "5");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseMachineIdTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseMachineIdTest.java b/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseMachineIdTest.java
deleted file mode 100644
index f26d3e4..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseMachineIdTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.infrastructure;
-
-import static org.testng.Assert.assertEquals;
-
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.infrastructure.MachineDto;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link ParseMachineId} function.
- */
-@Test(groups = "unit", testName = "ParseMachineIdTest")
-public class ParseMachineIdTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      Function<Object, String> parser = new ParseMachineId();
-      parser.apply(null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidInputType() {
-      Function<Object, String> parser = new ParseMachineId();
-      parser.apply(new Object());
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidId() {
-      Function<Object, String> parser = new ParseMachineId();
-      parser.apply(new MachineDto());
-   }
-
-   public void testValidId() {
-      Function<Object, String> parser = new ParseMachineId();
-
-      MachineDto machine = new MachineDto();
-      machine.setId(5);
-      assertEquals(parser.apply(machine), "5");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseRemoteServiceTypeTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseRemoteServiceTypeTest.java b/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseRemoteServiceTypeTest.java
deleted file mode 100644
index 409be7c..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/functions/infrastructure/ParseRemoteServiceTypeTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions.infrastructure;
-
-import static org.testng.Assert.assertEquals;
-
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.RemoteServiceType;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link ParseRemoteServiceType} functions.
- */
-@Test(groups = "unit", testName = "ParseRemoteServiceTypeTest")
-public class ParseRemoteServiceTypeTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      Function<Object, String> parser = new ParseRemoteServiceType();
-      parser.apply(null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidInputType() {
-      Function<Object, String> parser = new ParseRemoteServiceType();
-      parser.apply(new Object());
-   }
-
-   public void testValidId() {
-      Function<Object, String> parser = new ParseRemoteServiceType();
-      assertEquals(parser.apply(RemoteServiceType.BPM_SERVICE), "bpmservice");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/http/filters/AppendApiVersionToMediaTypeTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/http/filters/AppendApiVersionToMediaTypeTest.java b/abiquo/src/test/java/org/jclouds/abiquo/http/filters/AppendApiVersionToMediaTypeTest.java
index 52402d5..3dbbaf3 100644
--- a/abiquo/src/test/java/org/jclouds/abiquo/http/filters/AppendApiVersionToMediaTypeTest.java
+++ b/abiquo/src/test/java/org/jclouds/abiquo/http/filters/AppendApiVersionToMediaTypeTest.java
@@ -23,17 +23,21 @@ import static org.testng.Assert.assertTrue;
 import java.net.URI;
 import java.util.Collection;
 
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.functions.AppendApiVersionToAbiquoMimeType;
+import org.jclouds.abiquo.AbiquoApiMetadata;
 import org.jclouds.http.HttpRequest;
 import org.jclouds.io.Payload;
 import org.jclouds.io.Payloads;
+import org.jclouds.rest.annotations.ApiVersion;
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 import com.google.common.collect.LinkedHashMultimap;
 import com.google.common.collect.Multimap;
 import com.google.common.io.ByteSource;
 import com.google.common.net.HttpHeaders;
+import com.google.inject.AbstractModule;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
 
 /**
  * Unit tests for the {@link AppendApiVersionToMediaType} filter.
@@ -41,12 +45,25 @@ import com.google.common.net.HttpHeaders;
 @Test(groups = "unit", testName = "AppendApiVersionToMediaTypeTest")
 public class AppendApiVersionToMediaTypeTest {
 
+   private AppendApiVersionToMediaType filter;
+
+   private AbiquoApiMetadata metadata;
+
+   @BeforeMethod
+   public void setup() {
+      metadata = new AbiquoApiMetadata();
+      Injector injector = Guice.createInjector(new AbstractModule() {
+         @Override
+         protected void configure() {
+            bind(String.class).annotatedWith(ApiVersion.class).toInstance(metadata.getVersion());
+         }
+      });
+      filter = injector.getInstance(AppendApiVersionToMediaType.class);
+   }
+
    public void testAppendVersionToNonPayloadHeadersWithoutHeaders() {
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.appendVersionToNonPayloadHeaders(request);
 
       assertTrue(filtered.getHeaders().get(HttpHeaders.ACCEPT).isEmpty());
@@ -54,61 +71,50 @@ public class AppendApiVersionToMediaTypeTest {
 
    public void testAppendVersionToNonPayloadHeadersWithStandardMediaType() {
       Multimap<String, String> headers = LinkedHashMultimap.<String, String> create();
-      headers.put(HttpHeaders.ACCEPT, "application/xml");
+      headers.put(HttpHeaders.ACCEPT, "application/json");
 
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).headers(headers)
             .build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.appendVersionToNonPayloadHeaders(request);
 
       Collection<String> contentType = filtered.getHeaders().get(HttpHeaders.ACCEPT);
       assertEquals(contentType.size(), 1);
-      assertEquals(contentType.iterator().next(), "application/xml");
+      assertEquals(contentType.iterator().next(), "application/json");
    }
 
    public void testAppendVersionToNonPayloadHeadersWithVersionInMediaType() {
       Multimap<String, String> headers = LinkedHashMultimap.<String, String> create();
-      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.racks+xml;version=2.1-SNAPSHOT");
+      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.virtualmachine+json;version=2.1-SNAPSHOT");
 
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).headers(headers)
             .build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.appendVersionToNonPayloadHeaders(request);
 
       Collection<String> contentType = filtered.getHeaders().get(HttpHeaders.ACCEPT);
       assertEquals(contentType.size(), 1);
-      assertEquals(contentType.iterator().next(), "application/vnd.abiquo.racks+xml;version=2.1-SNAPSHOT");
+      assertEquals(contentType.iterator().next(), "application/vnd.abiquo.virtualmachine+json;version=2.1-SNAPSHOT");
    }
 
    public void testAppendVersionToNonPayloadHeadersWithoutVersionInMediaType() {
       Multimap<String, String> headers = LinkedHashMultimap.<String, String> create();
-      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.racks+xml");
+      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.virtualmachine+json");
 
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).headers(headers)
             .build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.appendVersionToNonPayloadHeaders(request);
 
       Collection<String> accept = filtered.getHeaders().get(HttpHeaders.ACCEPT);
       assertEquals(accept.size(), 1);
-      assertEquals(accept.iterator().next(), "application/vnd.abiquo.racks+xml;version=" + AbiquoApi.API_VERSION);
+      assertEquals(accept.iterator().next(),
+            "application/vnd.abiquo.virtualmachine+json;version=" + metadata.getVersion());
    }
 
    public void testAppendVersionToPayloadHeadersWithoutPayload() {
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.appendVersionToPayloadHeaders(request);
 
       assertNull(filtered.getPayload());
@@ -116,17 +122,14 @@ public class AppendApiVersionToMediaTypeTest {
 
    public void testAppendVersionToPayloadHeadersWithStandardPayload() {
       Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(new byte[0]));
-      payload.getContentMetadata().setContentType("application/xml");
+      payload.getContentMetadata().setContentType("application/json");
 
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).payload(payload)
             .build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.appendVersionToPayloadHeaders(request);
 
-      assertEquals(filtered.getPayload().getContentMetadata().getContentType(), "application/xml");
+      assertEquals(filtered.getPayload().getContentMetadata().getContentType(), "application/json");
    }
 
    public void testAppendVersionToPayloadHeadersWithDefaultPayload() {
@@ -135,9 +138,6 @@ public class AppendApiVersionToMediaTypeTest {
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).payload(payload)
             .build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.appendVersionToPayloadHeaders(request);
 
       assertEquals(filtered.getPayload().getContentMetadata().getContentType(), "application/unknown");
@@ -145,125 +145,109 @@ public class AppendApiVersionToMediaTypeTest {
 
    public void testAppendVersionToPayloadHeadersWithVersionInPayload() {
       Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(new byte[0]));
-      payload.getContentMetadata().setContentType("application/vnd.abiquo.racks+xml;version=1.8.5");
+      payload.getContentMetadata().setContentType("application/vnd.abiquo.virtualmachine+json;version=1.8.5");
 
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).payload(payload)
             .build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.appendVersionToPayloadHeaders(request);
 
       assertEquals(filtered.getPayload().getContentMetadata().getContentType(),
-            "application/vnd.abiquo.racks+xml;version=1.8.5");
+            "application/vnd.abiquo.virtualmachine+json;version=1.8.5");
    }
 
    public void testAppendVersionToPayloadHeadersWithoutVersionInPayload() {
       Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(new byte[0]));
-      payload.getContentMetadata().setContentType("application/vnd.abiquo.racks+xml");
+      payload.getContentMetadata().setContentType("application/vnd.abiquo.virtualmachine+json");
 
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).payload(payload)
             .build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.appendVersionToPayloadHeaders(request);
 
       assertEquals(filtered.getPayload().getContentMetadata().getContentType(),
-            "application/vnd.abiquo.racks+xml;version=" + AbiquoApi.API_VERSION);
+            "application/vnd.abiquo.virtualmachine+json;version=" + metadata.getVersion());
    }
 
    public void testFilterWithAcceptAndContentTypeWithVersion() {
       Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(new byte[0]));
-      payload.getContentMetadata().setContentType("application/vnd.abiquo.racks+xml;version=2.1-SNAPSHOT");
+      payload.getContentMetadata().setContentType("application/vnd.abiquo.virtualmachine+json;version=2.1-SNAPSHOT");
 
       Multimap<String, String> headers = LinkedHashMultimap.<String, String> create();
-      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.racks+xml;version=2.1-SNAPSHOT");
+      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.virtualmachine+json;version=2.1-SNAPSHOT");
 
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).headers(headers)
             .payload(payload).build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.filter(request);
 
       Collection<String> accept = filtered.getHeaders().get(HttpHeaders.ACCEPT);
       assertEquals(accept.size(), 1);
-      assertEquals(accept.iterator().next(), "application/vnd.abiquo.racks+xml;version=2.1-SNAPSHOT");
+      assertEquals(accept.iterator().next(), "application/vnd.abiquo.virtualmachine+json;version=2.1-SNAPSHOT");
 
       assertEquals(filtered.getPayload().getContentMetadata().getContentType(),
-            "application/vnd.abiquo.racks+xml;version=2.1-SNAPSHOT");
+            "application/vnd.abiquo.virtualmachine+json;version=2.1-SNAPSHOT");
    }
 
    public void testFilterWithAcceptAndContentTypeWithoutVersion() {
       Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(new byte[0]));
-      payload.getContentMetadata().setContentType("application/vnd.abiquo.racks+xml");
+      payload.getContentMetadata().setContentType("application/vnd.abiquo.virtualmachine+json");
 
       Multimap<String, String> headers = LinkedHashMultimap.<String, String> create();
-      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.racks+xml");
+      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.virtualmachine+json");
 
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).headers(headers)
             .payload(payload).build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.filter(request);
 
       Collection<String> accept = filtered.getHeaders().get(HttpHeaders.ACCEPT);
       assertEquals(accept.size(), 1);
-      assertEquals(accept.iterator().next(), "application/vnd.abiquo.racks+xml;version=" + AbiquoApi.API_VERSION);
+      assertEquals(accept.iterator().next(),
+            "application/vnd.abiquo.virtualmachine+json;version=" + metadata.getVersion());
 
       assertEquals(filtered.getPayload().getContentMetadata().getContentType(),
-            "application/vnd.abiquo.racks+xml;version=" + AbiquoApi.API_VERSION);
+            "application/vnd.abiquo.virtualmachine+json;version=" + metadata.getVersion());
    }
 
    public void testFilterWithversionInAccept() {
       Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(new byte[0]));
-      payload.getContentMetadata().setContentType("application/vnd.abiquo.racks+xml");
+      payload.getContentMetadata().setContentType("application/vnd.abiquo.virtualmachine+json");
 
       Multimap<String, String> headers = LinkedHashMultimap.<String, String> create();
-      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.racks+xml;version=1.8.5");
+      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.virtualmachine+json;version=1.8.5");
 
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).headers(headers)
             .payload(payload).build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.filter(request);
 
       Collection<String> accept = filtered.getHeaders().get(HttpHeaders.ACCEPT);
       assertEquals(accept.size(), 1);
-      assertEquals(accept.iterator().next(), "application/vnd.abiquo.racks+xml;version=1.8.5");
+      assertEquals(accept.iterator().next(), "application/vnd.abiquo.virtualmachine+json;version=1.8.5");
 
       assertEquals(filtered.getPayload().getContentMetadata().getContentType(),
-            "application/vnd.abiquo.racks+xml;version=" + AbiquoApi.API_VERSION);
+            "application/vnd.abiquo.virtualmachine+json;version=" + metadata.getVersion());
    }
 
    public void testFilterWithversionInContentType() {
       Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(new byte[0]));
-      payload.getContentMetadata().setContentType("application/vnd.abiquo.racks+xml;version=1.8.5");
+      payload.getContentMetadata().setContentType("application/vnd.abiquo.virtualmachine+json;version=1.8.5");
 
       Multimap<String, String> headers = LinkedHashMultimap.<String, String> create();
-      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.racks+xml");
+      headers.put(HttpHeaders.ACCEPT, "application/vnd.abiquo.virtualmachine+json");
 
       HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://foo")).headers(headers)
             .payload(payload).build();
 
-      AppendApiVersionToMediaType filter = new AppendApiVersionToMediaType(new AppendApiVersionToAbiquoMimeType(
-            AbiquoApi.API_VERSION));
-
       HttpRequest filtered = filter.filter(request);
 
       Collection<String> accept = filtered.getHeaders().get(HttpHeaders.ACCEPT);
       assertEquals(accept.size(), 1);
-      assertEquals(accept.iterator().next(), "application/vnd.abiquo.racks+xml;version=" + AbiquoApi.API_VERSION);
+      assertEquals(accept.iterator().next(),
+            "application/vnd.abiquo.virtualmachine+json;version=" + metadata.getVersion());
 
       assertEquals(filtered.getPayload().getContentMetadata().getContentType(),
-            "application/vnd.abiquo.racks+xml;version=1.8.5");
+            "application/vnd.abiquo.virtualmachine+json;version=1.8.5");
    }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/internal/AsyncMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/internal/AsyncMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/internal/AsyncMonitorTest.java
deleted file mode 100644
index ace6707..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/internal/AsyncMonitorTest.java
+++ /dev/null
@@ -1,533 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static org.easymock.EasyMock.anyLong;
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.internal.BaseMonitoringService.AsyncMonitor;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.abiquo.monitor.events.MonitorEvent;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-import com.google.common.eventbus.EventBus;
-import com.google.common.eventbus.Subscribe;
-
-/**
- * Unit tests for the {@link AsyncMonitor} class.
- */
-@Test(groups = "unit", testName = "AsyncMonitorTest")
-public class AsyncMonitorTest {
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testStartMonitoringWithoutTimeout() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(null, TimeUnit.MILLISECONDS);
-
-      assertNotNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @Test(expectedExceptions = NullPointerException.class, expectedExceptionsMessageRegExp = "timeUnit must not be null when using timeouts")
-   public void testStartMonitoringWithNullTimeout() {
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      monitor.startMonitoring(100L, null);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testStartMonitoringWithoutTimeoutAndNullTimeUnit() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      // If the maxWait parameter is null, timeUnit is not required
-      monitor.startMonitoring(null, null);
-
-      assertNotNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testStartMonitoringWithTimeout() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(100L, TimeUnit.MILLISECONDS);
-
-      assertNotNull(monitor.getFuture());
-      assertNotNull(monitor.getTimeout());
-      assertTrue(monitor.getTimeout() > 100L);
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testStartMonitoringWithTimeoutInMinutes() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(1L, TimeUnit.MINUTES);
-
-      assertNotNull(monitor.getFuture());
-      assertNotNull(monitor.getTimeout());
-      assertTrue(monitor.getTimeout() > TimeUnit.MINUTES.toMillis(1));
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testIsTimeoutWhenNullTimeout() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(null, TimeUnit.MILLISECONDS);
-      assertNotNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-      assertFalse(monitor.isTimeout());
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testIsTimeoutReturnsFalseWhenNotFinished() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(60000L, TimeUnit.MILLISECONDS);
-      assertNotNull(monitor.getFuture());
-      assertNotNull(monitor.getTimeout());
-      assertFalse(monitor.isTimeout());
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testIsTimeoutReturnsTrueWhenFinished() throws InterruptedException {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(1L, TimeUnit.MILLISECONDS);
-      Thread.sleep(2L);
-      assertNotNull(monitor.getFuture());
-      assertNotNull(monitor.getTimeout());
-      assertTrue(monitor.isTimeout());
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testStopMonitoringWhenFutureIsCancelled() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      expect(mockFuture.isCancelled()).andReturn(true);
-
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(null, TimeUnit.MILLISECONDS);
-      assertNotNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.stopMonitoring();
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testStopMonitoringWhenFutureIsDone() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      expect(mockFuture.isCancelled()).andReturn(false);
-      expect(mockFuture.isDone()).andReturn(true);
-
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(null, TimeUnit.MILLISECONDS);
-      assertNotNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.stopMonitoring();
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testStopMonitoringWhenFutureIsNotComplete() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      expect(mockFuture.isCancelled()).andReturn(false);
-      expect(mockFuture.isDone()).andReturn(false);
-      expect(mockFuture.cancel(false)).andReturn(true);
-
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            new EventBus());
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(null, TimeUnit.MILLISECONDS);
-      assertNotNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.stopMonitoring();
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testMonitorAndDone() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      expect(mockFuture.isCancelled()).andReturn(true);
-
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      CoutingEventHandler handler = new CoutingEventHandler();
-      EventBus eventBus = new EventBus();
-      eventBus.register(handler);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.DONE),
-            eventBus);
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(null, TimeUnit.MILLISECONDS);
-      assertNotNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.run();
-      assertEquals(handler.numCompletes, 1);
-      assertEquals(handler.numFailures, 0);
-      assertEquals(handler.numTimeouts, 0);
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testMonitorAndFail() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      expect(mockFuture.isCancelled()).andReturn(true);
-
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      CoutingEventHandler handler = new CoutingEventHandler();
-      EventBus eventBus = new EventBus();
-      eventBus.register(handler);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.FAILED),
-            eventBus);
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(null, TimeUnit.MILLISECONDS);
-      assertNotNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.run();
-      assertEquals(handler.numCompletes, 0);
-      assertEquals(handler.numFailures, 1);
-      assertEquals(handler.numTimeouts, 0);
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testMonitorAndContinueWithoutTimeout() {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      CoutingEventHandler handler = new CoutingEventHandler();
-      EventBus eventBus = new EventBus();
-      eventBus.register(handler);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.CONTINUE),
-            eventBus);
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(null, TimeUnit.MILLISECONDS);
-      assertNotNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.run();
-      assertEquals(handler.numCompletes, 0);
-      assertEquals(handler.numFailures, 0);
-      assertEquals(handler.numTimeouts, 0);
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @SuppressWarnings({ "rawtypes", "unchecked" })
-   public void testMonitorAndContinueWithtTimeout() throws InterruptedException {
-      ScheduledFuture mockFuture = EasyMock.createMock(ScheduledFuture.class);
-      expect(mockFuture.isCancelled()).andReturn(true);
-
-      ScheduledExecutorService schedulerMock = EasyMock.createMock(ScheduledExecutorService.class);
-      expect(
-            schedulerMock.scheduleWithFixedDelay(anyObject(Runnable.class), anyLong(), anyLong(),
-                  anyObject(TimeUnit.class))).andReturn(mockFuture);
-
-      replay(mockFuture);
-      replay(schedulerMock);
-
-      CoutingEventHandler handler = new CoutingEventHandler();
-      EventBus eventBus = new EventBus();
-      eventBus.register(handler);
-
-      AsyncMonitor<Object> monitor = mockMonitor(schedulerMock, new Object(), mockFunction(MonitorStatus.CONTINUE),
-            eventBus);
-
-      assertNull(monitor.getFuture());
-      assertNull(monitor.getTimeout());
-
-      monitor.startMonitoring(1L, TimeUnit.MILLISECONDS);
-      assertNotNull(monitor.getFuture());
-      assertNotNull(monitor.getTimeout());
-
-      Thread.sleep(2L);
-      monitor.run();
-      assertEquals(handler.numCompletes, 0);
-      assertEquals(handler.numFailures, 0);
-      assertEquals(handler.numTimeouts, 1);
-
-      verify(mockFuture);
-      verify(schedulerMock);
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testCreateMonitorWithNullObject() {
-      mockMonitor(null, null, new Function<Object, MonitorStatus>() {
-         @Override
-         public MonitorStatus apply(final Object input) {
-            return MonitorStatus.DONE;
-         }
-      }, new EventBus());
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testCreateMonitorWithNullFunction() {
-      mockMonitor(null, new Object(), null, new EventBus());
-   }
-
-   @SuppressWarnings("unchecked")
-   private AsyncMonitor<Object> mockMonitor(final ScheduledExecutorService scheduler, final Object object,
-         final Function<Object, MonitorStatus> function, final EventBus eventBus) {
-      BaseMonitoringService monitorService = new BaseMonitoringService(EasyMock.createMock(ApiContext.class),
-            scheduler, 100L, eventBus);
-
-      return monitorService.new AsyncMonitor<Object>(object, function);
-   }
-
-   private Function<Object, MonitorStatus> mockFunction(final MonitorStatus status) {
-      return new Function<Object, MonitorStatus>() {
-         @Override
-         public MonitorStatus apply(final Object input) {
-            return status;
-         }
-      };
-   }
-
-   static class CoutingEventHandler {
-      public int numCompletes = 0;
-
-      public int numFailures = 0;
-
-      public int numTimeouts = 0;
-
-      @Subscribe
-      public void handle(final MonitorEvent<?> event) {
-         switch (event.getType()) {
-            case COMPLETED:
-               numCompletes++;
-               break;
-            case FAILED:
-               numFailures++;
-               break;
-            case TIMEOUT:
-               numTimeouts++;
-               break;
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAbiquoApiLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAbiquoApiLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAbiquoApiLiveApiTest.java
deleted file mode 100644
index 43812f6..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAbiquoApiLiveApiTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import org.jclouds.abiquo.environment.CloudTestEnvironment;
-import org.testng.annotations.AfterSuite;
-import org.testng.annotations.BeforeSuite;
-import org.testng.annotations.Test;
-
-/**
- * Base class for live and domain tests.
- */
-@Test(groups = "api", testName = "BaseAbiquoApiLiveApiTest", singleThreaded = true)
-public abstract class BaseAbiquoApiLiveApiTest extends BaseAbiquoLiveApiTest {
-   /** The test environment. */
-   protected static CloudTestEnvironment env;
-
-   @Override
-   @BeforeSuite(groups = "api")
-   public void setupContext() {
-      super.setupContext();
-      setupEnvironment();
-   }
-
-   @Override
-   @AfterSuite(groups = "api")
-   protected void tearDownContext() {
-      try {
-         tearDownEnvironment();
-      } finally {
-         // Make sure we close the context
-         super.tearDownContext();
-      }
-   }
-
-   protected void setupEnvironment() {
-      if (env == null) {
-         try {
-            env = new CloudTestEnvironment(view);
-            env.setup();
-         } catch (Exception ex) {
-            super.tearDownContext(); // Make sure we close the context setup
-                                     // fails
-            throw new RuntimeException("Could not create environment", ex);
-         }
-      }
-   }
-
-   protected void tearDownEnvironment() {
-      if (env != null) {
-         try {
-            env.tearDown();
-
-            // Wait a bit before closing context, to avoid executor shutdown
-            // while
-            // there are still open threads
-            Thread.sleep(1000L);
-         } catch (Exception ex) {
-            throw new RuntimeException("Could not tear down environment", ex);
-         }
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAbiquoLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAbiquoLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAbiquoLiveApiTest.java
deleted file mode 100644
index 96700e2..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAbiquoLiveApiTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static org.jclouds.reflect.Reflection2.typeToken;
-
-import java.util.Properties;
-
-import org.jclouds.abiquo.AbiquoContext;
-import org.jclouds.apis.BaseViewLiveTest;
-import org.jclouds.logging.config.LoggingModule;
-import org.jclouds.logging.slf4j.config.SLF4JLoggingModule;
-
-import com.google.common.reflect.TypeToken;
-
-/**
- * Base class for Abiquo live tests.
- */
-public abstract class BaseAbiquoLiveApiTest extends BaseViewLiveTest<AbiquoContext> {
-   public BaseAbiquoLiveApiTest() {
-      provider = "abiquo";
-   }
-
-   @Override
-   protected Properties setupProperties() {
-      Properties overrides = super.setupProperties();
-      // Wait at most one minute in Machine discovery
-      overrides.put("jclouds.timeouts.InfrastructureApi.discoverSingleMachine", "60000");
-      overrides.put("jclouds.timeouts.InfrastructureApi.discoverMultipleMachines", "60000");
-      overrides.put("jclouds.timeouts.InfrastructureApi.createMachine", "60000");
-      overrides.put("jclouds.timeouts.InfrastructureApi.updateMachine", "60000");
-      overrides.put("jclouds.timeouts.InfrastructureApi.checkMachineState", "60000");
-      overrides.put("jclouds.timeouts.CloudApi.listVirtualMachines", "60000");
-      return overrides;
-   }
-
-   @Override
-   protected LoggingModule getLoggingModule() {
-      return new SLF4JLoggingModule();
-   }
-
-   @Override
-   protected TypeToken<AbiquoContext> viewType() {
-      return typeToken(AbiquoContext.class);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAdministrationServiceTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAdministrationServiceTest.java b/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAdministrationServiceTest.java
deleted file mode 100644
index ac3e62c..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseAdministrationServiceTest.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.abiquo.features.services.AdministrationService;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link BaseAdministrationService} class.
- */
-@Test(groups = "unit", testName = "BaseAdministrationServiceTest")
-public class BaseAdministrationServiceTest extends BaseInjectionTest {
-
-   public void testAllPropertiesInjected() {
-      BaseAdministrationService service = (BaseAdministrationService) injector.getInstance(AdministrationService.class);
-
-      assertNotNull(service.context);
-      assertNotNull(service.listMachines);
-      assertNotNull(service.currentUser);
-      assertNotNull(service.currentEnterprise);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseCloudServiceTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseCloudServiceTest.java b/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseCloudServiceTest.java
deleted file mode 100644
index 82e3767..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseCloudServiceTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.abiquo.features.services.CloudService;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link BaseCloudService} class.
- */
-@Test(groups = "unit", testName = "BaseCloudServiceTest")
-public class BaseCloudServiceTest extends BaseInjectionTest {
-
-   public void testAllPropertiesInjected() {
-      BaseCloudService service = (BaseCloudService) injector.getInstance(CloudService.class);
-
-      assertNotNull(service.context);
-      assertNotNull(service.listVirtualDatacenters);
-      assertNotNull(service.listVirtualAppliances);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseEventServiceTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseEventServiceTest.java b/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseEventServiceTest.java
deleted file mode 100644
index ce4bd83..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseEventServiceTest.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.abiquo.features.services.EventService;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link BaseEventService} class.
- */
-@Test(groups = "unit", testName = "BaseEventServiceTest")
-public class BaseEventServiceTest extends BaseInjectionTest {
-   public void testAllPropertiesInjected() {
-      BaseEventService service = (BaseEventService) injector.getInstance(EventService.class);
-
-      assertNotNull(service.context);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseInjectionTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseInjectionTest.java b/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseInjectionTest.java
deleted file mode 100644
index 8664cee..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseInjectionTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import java.util.Properties;
-
-import org.jclouds.ContextBuilder;
-import org.jclouds.abiquo.AbiquoApiMetadata;
-import org.jclouds.abiquo.AbiquoContext;
-import org.jclouds.lifecycle.Closer;
-import org.jclouds.logging.config.NullLoggingModule;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-
-/**
- * Unit tests for the {@link BaseCloudService} class.
- */
-@Test(groups = "unit", testName = "BaseEventServiceTest")
-public class BaseInjectionTest {
-   protected Injector injector;
-
-   @BeforeClass
-   public void setup() {
-      injector = ContextBuilder.newBuilder(new AbiquoApiMetadata()) //
-            .credentials("identity", "credential") //
-            .modules(ImmutableSet.<Module> of(new NullLoggingModule())) //
-            .overrides(buildProperties()) //
-            .build(AbiquoContext.class).utils().injector();
-   }
-
-   protected Properties buildProperties() {
-      return new Properties();
-   }
-
-   @AfterClass
-   public void tearDown() throws Exception {
-      if (injector != null) {
-         injector.getInstance(Closer.class).close();
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseMonitoringServiceTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseMonitoringServiceTest.java b/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseMonitoringServiceTest.java
deleted file mode 100644
index e60ceb5..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/internal/BaseMonitoringServiceTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.internal;
-
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link BaseMonitoringService} class.
- */
-@Test(groups = "unit", testName = "BaseMonitoringServiceTest")
-public class BaseMonitoringServiceTest extends BaseInjectionTest {
-   public void testAllPropertiesInjected() {
-      BaseMonitoringService service = (BaseMonitoringService) injector.getInstance(MonitoringService.class);
-
-      assertNotNull(service.context);
-      assertNotNull(service.scheduler);
-      assertNotNull(service.pollingDelay);
-      assertNotNull(service.eventBus);
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testAwaitCompletionWithNullFunction() {
-      monitoringService().awaitCompletion(null, new Object[] {});
-   }
-
-   public void testAwaitCompletionWithoutTasks() {
-      BaseMonitoringService service = monitoringService();
-
-      service.awaitCompletion(new MockMonitor());
-      service.awaitCompletion(new MockMonitor(), (Object[]) null);
-      service.awaitCompletion(new MockMonitor(), new Object[] {});
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testMonitorWithNullCompleteCondition() {
-      monitoringService().monitor(null, (Object[]) null);
-   }
-
-   public void testMonitorWithoutTasks() {
-      monitoringService().monitor(new MockMonitor());
-   }
-
-   public void testDelegateToVirtualMachineMonitor() {
-      assertNotNull(monitoringService().getVirtualMachineMonitor());
-   }
-
-   public void testDelegateToVirtualApplianceMonitor() {
-      assertNotNull(monitoringService().getVirtualApplianceMonitor());
-   }
-
-   public void testDelegateToAsyncTaskMonitor() {
-      assertNotNull(monitoringService().getAsyncTaskMonitor());
-   }
-
-   public void testDelegateToConversioMonitor() {
-      assertNotNull(monitoringService().getConversionMonitor());
-   }
-
-   private BaseMonitoringService monitoringService() {
-      return injector.getInstance(BaseMonitoringService.class);
-   }
-
-   private static class MockMonitor implements Function<Object, MonitorStatus> {
-      @Override
-      public MonitorStatus apply(final Object object) {
-         return MonitorStatus.DONE;
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/AsyncTaskStatusMonitorTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/AsyncTaskStatusMonitorTest.java b/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/AsyncTaskStatusMonitorTest.java
deleted file mode 100644
index c313978..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/monitor/functions/AsyncTaskStatusMonitorTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.monitor.functions;
-
-import static org.testng.Assert.assertEquals;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.domain.task.AsyncTask;
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.rest.ApiContext;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.task.TaskDto;
-import com.abiquo.server.core.task.enums.TaskState;
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link AsyncTaskStatusMonitor} function.
- */
-@Test(groups = "unit", testName = "AsyncTaskStatusMonitorTest")
-public class AsyncTaskStatusMonitorTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullArgument() {
-      Function<AsyncTask<?, ?>, MonitorStatus> function = new AsyncTaskStatusMonitor();
-      function.apply(null);
-   }
-
-   public void testReturnDone() {
-      TaskState[] states = { TaskState.FINISHED_SUCCESSFULLY };
-
-      checkStatesReturn(new MockAsyncTask(), new AsyncTaskStatusMonitor(), states, MonitorStatus.DONE);
-   }
-
-   public void testReturnFail() {
-      TaskState[] states = { TaskState.ABORTED, TaskState.FINISHED_UNSUCCESSFULLY };
-
-      checkStatesReturn(new MockAsyncTask(), new AsyncTaskStatusMonitor(), states, MonitorStatus.FAILED);
-   }
-
-   public void testReturnContinue() {
-      TaskState[] states = { TaskState.STARTED, TaskState.PENDING };
-
-      checkStatesReturn(new MockAsyncTask(), new AsyncTaskStatusMonitor(), states, MonitorStatus.CONTINUE);
-
-      checkStatesReturn(new MockAsyncTaskFailing(), new AsyncTaskStatusMonitor(), states, MonitorStatus.CONTINUE);
-   }
-
-   private void checkStatesReturn(final MockAsyncTask task, final Function<AsyncTask<?, ?>, MonitorStatus> function,
-         final TaskState[] states, final MonitorStatus expectedStatus) {
-      for (TaskState state : states) {
-         task.setState(state);
-         assertEquals(function.apply(task), expectedStatus);
-      }
-   }
-
-   private static class MockAsyncTask extends VirtualMachineTask {
-      @SuppressWarnings("unchecked")
-      public MockAsyncTask() {
-         super(EasyMock.createMock(ApiContext.class), new TaskDto());
-      }
-
-      @Override
-      public void refresh() {
-         // Do not perform any API call
-      }
-
-      public void setState(final TaskState state) {
-         target.setState(state);
-      }
-   }
-
-   private static class MockAsyncTaskFailing extends MockAsyncTask {
-      @Override
-      public void refresh() {
-         throw new RuntimeException("This mock class always fails to refresh");
-      }
-
-   }
-
-}


[12/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/strategy/ListEntities.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/strategy/ListEntities.java b/abiquo/src/main/java/org/jclouds/abiquo/strategy/ListEntities.java
deleted file mode 100644
index b5a2ce3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/strategy/ListEntities.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy;
-
-import org.jclouds.abiquo.domain.DomainWrapper;
-
-/**
- * List all entities of the given type.
- */
-public interface ListEntities<T extends DomainWrapper<?>, P extends DomainWrapper<?>> {
-   Iterable<T> execute(P parent);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/strategy/ListRootEntities.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/strategy/ListRootEntities.java b/abiquo/src/main/java/org/jclouds/abiquo/strategy/ListRootEntities.java
deleted file mode 100644
index 25b7958..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/strategy/ListRootEntities.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy;
-
-import org.jclouds.abiquo.domain.DomainWrapper;
-
-/**
- * List all entities of the given type.
- */
-public interface ListRootEntities<T extends DomainWrapper<?>> {
-   Iterable<T> execute();
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListAttachedNics.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListAttachedNics.java b/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListAttachedNics.java
deleted file mode 100644
index 6e10b54..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListAttachedNics.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy.cloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.transform;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.network.ExternalIp;
-import org.jclouds.abiquo.domain.network.Ip;
-import org.jclouds.abiquo.domain.network.PrivateIp;
-import org.jclouds.abiquo.domain.network.PublicIp;
-import org.jclouds.abiquo.domain.network.UnmanagedIp;
-import org.jclouds.abiquo.domain.util.LinkUtils;
-import org.jclouds.abiquo.strategy.ListEntities;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.network.ExternalIpDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpDto;
-import com.google.common.base.Function;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.google.inject.TypeLiteral;
-
-/**
- * List all NICs attached to a given virtual machine.
- */
-@Singleton
-public class ListAttachedNics implements ListEntities<Ip<?, ?>, VirtualMachine> {
-   protected final ApiContext<AbiquoApi> context;
-
-   @Inject
-   public ListAttachedNics(final ApiContext<AbiquoApi> context) {
-      this.context = checkNotNull(context, "context");
-   }
-
-   @Override
-   public Iterable<Ip<?, ?>> execute(final VirtualMachine parent) {
-      parent.refresh();
-      Iterable<RESTLink> nicLinks = LinkUtils.filterNicLinks(parent.unwrap().getLinks());
-      return listIps(nicLinks);
-   }
-
-   private Iterable<Ip<?, ?>> listIps(final Iterable<RESTLink> nicLinks) {
-      return transform(nicLinks, new Function<RESTLink, Ip<?, ?>>() {
-         @Override
-         public Ip<?, ?> apply(final RESTLink input) {
-            HttpResponse response = context.getApi().get(input);
-
-            if (input.getType().equals(PrivateIpDto.BASE_MEDIA_TYPE)) {
-               ParseXMLWithJAXB<PrivateIpDto> parser = new ParseXMLWithJAXB<PrivateIpDto>(context.utils().xml(),
-                     TypeLiteral.get(PrivateIpDto.class));
-
-               return wrap(context, PrivateIp.class, parser.apply(response));
-            } else if (input.getType().equals(PublicIpDto.BASE_MEDIA_TYPE)) {
-               ParseXMLWithJAXB<PublicIpDto> parser = new ParseXMLWithJAXB<PublicIpDto>(context.utils().xml(),
-                     TypeLiteral.get(PublicIpDto.class));
-
-               return wrap(context, PublicIp.class, parser.apply(response));
-            } else if (input.getType().equals(ExternalIpDto.BASE_MEDIA_TYPE)) {
-               ParseXMLWithJAXB<ExternalIpDto> parser = new ParseXMLWithJAXB<ExternalIpDto>(context.utils().xml(),
-                     TypeLiteral.get(ExternalIpDto.class));
-
-               return wrap(context, ExternalIp.class, parser.apply(response));
-            } else if (input.getType().equals(UnmanagedIpDto.BASE_MEDIA_TYPE)) {
-               ParseXMLWithJAXB<UnmanagedIpDto> parser = new ParseXMLWithJAXB<UnmanagedIpDto>(context.utils().xml(),
-                     TypeLiteral.get(UnmanagedIpDto.class));
-
-               return wrap(context, UnmanagedIp.class, parser.apply(response));
-            } else {
-               throw new IllegalArgumentException("Unsupported media type: " + input.getType());
-            }
-         }
-      });
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListVirtualAppliances.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListVirtualAppliances.java b/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListVirtualAppliances.java
deleted file mode 100644
index 69faa28..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListVirtualAppliances.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy.cloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.util.concurrent.Futures.allAsList;
-import static com.google.common.util.concurrent.Futures.getUnchecked;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-
-import java.util.List;
-import java.util.concurrent.Callable;
-
-import javax.annotation.Resource;
-import javax.inject.Named;
-
-import org.jclouds.Constants;
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.strategy.ListRootEntities;
-import org.jclouds.logging.Logger;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualAppliancesDto;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-
-/**
- * List virtual appliances in each virtual datacenter.
- */
-@Singleton
-public class ListVirtualAppliances implements ListRootEntities<VirtualAppliance> {
-   protected final ApiContext<AbiquoApi> context;
-
-   protected final ListVirtualDatacenters listVirtualDatacenters;
-
-   protected final ListeningExecutorService userExecutor;
-
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   @Inject
-   ListVirtualAppliances(final ApiContext<AbiquoApi> context,
-         @Named(Constants.PROPERTY_USER_THREADS) final ListeningExecutorService userExecutor,
-         final ListVirtualDatacenters listVirtualDatacenters) {
-      this.context = checkNotNull(context, "context");
-      this.listVirtualDatacenters = checkNotNull(listVirtualDatacenters, "listVirtualDatacenters");
-      this.userExecutor = checkNotNull(userExecutor, "userExecutor");
-   }
-
-   @Override
-   public Iterable<VirtualAppliance> execute() {
-      return execute(userExecutor);
-   }
-
-   private Iterable<VirtualApplianceDto> listConcurrentVirtualAppliances(final ListeningExecutorService executor,
-         final Iterable<VirtualDatacenter> vdcs) {
-      ListenableFuture<List<VirtualAppliancesDto>> futures = allAsList(transform(vdcs,
-            new Function<VirtualDatacenter, ListenableFuture<VirtualAppliancesDto>>() {
-               @Override
-               public ListenableFuture<VirtualAppliancesDto> apply(final VirtualDatacenter input) {
-                  return executor.submit(new Callable<VirtualAppliancesDto>() {
-                     @Override
-                     public VirtualAppliancesDto call() throws Exception {
-                        return context.getApi().getCloudApi().listVirtualAppliances(input.unwrap());
-                     }
-                  });
-               }
-            }));
-
-      logger.trace("getting virtual appliances");
-      return DomainWrapper.join(getUnchecked(futures));
-   }
-
-   public Iterable<VirtualAppliance> execute(ListeningExecutorService executor) {
-      // / Find virtual appliances in concurrent requests
-      Iterable<VirtualDatacenter> vdcs = listVirtualDatacenters.execute(executor);
-      Iterable<VirtualApplianceDto> vapps = listConcurrentVirtualAppliances(executor, vdcs);
-
-      return wrap(context, VirtualAppliance.class, vapps);
-   }
-
-   public Iterable<VirtualAppliance> execute(ListeningExecutorService executor, Predicate<VirtualAppliance> selector) {
-      return filter(execute(executor), selector);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListVirtualDatacenters.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListVirtualDatacenters.java b/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListVirtualDatacenters.java
deleted file mode 100644
index 0daa737..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/strategy/cloud/ListVirtualDatacenters.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy.cloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.collect.Lists.newArrayList;
-import static com.google.common.util.concurrent.Futures.allAsList;
-import static com.google.common.util.concurrent.Futures.getUnchecked;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-
-import java.util.List;
-import java.util.concurrent.Callable;
-
-import javax.annotation.Resource;
-import javax.inject.Named;
-
-import org.jclouds.Constants;
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.options.VirtualDatacenterOptions;
-import org.jclouds.abiquo.strategy.ListRootEntities;
-import org.jclouds.logging.Logger;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.cloud.VirtualDatacentersDto;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-
-/**
- * List virtual datacenters.
- */
-@Singleton
-public class ListVirtualDatacenters implements ListRootEntities<VirtualDatacenter> {
-   protected final ApiContext<AbiquoApi> context;
-
-   protected final ListeningExecutorService userExecutor;
-
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   @Inject
-   ListVirtualDatacenters(final ApiContext<AbiquoApi> context,
-         @Named(Constants.PROPERTY_USER_THREADS) final ListeningExecutorService userExecutor) {
-      this.context = checkNotNull(context, "context");
-      this.userExecutor = checkNotNull(userExecutor, "userExecutor");
-   }
-
-   @Override
-   public Iterable<VirtualDatacenter> execute() {
-      return execute(userExecutor);
-   }
-
-   public Iterable<VirtualDatacenter> execute(final VirtualDatacenterOptions virtualDatacenterOptions) {
-      VirtualDatacentersDto result = context.getApi().getCloudApi().listVirtualDatacenters(virtualDatacenterOptions);
-      return wrap(context, VirtualDatacenter.class, result.getCollection());
-   }
-
-   public Iterable<VirtualDatacenter> execute(final Predicate<VirtualDatacenter> selector,
-         final VirtualDatacenterOptions virtualDatacenterOptions) {
-      return filter(execute(virtualDatacenterOptions), selector);
-   }
-
-   public Iterable<VirtualDatacenter> execute(final List<Integer> virtualDatacenterIds) {
-      return execute(userExecutor, virtualDatacenterIds);
-   }
-
-   public Iterable<VirtualDatacenter> execute(ListeningExecutorService executor,
-         final List<Integer> virtualDatacenterIds) {
-      return listConcurrentVirtualDatacenters(executor, virtualDatacenterIds);
-   }
-
-   private Iterable<VirtualDatacenter> listConcurrentVirtualDatacenters(final ListeningExecutorService executor,
-         final List<Integer> ids) {
-      ListenableFuture<List<VirtualDatacenterDto>> futures = allAsList(transform(ids,
-            new Function<Integer, ListenableFuture<VirtualDatacenterDto>>() {
-               @Override
-               public ListenableFuture<VirtualDatacenterDto> apply(final Integer input) {
-                  return executor.submit(new Callable<VirtualDatacenterDto>() {
-                     @Override
-                     public VirtualDatacenterDto call() throws Exception {
-                        return context.getApi().getCloudApi().getVirtualDatacenter(input);
-                     }
-                  });
-
-               }
-            }));
-
-      logger.trace("getting virtual datacenters");
-      return wrap(context, VirtualDatacenter.class, newArrayList(getUnchecked(futures)));
-   }
-
-   public Iterable<VirtualDatacenter> execute(ListeningExecutorService executor) {
-      VirtualDatacenterOptions virtualDatacenterOptions = VirtualDatacenterOptions.builder().build();
-      return execute(virtualDatacenterOptions);
-   }
-
-   public Iterable<VirtualDatacenter> execute(ListeningExecutorService executor, Predicate<VirtualDatacenter> selector) {
-      return filter(execute(executor), selector);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/strategy/enterprise/ListVirtualMachineTemplates.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/strategy/enterprise/ListVirtualMachineTemplates.java b/abiquo/src/main/java/org/jclouds/abiquo/strategy/enterprise/ListVirtualMachineTemplates.java
deleted file mode 100644
index 01a0a11..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/strategy/enterprise/ListVirtualMachineTemplates.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy.enterprise;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.concat;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.util.concurrent.Futures.allAsList;
-import static com.google.common.util.concurrent.Futures.getUnchecked;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-
-import java.util.List;
-import java.util.concurrent.Callable;
-
-import javax.annotation.Resource;
-import javax.inject.Named;
-
-import org.jclouds.Constants;
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.strategy.ListEntities;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.logging.Logger;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-
-/**
- * List all virtual machine templates available to an enterprise.
- */
-@Singleton
-public class ListVirtualMachineTemplates implements ListEntities<VirtualMachineTemplate, Enterprise> {
-   protected final ApiContext<AbiquoApi> context;
-
-   protected final ListeningExecutorService userExecutor;
-
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   @Inject
-   ListVirtualMachineTemplates(final ApiContext<AbiquoApi> context,
-         @Named(Constants.PROPERTY_USER_THREADS) final ListeningExecutorService userExecutor) {
-      super();
-      this.context = checkNotNull(context, "context");
-      this.userExecutor = checkNotNull(userExecutor, "userExecutor");
-   }
-
-   @Override
-   public Iterable<VirtualMachineTemplate> execute(final Enterprise parent) {
-      return execute(userExecutor, parent);
-   }
-
-   public Iterable<VirtualMachineTemplate> execute(ListeningExecutorService executor, final Enterprise parent) {
-      // Find virtual machine templates in concurrent requests
-      Iterable<Datacenter> dcs = parent.listAllowedDatacenters();
-      Iterable<VirtualMachineTemplateDto> templates = listConcurrentTemplates(executor, parent, dcs);
-
-      return wrap(context, VirtualMachineTemplate.class, templates);
-   }
-
-   public Iterable<VirtualMachineTemplate> execute(ListeningExecutorService executor, final Enterprise parent,
-         final Predicate<VirtualMachineTemplate> selector) {
-      return filter(execute(executor, parent), selector);
-   }
-
-   private Iterable<VirtualMachineTemplateDto> listConcurrentTemplates(final ListeningExecutorService executor,
-         final Enterprise parent, final Iterable<Datacenter> dcs) {
-      ListenableFuture<List<Iterable<VirtualMachineTemplateDto>>> futures = allAsList(transform(dcs,
-            new Function<Datacenter, ListenableFuture<Iterable<VirtualMachineTemplateDto>>>() {
-               @Override
-               public ListenableFuture<Iterable<VirtualMachineTemplateDto>> apply(final Datacenter input) {
-                  return executor.submit(new Callable<Iterable<VirtualMachineTemplateDto>>() {
-                     @Override
-                     public Iterable<VirtualMachineTemplateDto> call() throws Exception {
-                        PagedIterable<VirtualMachineTemplateDto> templates = context.getApi()
-                              .getVirtualMachineTemplateApi()
-                              .listVirtualMachineTemplates(parent.getId(), input.getId());
-                        return templates.concat();
-                     }
-                  });
-               }
-            }));
-
-      logger.trace("getting virtual machine templates");
-      return concat(getUnchecked(futures));
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/strategy/infrastructure/ListMachines.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/strategy/infrastructure/ListMachines.java b/abiquo/src/main/java/org/jclouds/abiquo/strategy/infrastructure/ListMachines.java
deleted file mode 100644
index 3403fda..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/strategy/infrastructure/ListMachines.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.strategy.infrastructure;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.util.concurrent.Futures.allAsList;
-import static com.google.common.util.concurrent.Futures.getUnchecked;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-
-import java.util.List;
-import java.util.concurrent.Callable;
-
-import javax.annotation.Resource;
-import javax.inject.Named;
-
-import org.jclouds.Constants;
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.infrastructure.Machine;
-import org.jclouds.abiquo.strategy.ListRootEntities;
-import org.jclouds.logging.Logger;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.infrastructure.DatacentersDto;
-import com.abiquo.server.core.infrastructure.MachineDto;
-import com.abiquo.server.core.infrastructure.MachinesDto;
-import com.abiquo.server.core.infrastructure.RackDto;
-import com.abiquo.server.core.infrastructure.RacksDto;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-
-/**
- * List machines in each datacenter and rack.
- */
-@Singleton
-public class ListMachines implements ListRootEntities<Machine> {
-   protected ApiContext<AbiquoApi> context;
-
-   protected final ListeningExecutorService userExecutor;
-
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   @Inject
-   ListMachines(final ApiContext<AbiquoApi> context,
-         @Named(Constants.PROPERTY_USER_THREADS) final ListeningExecutorService userExecutor) {
-      super();
-      this.context = checkNotNull(context, "context");
-      this.userExecutor = checkNotNull(userExecutor, "userExecutor");
-   }
-
-   @Override
-   public Iterable<Machine> execute() {
-      return execute(userExecutor);
-   }
-
-   public Iterable<Machine> execute(ListeningExecutorService executor) {
-      // Find machines in concurrent requests
-      DatacentersDto result = context.getApi().getInfrastructureApi().listDatacenters();
-      Iterable<Datacenter> datacenters = wrap(context, Datacenter.class, result.getCollection());
-      Iterable<RackDto> racks = listConcurrentRacks(executor, datacenters);
-      Iterable<MachineDto> machines = listConcurrentMachines(executor, racks);
-
-      return wrap(context, Machine.class, machines);
-   }
-
-   public Iterable<Machine> execute(ListeningExecutorService executor, final Predicate<Machine> selector) {
-      return filter(execute(executor), selector);
-   }
-
-   private Iterable<RackDto> listConcurrentRacks(final ListeningExecutorService executor,
-         final Iterable<Datacenter> datacenters) {
-      ListenableFuture<List<RacksDto>> futures = allAsList(transform(datacenters,
-            new Function<Datacenter, ListenableFuture<RacksDto>>() {
-               @Override
-               public ListenableFuture<RacksDto> apply(final Datacenter input) {
-                  return executor.submit(new Callable<RacksDto>() {
-                     @Override
-                     public RacksDto call() throws Exception {
-                        return context.getApi().getInfrastructureApi().listRacks(input.unwrap());
-                     }
-                  });
-               }
-            }));
-
-      logger.trace("getting racks");
-      return DomainWrapper.join(getUnchecked(futures));
-   }
-
-   private Iterable<MachineDto> listConcurrentMachines(final ListeningExecutorService executor,
-         final Iterable<RackDto> racks) {
-      ListenableFuture<List<MachinesDto>> futures = allAsList(transform(racks,
-            new Function<RackDto, ListenableFuture<MachinesDto>>() {
-               @Override
-               public ListenableFuture<MachinesDto> apply(final RackDto input) {
-                  return executor.submit(new Callable<MachinesDto>() {
-                     @Override
-                     public MachinesDto call() throws Exception {
-                        return context.getApi().getInfrastructureApi().listMachines(input);
-                     }
-                  });
-               }
-            }));
-
-      logger.trace("getting machines");
-      return DomainWrapper.join(getUnchecked(futures));
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
----------------------------------------------------------------------
diff --git a/abiquo/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/abiquo/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
deleted file mode 100644
index 642f443..0000000
--- a/abiquo/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata
+++ /dev/null
@@ -1 +0,0 @@
-org.jclouds.abiquo.AbiquoApiMetadata
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/AbiquoApiMetadataTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/AbiquoApiMetadataTest.java b/abiquo/src/test/java/org/jclouds/abiquo/AbiquoApiMetadataTest.java
index 6a7935f..936c13f 100644
--- a/abiquo/src/test/java/org/jclouds/abiquo/AbiquoApiMetadataTest.java
+++ b/abiquo/src/test/java/org/jclouds/abiquo/AbiquoApiMetadataTest.java
@@ -20,19 +20,25 @@ import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
 import static org.testng.Assert.assertTrue;
 
+import org.jclouds.View;
 import org.jclouds.apis.ApiMetadata;
 import org.jclouds.apis.Apis;
-import org.jclouds.compute.internal.BaseComputeServiceApiMetadataTest;
+import org.jclouds.apis.internal.BaseApiMetadataTest;
 import org.testng.annotations.Test;
 
+import com.google.common.collect.ImmutableSet;
+import com.google.common.reflect.TypeToken;
+
 /**
  * Unit tests for the {@link AbiquoApiMetadata} class.
  */
 @Test(groups = "unit", testName = "AbiquoApiMetadataTest")
-public class AbiquoApiMetadataTest extends BaseComputeServiceApiMetadataTest {
+// TODO: Change inheritance to BaseComputeApiMetadataTest once the
+// ComputeService abstraction is implemented
+public class AbiquoApiMetadataTest extends BaseApiMetadataTest {
 
    public AbiquoApiMetadataTest() {
-      super(new AbiquoApiMetadata());
+      super(new AbiquoApiMetadata(), ImmutableSet.<TypeToken<? extends View>> of());
    }
 
    public void testAbiquoApiRegistered() {

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/AbiquoApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/AbiquoApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/AbiquoApiTest.java
deleted file mode 100644
index 212daba..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/AbiquoApiTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo;
-
-import static org.jclouds.reflect.Reflection2.method;
-
-import java.io.IOException;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.features.BaseAbiquoApiTest;
-import org.jclouds.functions.IdentityFunction;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.DatacentersDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Tests annotation parsing of {@code AbiquoApi}.
- */
-@Test(groups = "unit", testName = "AbiquoApiTest")
-public class AbiquoApiTest extends BaseAbiquoApiTest<AbiquoApi> {
-   public void testGet() throws SecurityException, NoSuchMethodException, IOException {
-      RESTLink link = new RESTLink("edit", "http://foo/bar");
-      link.setType(DatacentersDto.BASE_MEDIA_TYPE);
-
-      Invokable<?, ?> method = method(AbiquoApi.class, "get", RESTLink.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(link)));
-
-      assertRequestLineEquals(request, "GET http://foo/bar HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacentersDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, IdentityFunction.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/AbiquoDelegateApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/AbiquoDelegateApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/AbiquoDelegateApiTest.java
deleted file mode 100644
index 223393c..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/AbiquoDelegateApiTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo;
-
-import static org.testng.Assert.assertNotNull;
-
-import java.io.IOException;
-import java.util.concurrent.ExecutionException;
-
-import org.jclouds.abiquo.features.BaseAbiquoApiTest;
-import org.jclouds.http.HttpRequest;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-/**
- * Tests asynchronous and synchronous API delegates.
- */
-@Test(groups = "unit", testName = "AbiquoDelegateApiTest")
-public class AbiquoDelegateApiTest extends BaseAbiquoApiTest<AbiquoApi> {
-
-   private AbiquoApi syncApi;
-
-   @BeforeClass
-   @Override
-   protected void setupFactory() throws IOException {
-      super.setupFactory();
-      syncApi = injector.getInstance(AbiquoApi.class);
-   }
-
-   public void testSync() throws SecurityException, NoSuchMethodException, InterruptedException, ExecutionException {
-      assertNotNull(syncApi.getAdminApi());
-      assertNotNull(syncApi.getConfigApi());
-      assertNotNull(syncApi.getInfrastructureApi());
-      assertNotNull(syncApi.getEnterpriseApi());
-      assertNotNull(syncApi.getCloudApi());
-      assertNotNull(syncApi.getVirtualMachineTemplateApi());
-      assertNotNull(syncApi.getTaskApi());
-   }
-
-   @Override
-   protected void checkFilters(final HttpRequest request) {
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/AppendToPathTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/AppendToPathTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/AppendToPathTest.java
deleted file mode 100644
index dabbe55..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/AppendToPathTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders;
-
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-
-import org.jclouds.http.HttpRequest;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link AppendToPath} binder.
- */
-@Test(groups = "unit", testName = "AppendToPathTest")
-public class AppendToPathTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      AppendToPath binder = new AppendToPath();
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, null);
-   }
-
-   public void testBindString() {
-      AppendToPath binder = new AppendToPath();
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      HttpRequest newRequest = binder.bindToRequest(request, "expanded/path");
-      assertEquals(newRequest.getRequestLine(), "GET http://localhost/expanded/path HTTP/1.1");
-   }
-
-   public void testBindNumber() {
-      AppendToPath binder = new AppendToPath();
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      HttpRequest newRequest = binder.bindToRequest(request, 57);
-      assertEquals(newRequest.getRequestLine(), "GET http://localhost/57 HTTP/1.1");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/BindLinkToPathAndAcceptHeaderTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/BindLinkToPathAndAcceptHeaderTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/BindLinkToPathAndAcceptHeaderTest.java
deleted file mode 100644
index 7ea6322..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/BindLinkToPathAndAcceptHeaderTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.net.URI;
-
-import org.jclouds.http.HttpRequest;
-import org.testng.annotations.Test;
-
-import com.google.common.net.HttpHeaders;
-
-/**
- * Unit tests for the {@link BindLinkToPathAndAcceptHeader} class.
- */
-@Test(groups = "unit", testName = "BindLinkToPathAndAcceptHeaderTest")
-public class BindLinkToPathAndAcceptHeaderTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      BindLinkToPathAndAcceptHeader binder = new BindLinkToPathAndAcceptHeader();
-      binder.addHeader(null, HttpHeaders.ACCEPT, null);
-   }
-
-   public void testAddHeader() {
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-
-      BindLinkToPathAndAcceptHeader binder = new BindLinkToPathAndAcceptHeader();
-      HttpRequest updatedRequest = binder.addHeader(request, HttpHeaders.ACCEPT,
-            "application/vnd.abiquo.datacenters+xml");
-
-      String accept = updatedRequest.getFirstHeaderOrNull(HttpHeaders.ACCEPT);
-
-      assertNotNull(accept);
-      assertEquals(accept, "application/vnd.abiquo.datacenters+xml");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/BindLinkToPathTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/BindLinkToPathTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/BindLinkToPathTest.java
deleted file mode 100644
index bd2215c..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/BindLinkToPathTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders;
-
-import static org.testng.Assert.assertEquals;
-
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-
-/**
- * Unit tests for the {@link BindLinkToPath} class.
- */
-@Test(groups = "unit", testName = "BindLinkToPathTest")
-public class BindLinkToPathTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testGetNewEnpointNullInput() {
-      BindLinkToPath binder = new BindLinkToPath();
-      binder.getNewEndpoint(null, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testGetNewEnpointInvalidInput() {
-      BindLinkToPath binder = new BindLinkToPath();
-      binder.getNewEndpoint(null, new Object());
-   }
-
-   public void testGetNewEnpoint() {
-      BindLinkToPath binder = new BindLinkToPath();
-      assertEquals(binder.getNewEndpoint(null, new RESTLink("edit", "http://foo/bar")), "http://foo/bar");
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/BindToPathTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/BindToPathTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/BindToPathTest.java
deleted file mode 100644
index 72db6ba..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/BindToPathTest.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders;
-
-import static org.jclouds.reflect.Reflection2.method;
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.HttpMethod;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.abiquo.rest.annotations.EndpointLink;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.binders.BindException;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.SingleResourceTransportDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Unit tests for the {@link BindToPath} binder.
- */
-@Test(groups = "unit", testName = "BindToPathTest")
-public class BindToPathTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullRequest() throws SecurityException, NoSuchMethodException {
-      BindToPath binder = new BindToPath();
-      binder.bindToRequest(null, new Object());
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidRequestType() throws SecurityException, NoSuchMethodException {
-      BindToPath binder = new BindToPath();
-      binder.bindToRequest(HttpRequest.builder().method("m").endpoint("http://localhost").build(), new Object());
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> withEndpointLink = method(TestEndpointLink.class, "withEndpointLink", TestDto.class);
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(withEndpointLink, ImmutableList.<Object> of(new TestDto())))
-            .method(HttpMethod.GET).endpoint(URI.create("http://localhost")).build();
-
-      BindToPath binder = new BindToPath();
-      binder.bindToRequest(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidInputType() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> withEndpointLink = method(TestEndpointLink.class, "withEndpointLink", TestDto.class);
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(withEndpointLink, ImmutableList.<Object> of(new TestDto())))
-            .method(HttpMethod.GET).endpoint(URI.create("http://localhost")).build();
-
-      BindToPath binder = new BindToPath();
-      binder.bindToRequest(request, new Object());
-   }
-
-   @Test(expectedExceptions = BindException.class)
-   public void testAnnotationNotPresent() throws SecurityException, NoSuchMethodException {
-      TestDto dto = new TestDto();
-      Invokable<?, ?> withoutEndpointLink = method(TestEndpointLink.class, "withoutEndpointLink", TestDto.class);
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(withoutEndpointLink, ImmutableList.<Object> of(dto))).method(HttpMethod.GET)
-            .endpoint(URI.create("http://localhost")).build();
-
-      BindToPath binder = new BindToPath();
-      binder.bindToRequest(request, dto);
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testLinkNotPresent() throws SecurityException, NoSuchMethodException {
-      TestDto dto = new TestDto();
-      Invokable<?, ?> withUnexistingLink = method(TestEndpointLink.class, "withUnexistingLink", TestDto.class);
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(withUnexistingLink, ImmutableList.<Object> of(dto))).method(HttpMethod.GET)
-            .endpoint(URI.create("http://localhost")).build();
-
-      BindToPath binder = new BindToPath();
-      binder.bindToRequest(request, dto);
-   }
-
-   public void testBindWithoutParameters() throws SecurityException, NoSuchMethodException {
-      TestDto dto = new TestDto();
-      Invokable<?, ?> withEndpointLink = method(TestEndpointLink.class, "withEndpointLink", TestDto.class);
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(withEndpointLink, ImmutableList.<Object> of(dto))).method(HttpMethod.GET)
-            .endpoint(URI.create("http://localhost")).build();
-
-      BindToPath binder = new BindToPath();
-      GeneratedHttpRequest newRequest = binder.bindToRequest(request, dto);
-      assertEquals(newRequest.getRequestLine(), "GET http://linkuri HTTP/1.1");
-   }
-
-   public void testBindWithQueryParameters() throws SecurityException, NoSuchMethodException {
-      TestDto dto = new TestDto();
-      Invokable<?, ?> withEndpointLink = method(TestEndpointLink.class, "withEndpointLink", TestDto.class);
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(withEndpointLink, ImmutableList.<Object> of(dto))).method(HttpMethod.GET)
-            .endpoint(URI.create("http://localhost?param=value")).build();
-
-      BindToPath binder = new BindToPath();
-      GeneratedHttpRequest newRequest = binder.bindToRequest(request, dto);
-      assertEquals(newRequest.getRequestLine(), "GET http://linkuri?param=value HTTP/1.1");
-   }
-
-   interface TestEndpointLink {
-      @GET
-      void withEndpointLink(@EndpointLink("edit") TestDto dto);
-
-      @GET
-      void withUnexistingLink(@EndpointLink("unexisting") TestDto dto);
-
-      @GET
-      void withoutEndpointLink(TestDto dto);
-   }
-
-   static class TestDto extends SingleResourceTransportDto {
-
-      private static final long serialVersionUID = 5381713583837345158L;
-
-      public TestDto() {
-         addLink(new RESTLink("edit", "http://linkuri"));
-      }
-
-      @Override
-      public String getMediaType() {
-         return MediaType.APPLICATION_XML;
-      }
-
-      @Override
-      public String getBaseMediaType() {
-         return MediaType.APPLICATION_XML;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindHardDiskRefsToPayloadTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindHardDiskRefsToPayloadTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindHardDiskRefsToPayloadTest.java
deleted file mode 100644
index d93f78e..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindHardDiskRefsToPayloadTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.abiquo.util.Assert.assertPayloadEquals;
-
-import java.io.IOException;
-import java.net.URI;
-
-import org.jclouds.abiquo.domain.CloudResources;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.xml.internal.JAXBParser;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.storage.DiskManagementDto;
-
-/**
- * Unit tests for the {@link BindHardDiskRefsToPayload} binder.
- */
-@Test(groups = "unit", testName = "BindHardDiskRefsToPayloadTest")
-public class BindHardDiskRefsToPayloadTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      BindHardDiskRefsToPayload binder = new BindHardDiskRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidTypeInput() {
-      BindHardDiskRefsToPayload binder = new BindHardDiskRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, new Object());
-   }
-
-   public void testBindEmptyArray() throws IOException {
-      BindHardDiskRefsToPayload binder = new BindHardDiskRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, new DiskManagementDto[] {});
-      assertPayloadEquals(request.getPayload(), withHeader("<links/>"), LinksDto.class);
-   }
-
-   public void testBindSingleHardDisk() throws IOException {
-      DiskManagementDto hardDisk = CloudResources.hardDiskPut();
-      BindHardDiskRefsToPayload binder = new BindHardDiskRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, new DiskManagementDto[] { hardDisk });
-      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + hardDisk.getEditLink().getHref()
-            + "\" rel=\"" + binder.getRelToUse(hardDisk) + "\"/></links>"), LinksDto.class);
-   }
-
-   public void testBindMultipleHardDisks() throws IOException {
-      DiskManagementDto hardDisk = CloudResources.hardDiskPut();
-      BindHardDiskRefsToPayload binder = new BindHardDiskRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, new DiskManagementDto[] { hardDisk, hardDisk });
-      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + hardDisk.getEditLink().getHref()
-            + "\" rel=\"" + binder.getRelToUse(hardDisk) + "\"/></links>"), LinksDto.class);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindIpRefToPayloadTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindIpRefToPayloadTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindIpRefToPayloadTest.java
deleted file mode 100644
index c75405d..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindIpRefToPayloadTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.abiquo.util.Assert.assertPayloadEquals;
-
-import java.io.IOException;
-import java.net.URI;
-
-import org.jclouds.abiquo.domain.NetworkResources;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.xml.internal.JAXBParser;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-
-/**
- * Unit tests for the {@link BindIpRefToPayload} binder.
- */
-@Test(groups = "unit", testName = "BindIpRefToPayloadTest")
-public class BindIpRefToPayloadTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      BindIpRefToPayload binder = new BindIpRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidTypeInput() {
-      BindIpRefToPayload binder = new BindIpRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, new Object());
-   }
-
-   public void testBindIpRef() throws IOException {
-      PrivateIpDto ip = NetworkResources.privateIpPut();
-      RESTLink selfLink = ip.searchLink("self");
-      BindIpRefToPayload binder = new BindIpRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, ip);
-      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + selfLink.getHref() + "\" rel=\""
-            + selfLink.getTitle() + "\"/></links>"), LinksDto.class);
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindIpRefsToPayloadTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindIpRefsToPayloadTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindIpRefsToPayloadTest.java
deleted file mode 100644
index 4034366..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindIpRefsToPayloadTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.abiquo.util.Assert.assertPayloadEquals;
-
-import java.io.IOException;
-import java.net.URI;
-
-import org.jclouds.abiquo.domain.NetworkResources;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.xml.internal.JAXBParser;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.network.AbstractIpDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-
-/**
- * Unit tests for the {@link BindIpRefsToPayload} binder.
- */
-@Test(groups = "unit", testName = "BindIpRefsToPayloadTest")
-public class BindIpRefsToPayloadTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      BindIpRefsToPayload binder = new BindIpRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidTypeInput() {
-      BindIpRefsToPayload binder = new BindIpRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, new Object());
-   }
-
-   public void testBindEmptyArray() throws IOException {
-      BindIpRefsToPayload binder = new BindIpRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, new AbstractIpDto[] {});
-      assertPayloadEquals(request.getPayload(), withHeader("<links/>"), LinksDto.class);
-   }
-
-   public void testBindSingleIp() throws IOException {
-      PrivateIpDto ip = NetworkResources.privateIpPut();
-      BindIpRefsToPayload binder = new BindIpRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, new AbstractIpDto[] { ip });
-      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ip.searchLink("self").getHref()
-            + "\" rel=\"" + ip.searchLink("self").getTitle() + "\"/></links>"), LinksDto.class);
-   }
-
-   public void testBindMultipleIps() throws IOException {
-      PrivateIpDto ip = NetworkResources.privateIpPut();
-      BindIpRefsToPayload binder = new BindIpRefsToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, new AbstractIpDto[] { ip, ip });
-      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ip.searchLink("self").getHref()
-            + "\" rel=\"" + ip.searchLink("self").getTitle() + "\"/></links>"), LinksDto.class);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPathTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPathTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPathTest.java
deleted file mode 100644
index 1cf4f08..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindMoveVolumeToPathTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static org.jclouds.reflect.Reflection2.method;
-import static org.testng.Assert.assertEquals;
-
-import java.net.URI;
-
-import javax.ws.rs.HttpMethod;
-
-import org.jclouds.abiquo.domain.CloudResources;
-import org.jclouds.abiquo.features.CloudApi;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Unit tests for the {@link BindMoveVolumeToPath} binder.
- */
-@Test(groups = "unit", testName = "BindMoveVolumeToPathTest")
-public class BindMoveVolumeToPathTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() throws SecurityException, NoSuchMethodException {
-      BindMoveVolumeToPath binder = new BindMoveVolumeToPath();
-      binder.getNewEndpoint(generatedHttpRequest(), null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidInputType() throws SecurityException, NoSuchMethodException {
-      BindMoveVolumeToPath binder = new BindMoveVolumeToPath();
-      binder.getNewEndpoint(generatedHttpRequest(), new Object());
-   }
-
-   public void testGetNewEndpoint() throws SecurityException, NoSuchMethodException {
-      BindMoveVolumeToPath binder = new BindMoveVolumeToPath();
-      String newEndpoint = binder.getNewEndpoint(generatedHttpRequest(), CloudResources.volumePut());
-      assertEquals(newEndpoint, "http://localhost/api/cloud/virtualdatacenters/1/volumes/1/action/move");
-   }
-
-   private static GeneratedHttpRequest generatedHttpRequest() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> withEndpointLink = method(CloudApi.class, "moveVolume", VolumeManagementDto.class,
-            VirtualDatacenterDto.class);
-      return GeneratedHttpRequest
-            .builder()
-            .invocation(
-                  Invocation.create(withEndpointLink,
-                        ImmutableList.<Object> of(CloudResources.volumePut(), CloudResources.virtualDatacenterPut())))
-            .method(HttpMethod.POST).endpoint(URI.create("http://localhost")).build();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayloadTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayloadTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayloadTest.java
deleted file mode 100644
index d88eb57..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkConfigurationRefToPayloadTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.abiquo.util.Assert.assertPayloadEquals;
-import static org.jclouds.reflect.Reflection2.method;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.NoSuchElementException;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.HttpMethod;
-
-import org.jclouds.abiquo.domain.CloudResources;
-import org.jclouds.abiquo.domain.NetworkResources;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.jclouds.xml.internal.JAXBParser;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.cloud.VirtualMachineDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-import com.google.common.reflect.Invokable;
-
-/**
- * Unit tests for the {@link BindNetworkConfigurationRefToPayload} binder.
- */
-@Test(groups = "unit", testName = "BindNetworkConfigurationRefToPayloadTest")
-public class BindNetworkConfigurationRefToPayloadTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullRequest() throws SecurityException, NoSuchMethodException {
-      BindNetworkConfigurationRefToPayload binder = new BindNetworkConfigurationRefToPayload(new JAXBParser("false"));
-      binder.bindToRequest(null, new Object());
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidRequestType() throws SecurityException, NoSuchMethodException {
-      BindNetworkConfigurationRefToPayload binder = new BindNetworkConfigurationRefToPayload(new JAXBParser("false"));
-
-      binder.bindToRequest(HttpRequest.builder().method("m").endpoint("http://localhost").build(), new Object());
-   }
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() throws SecurityException, NoSuchMethodException {
-      VirtualMachineDto vm = CloudResources.virtualMachinePut();
-
-      Invokable<?, ?> method = method(TestNetworkConfig.class, "withAll", VirtualMachineDto.class, VLANNetworkDto.class);
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(method, Lists.<Object> newArrayList(vm, null))).method(HttpMethod.GET)
-            .endpoint(URI.create("http://localhost")).build();
-
-      BindNetworkConfigurationRefToPayload binder = new BindNetworkConfigurationRefToPayload(new JAXBParser("false"));
-      binder.bindToRequest(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidTypeInput() throws SecurityException, NoSuchMethodException {
-      VirtualMachineDto vm = CloudResources.virtualMachinePut();
-      Object network = new Object();
-
-      Invokable<?, ?> method = method(TestNetworkConfig.class, "withAll", VirtualMachineDto.class, VLANNetworkDto.class);
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(method, ImmutableList.<Object> of(vm, network))).method(HttpMethod.GET)
-            .endpoint(URI.create("http://localhost")).build();
-
-      BindNetworkConfigurationRefToPayload binder = new BindNetworkConfigurationRefToPayload(new JAXBParser("false"));
-      binder.bindToRequest(request, network);
-   }
-
-   @Test(expectedExceptions = NoSuchElementException.class)
-   public void testBindNetworkConfigurationRefWithoutVirtualMachine() throws SecurityException, NoSuchMethodException {
-      VLANNetworkDto network = NetworkResources.privateNetworkPut();
-
-      Invokable<?, ?> method = method(TestNetworkConfig.class, "withoutVirtualMachine", VLANNetworkDto.class);
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(method, ImmutableList.<Object> of(network))).method(HttpMethod.GET)
-            .endpoint(URI.create("http://localhost")).build();
-
-      BindNetworkConfigurationRefToPayload binder = new BindNetworkConfigurationRefToPayload(new JAXBParser("false"));
-      binder.bindToRequest(request, network);
-   }
-
-   public void testBindNetworkConfigurationRef() throws SecurityException, NoSuchMethodException, IOException {
-      VirtualMachineDto vm = CloudResources.virtualMachinePut();
-      VLANNetworkDto network = NetworkResources.privateNetworkPut();
-
-      Invokable<?, ?> method = method(TestNetworkConfig.class, "withAll", VirtualMachineDto.class, VLANNetworkDto.class);
-      GeneratedHttpRequest request = GeneratedHttpRequest.builder()
-            .invocation(Invocation.create(method, ImmutableList.<Object> of(vm, network))).method(HttpMethod.GET)
-            .endpoint(URI.create("http://localhost")).build();
-
-      BindNetworkConfigurationRefToPayload binder = new BindNetworkConfigurationRefToPayload(new JAXBParser("false"));
-
-      String configLink = vm.searchLink("configurations").getHref() + "/" + network.getId();
-
-      GeneratedHttpRequest newRequest = binder.bindToRequest(request, network);
-      assertPayloadEquals(newRequest.getPayload(), withHeader("<links><link href=\"" + configLink
-            + "\" rel=\"network_configuration\"/></links>"), LinksDto.class);
-   }
-
-   interface TestNetworkConfig {
-      @GET
-      void withoutVirtualMachine(VLANNetworkDto network);
-
-      @GET
-      void withAll(VirtualMachineDto virtualMachine, VLANNetworkDto network);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkRefToPayloadTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkRefToPayloadTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkRefToPayloadTest.java
deleted file mode 100644
index 26ee2ee..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindNetworkRefToPayloadTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.abiquo.util.Assert.assertPayloadEquals;
-
-import java.io.IOException;
-import java.net.URI;
-
-import org.jclouds.abiquo.domain.NetworkResources;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.xml.internal.JAXBParser;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-
-/**
- * Unit tests for the {@link BindNetworkRefToPayload} binder.
- */
-@Test(groups = "unit", testName = "BindNetworkRefToPayloadTest")
-public class BindNetworkRefToPayloadTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      BindNetworkRefToPayload binder = new BindNetworkRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidTypeInput() {
-      BindNetworkRefToPayload binder = new BindNetworkRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, new Object());
-   }
-
-   public void testBindNetworkRef() throws IOException {
-      VLANNetworkDto network = NetworkResources.privateNetworkPut();
-      BindNetworkRefToPayload binder = new BindNetworkRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, network);
-      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + network.getEditLink().getHref()
-            + "\" rel=\"internalnetwork\"/></links>"), LinksDto.class);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindUnmanagedIpRefToPayloadTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindUnmanagedIpRefToPayloadTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindUnmanagedIpRefToPayloadTest.java
deleted file mode 100644
index eefb8fb..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindUnmanagedIpRefToPayloadTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.abiquo.util.Assert.assertPayloadEquals;
-
-import java.io.IOException;
-import java.net.URI;
-
-import org.jclouds.abiquo.domain.NetworkResources;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.xml.internal.JAXBParser;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-
-/**
- * Unit tests for the {@link BindUnmanagedIpRefToPayload} binder.
- */
-@Test(groups = "unit", testName = "BindUnmanagedIpRefToPayloadTest")
-public class BindUnmanagedIpRefToPayloadTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      BindUnmanagedIpRefToPayload binder = new BindUnmanagedIpRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidTypeInput() {
-      BindUnmanagedIpRefToPayload binder = new BindUnmanagedIpRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, new Object());
-   }
-
-   public void testBindUnmanagedNetworkIpRef() throws IOException {
-      VLANNetworkDto network = NetworkResources.unmanagedNetworkPut();
-      RESTLink ipsLink = network.searchLink("ips");
-      BindUnmanagedIpRefToPayload binder = new BindUnmanagedIpRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, network);
-      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ipsLink.getHref()
-            + "\" rel=\"unmanagedip\"/></links>"), LinksDto.class);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindVirtualDatacenterRefToPayloadTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindVirtualDatacenterRefToPayloadTest.java b/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindVirtualDatacenterRefToPayloadTest.java
deleted file mode 100644
index 51a4497..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/binders/cloud/BindVirtualDatacenterRefToPayloadTest.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.cloud;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.abiquo.util.Assert.assertPayloadEquals;
-
-import java.io.IOException;
-import java.net.URI;
-
-import org.jclouds.abiquo.domain.CloudResources;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.xml.internal.JAXBParser;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-
-/**
- * Unit tests for the {@link BindVirtualDatacenterRefToPayload} binder.
- */
-@Test(groups = "unit", testName = "BindVirtualDatacenterRefToPayloadTest")
-public class BindVirtualDatacenterRefToPayloadTest {
-
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testInvalidNullInput() {
-      BindVirtualDatacenterRefToPayload binder = new BindVirtualDatacenterRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testInvalidTypeInput() {
-      BindVirtualDatacenterRefToPayload binder = new BindVirtualDatacenterRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      binder.bindToRequest(request, new Object());
-   }
-
-   public void testBindSingleVolume() throws IOException {
-      VirtualDatacenterDto vdc = CloudResources.virtualDatacenterPut();
-      BindVirtualDatacenterRefToPayload binder = new BindVirtualDatacenterRefToPayload(new JAXBParser("false"));
-      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
-      request = binder.bindToRequest(request, vdc);
-      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + vdc.getEditLink().getHref()
-            + "\" rel=\"virtualdatacenter\"/></links>"), LinksDto.class);
-   }
-}


[07/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/environment/InfrastructureTestEnvironment.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/environment/InfrastructureTestEnvironment.java b/abiquo/src/test/java/org/jclouds/abiquo/environment/InfrastructureTestEnvironment.java
deleted file mode 100644
index c7f455d..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/environment/InfrastructureTestEnvironment.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.environment;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URL;
-import java.nio.charset.Charset;
-import java.util.UUID;
-
-import org.jclouds.abiquo.AbiquoContext;
-import org.jclouds.abiquo.domain.config.License;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.enterprise.Limits;
-import org.jclouds.abiquo.domain.enterprise.Role;
-import org.jclouds.abiquo.domain.enterprise.User;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.infrastructure.Datastore;
-import org.jclouds.abiquo.domain.infrastructure.Machine;
-import org.jclouds.abiquo.domain.infrastructure.NetworkInterface;
-import org.jclouds.abiquo.domain.infrastructure.Rack;
-import org.jclouds.abiquo.domain.infrastructure.RemoteService;
-import org.jclouds.abiquo.domain.infrastructure.StorageDevice;
-import org.jclouds.abiquo.domain.infrastructure.StorageDeviceMetadata;
-import org.jclouds.abiquo.domain.infrastructure.StoragePool;
-import org.jclouds.abiquo.domain.infrastructure.Tier;
-import org.jclouds.abiquo.domain.network.ExternalNetwork;
-import org.jclouds.abiquo.domain.network.NetworkServiceType;
-import org.jclouds.abiquo.domain.network.PublicNetwork;
-import org.jclouds.abiquo.domain.network.UnmanagedNetwork;
-import org.jclouds.abiquo.features.AdminApi;
-import org.jclouds.abiquo.features.ConfigApi;
-import org.jclouds.abiquo.features.EnterpriseApi;
-import org.jclouds.abiquo.features.InfrastructureApi;
-import org.jclouds.abiquo.features.services.AdministrationService;
-import org.jclouds.abiquo.util.Config;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.google.common.base.Predicate;
-import com.google.common.io.LineProcessor;
-import com.google.common.io.Resources;
-
-/**
- * Test environment for infrastructure live tests.
- */
-public class InfrastructureTestEnvironment implements TestEnvironment {
-   /** The rest context. */
-   public AbiquoContext context;
-
-   // Environment data made public so tests can use them easily
-
-   public AdministrationService administrationService;
-
-   public InfrastructureApi infrastructureApi;
-
-   public EnterpriseApi enterpriseApi;
-
-   public AdminApi adminApi;
-
-   public ConfigApi configApi;
-
-   // Resources
-
-   public License license;
-
-   public Datacenter datacenter;
-
-   public PublicNetwork publicNetwork;
-
-   public ExternalNetwork externalNetwork;
-
-   public UnmanagedNetwork unmanagedNetwork;
-
-   public Iterable<RemoteService> remoteServices;
-
-   public Rack rack;
-
-   public Machine machine;
-
-   public Enterprise enterprise;
-
-   public StorageDevice storageDevice;
-
-   public StoragePool storagePool;
-
-   public Tier tier;
-
-   public User user;
-
-   public User enterpriseAdmin;
-
-   public Role role;
-
-   public Role anotherRole;
-
-   public InfrastructureTestEnvironment(final AbiquoContext context) {
-      super();
-      this.context = context;
-      this.administrationService = context.getAdministrationService();
-      this.context = context;
-      this.enterpriseApi = context.getApiContext().getApi().getEnterpriseApi();
-      this.infrastructureApi = context.getApiContext().getApi().getInfrastructureApi();
-      this.adminApi = context.getApiContext().getApi().getAdminApi();
-      this.configApi = context.getApiContext().getApi().getConfigApi();
-   }
-
-   @Override
-   public void setup() throws Exception {
-      // Configuration
-      createLicense();
-
-      // Intrastructure
-      createDatacenter();
-      createRack();
-      createMachine();
-      createStorageDevice();
-      createStoragePool();
-      createPublicNetwork();
-
-      // Enterprise
-      createEnterprise();
-      createRoles();
-      createUsers();
-
-      // Networking
-      createExternalNetwork();
-      createUnmanagedNetwork();
-   }
-
-   @Override
-   public void tearDown() throws Exception {
-      deleteUsers();
-
-      deleteRole(role);
-      deleteRole(anotherRole);
-
-      deleteUnmanagedNetwork();
-      deleteExternalNetwork();
-      deletePublicNetwork();
-      deleteStoragePool();
-      deleteStorageDevice();
-      deleteMachine();
-      deleteRack();
-      deleteDatacenter();
-      deleteEnterprise();
-
-      deleteLicense();
-   }
-
-   // Setup
-
-   protected void createLicense() throws IOException {
-      license = License.builder(context.getApiContext(), readLicense()).build();
-
-      license.add();
-      assertNotNull(license.getId());
-   }
-
-   protected void createDatacenter() {
-      // Assume a monolithic install
-      URI endpoint = URI.create(context.getApiContext().getProviderMetadata().getEndpoint());
-      String remoteServicesAddress = endpoint.getHost();
-
-      datacenter = Datacenter.builder(context.getApiContext()).name(randomName()).location("Honolulu")
-            .remoteServices(remoteServicesAddress).build();
-      datacenter.save();
-      assertNotNull(datacenter.getId());
-
-      remoteServices = datacenter.listRemoteServices();
-      assertEquals(size(remoteServices), 7);
-   }
-
-   protected void createMachine() {
-      String ip = Config.get("abiquo.hypervisor.address");
-      HypervisorType type = HypervisorType.valueOf(Config.get("abiquo.hypervisor.type"));
-      String user = Config.get("abiquo.hypervisor.user");
-      String pass = Config.get("abiquo.hypervisor.pass");
-      final String vswitchName = Config.get("abiquo.hypervisor.vswitch");
-      final String datastoreName = Config.get("abiquo.hypervisor.datastore");
-
-      machine = datacenter.discoverSingleMachine(ip, type, user, pass);
-
-      NetworkServiceType nst = datacenter.defaultNetworkServiceType();
-      NetworkInterface vswitch = find(machine.getNetworkInterfaces(), new Predicate<NetworkInterface>() {
-         @Override
-         public boolean apply(NetworkInterface input) {
-            return input.getName().equals(vswitchName);
-         }
-      });
-      vswitch.setNetworkServiceType(nst);
-
-      Datastore datastore = find(machine.getDatastores(), new Predicate<Datastore>() {
-         @Override
-         public boolean apply(Datastore input) {
-            return input.getName().equals(datastoreName);
-         }
-      });
-      datastore.setEnabled(true);
-
-      machine.setRack(rack);
-      machine.save();
-      assertNotNull(machine.getId());
-   }
-
-   protected void createRack() {
-      rack = Rack.builder(context.getApiContext(), datacenter).name(PREFIX + "Aloha").build();
-      rack.save();
-      assertNotNull(rack.getId());
-   }
-
-   protected void createStorageDevice() {
-      String ip = Config.get("abiquo.storage.address");
-      final String type = Config.get("abiquo.storage.type");
-      String user = Config.get("abiquo.storage.user");
-      String pass = Config.get("abiquo.storage.pass");
-
-      Iterable<StorageDeviceMetadata> devices = datacenter.listSupportedStorageDevices();
-      StorageDeviceMetadata metadata = find(devices, new Predicate<StorageDeviceMetadata>() {
-         @Override
-         public boolean apply(StorageDeviceMetadata input) {
-            return input.getType().equals(type);
-         }
-      });
-
-      storageDevice = StorageDevice.builder(context.getApiContext(), datacenter) //
-            .name(PREFIX + "Storage Device")//
-            .type(type)//
-            .managementIp(ip).managementPort(metadata.getDefaultManagementPort())//
-            .iscsiIp(ip).iscsiPort(metadata.getDefaultIscsiPort()) //
-            .username(user)//
-            .password(pass) //
-            .build();
-
-      storageDevice.save();
-      assertNotNull(storageDevice.getId());
-   }
-
-   protected void createStoragePool() {
-      final String pool = Config.get("abiquo.storage.pool");
-
-      storagePool = find(storageDevice.listRemoteStoragePools(), new Predicate<StoragePool>() {
-         @Override
-         public boolean apply(StoragePool input) {
-            return input.getName().equals(pool);
-         }
-      });
-      tier = find(datacenter.listTiers(), new Predicate<Tier>() {
-         @Override
-         public boolean apply(Tier input) {
-            return input.getName().equals("Default Tier 1");
-         }
-      });
-
-      storagePool.setTier(tier);
-      storagePool.save();
-
-      assertNotNull(storagePool.getUUID());
-   }
-
-   protected void createUsers() {
-      Iterable<Role> roles = administrationService.listRoles();
-      Role userRole = find(roles, role("USER"));
-      Role enterpriseAdminRole = find(roles, role("ENTERPRISE_ADMIN"));
-
-      user = User.builder(context.getApiContext(), enterprise, userRole).name(randomName(), randomName())
-            .nick("jclouds").authType("ABIQUO").description(randomName()).email(randomName() + "@abiquo.com")
-            .locale("en_US").password("user").build();
-
-      user.save();
-      assertNotNull(user.getId());
-      assertEquals(userRole.getId(), user.getRole().getId());
-
-      enterpriseAdmin = User.builder(context.getApiContext(), enterprise, enterpriseAdminRole)
-            .name(randomName(), randomName()).nick("jclouds-admin").authType("ABIQUO").description(randomName())
-            .email(randomName() + "@abiquo.com").locale("en_US").password("admin").build();
-
-      enterpriseAdmin.save();
-      assertNotNull(enterpriseAdmin.getId());
-      assertEquals(enterpriseAdminRole.getId(), enterpriseAdmin.getRole().getId());
-   }
-
-   protected void createRoles() {
-      role = Role.builder(context.getApiContext()).name(randomName()).blocked(false).build();
-      role.save();
-
-      anotherRole = Role.Builder.fromRole(role).build();
-      anotherRole.setName("Another role");
-      anotherRole.save();
-
-      assertNotNull(role.getId());
-      assertNotNull(anotherRole.getId());
-   }
-
-   protected void createEnterprise() {
-      enterprise = Enterprise.builder(context.getApiContext()).name(randomName()).build();
-      enterprise.save();
-      assertNotNull(enterprise.getId());
-      Limits limits = enterprise.allowDatacenter(datacenter);
-      assertNotNull(limits);
-   }
-
-   protected void createPublicNetwork() {
-      publicNetwork = PublicNetwork.builder(context.getApiContext(), datacenter).name("PublicNetwork")
-            .gateway("80.80.80.1").address("80.80.80.0").mask(24).tag(5).build();
-      publicNetwork.save();
-      assertNotNull(publicNetwork.getId());
-   }
-
-   protected void createExternalNetwork() {
-      externalNetwork = ExternalNetwork.builder(context.getApiContext(), datacenter, enterprise)
-            .name("ExternalNetwork").gateway("10.0.0.1").address("10.0.0.0").mask(24).tag(7).build();
-      externalNetwork.save();
-      assertNotNull(externalNetwork.getId());
-   }
-
-   protected void createUnmanagedNetwork() {
-      unmanagedNetwork = UnmanagedNetwork.builder(context.getApiContext(), datacenter, enterprise)
-            .name("UnmanagedNetwork").gateway("10.0.1.1").address("10.0.1.0").mask(24).tag(8).build();
-      unmanagedNetwork.save();
-      assertNotNull(unmanagedNetwork.getId());
-   }
-
-   // Tear down
-
-   protected void deleteUnmanagedNetwork() {
-      if (unmanagedNetwork != null) {
-         Integer id = unmanagedNetwork.getId();
-         unmanagedNetwork.delete();
-         assertNull(datacenter.getNetwork(id));
-      }
-   }
-
-   protected void deleteExternalNetwork() {
-      if (externalNetwork != null) {
-         Integer id = externalNetwork.getId();
-         externalNetwork.delete();
-         assertNull(datacenter.getNetwork(id));
-      }
-   }
-
-   protected void deletePublicNetwork() {
-      if (publicNetwork != null) {
-         Integer id = publicNetwork.getId();
-         publicNetwork.delete();
-         assertNull(datacenter.getNetwork(id));
-      }
-   }
-
-   protected void deleteUsers() {
-      if (user != null) {
-         String nick = user.getNick();
-         user.delete();
-         // Nick is unique in an enterprise
-         assertNull(find(enterprise.listUsers(), nick(nick), null));
-      }
-
-      if (enterpriseAdmin != null) {
-         String nick = enterpriseAdmin.getNick();
-         enterpriseAdmin.delete();
-         // Nick is unique in an enterprise
-         assertNull(find(enterprise.listUsers(), nick(nick), null));
-      }
-   }
-
-   protected void deleteRole(final Role role) {
-      if (role != null) {
-         Integer roleId = role.getId();
-         role.delete();
-         assertNull(adminApi.getRole(roleId));
-      }
-   }
-
-   protected void deleteStoragePool() {
-      if (storagePool != null) {
-         String idStoragePool = storagePool.getUUID();
-         storagePool.delete();
-         assertNull(infrastructureApi.getStoragePool(storageDevice.unwrap(), idStoragePool));
-      }
-
-   }
-
-   protected void deleteStorageDevice() {
-      if (storageDevice != null) {
-         Integer idStorageDevice = storageDevice.getId();
-         storageDevice.delete();
-         assertNull(infrastructureApi.getStorageDevice(datacenter.unwrap(), idStorageDevice));
-      }
-   }
-
-   protected void deleteMachine() {
-      if (machine != null && rack != null) {
-         Integer idMachine = machine.getId();
-         machine.delete();
-         assertNull(infrastructureApi.getMachine(rack.unwrap(), idMachine));
-      }
-   }
-
-   protected void deleteRack() {
-      if (rack != null && datacenter != null) {
-         Integer idRack = rack.getId();
-         rack.delete();
-         assertNull(infrastructureApi.getRack(datacenter.unwrap(), idRack));
-      }
-   }
-
-   protected void deleteDatacenter() {
-      if (datacenter != null) {
-         // Remove limits first
-         enterprise.prohibitDatacenter(datacenter);
-
-         Integer idDatacenter = datacenter.getId();
-         datacenter.delete(); // Abiquo API will delete remote services too
-         assertNull(infrastructureApi.getDatacenter(idDatacenter));
-      }
-   }
-
-   protected void deleteEnterprise() {
-      if (enterprise != null) {
-         Integer idEnterprise = enterprise.getId();
-         enterprise.delete();
-         assertNull(enterpriseApi.getEnterprise(idEnterprise));
-      }
-   }
-
-   protected void deleteLicense() {
-      license.remove();
-   }
-
-   protected static String randomName() {
-      return PREFIX + UUID.randomUUID().toString().substring(0, 12);
-   }
-
-   // Utility methods
-
-   public static String readLicense() throws IOException {
-      URL url = CloudTestEnvironment.class.getResource("/license/expired");
-      return Resources.readLines(url, Charset.defaultCharset(), new LineProcessor<String>() {
-         StringBuilder sb = new StringBuilder();
-
-         @Override
-         public String getResult() {
-            return sb.toString();
-         }
-
-         @Override
-         public boolean processLine(String line) throws IOException {
-            if (!line.startsWith("#")) {
-               sb.append(line);
-            }
-            return true;
-         }
-      });
-   }
-
-   private static Predicate<Role> role(final String role) {
-      return new Predicate<Role>() {
-         @Override
-         public boolean apply(Role input) {
-            return input.getName().equals(role);
-         }
-      };
-   }
-
-   private static Predicate<User> nick(final String nick) {
-      return new Predicate<User>() {
-         @Override
-         public boolean apply(User input) {
-            return input.getNick().equals(nick);
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/environment/TestEnvironment.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/environment/TestEnvironment.java b/abiquo/src/test/java/org/jclouds/abiquo/environment/TestEnvironment.java
deleted file mode 100644
index eb165b1..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/environment/TestEnvironment.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.environment;
-
-/**
- * Base class fot test environment populators.
- * <p>
- * This class should be used to populate and clean the test environment used in
- * live tests.
- */
-public interface TestEnvironment {
-   /**
-    * Builds the test environment.
-    */
-   void setup() throws Exception;
-
-   /**
-    * Cleans the test environment.
-    */
-   void tearDown() throws Exception;
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/AppendApiVersionToAbiquoMimeTypeTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/AppendApiVersionToAbiquoMimeTypeTest.java b/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/AppendApiVersionToAbiquoMimeTypeTest.java
deleted file mode 100644
index 141d220..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/AppendApiVersionToAbiquoMimeTypeTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.fallbacks;
-
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.functions.AppendApiVersionToAbiquoMimeType;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Function;
-
-/**
- * Unit tests for the {@link AppendApiVersionToAbiquoMimeType} function.
- */
-@Test(groups = "unit", testName = "AppendApiVersionToAbiquoMimeTypeTest")
-public class AppendApiVersionToAbiquoMimeTypeTest {
-   @Test(expectedExceptions = NullPointerException.class)
-   public void testApplyWithNullInput() {
-      Function<String, String> function = new AppendApiVersionToAbiquoMimeType(AbiquoApi.API_VERSION);
-      function.apply(null);
-   }
-
-   @Test(expectedExceptions = IllegalArgumentException.class)
-   public void testApplyWithInvalidMediaType() {
-      Function<String, String> function = new AppendApiVersionToAbiquoMimeType(AbiquoApi.API_VERSION);
-      function.apply("foo");
-   }
-
-   public void testApplyToStandardMediaType() {
-      Function<String, String> function = new AppendApiVersionToAbiquoMimeType(AbiquoApi.API_VERSION);
-      assertEquals(function.apply("application/xml"), "application/xml");
-   }
-
-   public void testApplyToAbiquoMediaTypeWithVersion() {
-      Function<String, String> function = new AppendApiVersionToAbiquoMimeType(AbiquoApi.API_VERSION);
-      assertEquals(function.apply("application/vnd.abiquo.datacenters+xml;version=1.8.5"),
-            "application/vnd.abiquo.datacenters+xml;version=1.8.5");
-   }
-
-   public void testApplyToAbiquoMediaTypeWithoutVersion() {
-      Function<String, String> function = new AppendApiVersionToAbiquoMimeType(AbiquoApi.API_VERSION);
-      assertEquals(function.apply("application/vnd.abiquo.datacenters+xml"),
-            "application/vnd.abiquo.datacenters+xml;version=" + AbiquoApi.API_VERSION);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/FalseIfNotAvailableTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/FalseIfNotAvailableTest.java b/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/FalseIfNotAvailableTest.java
deleted file mode 100644
index 8566e0d..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/FalseIfNotAvailableTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.fallbacks;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.AbiquoFallbacks.FalseIfNotAvailable;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.HttpResponseException;
-import org.jclouds.rest.ResourceNotFoundException;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link FalseIfNotAvailable} function.
- */
-@Test(groups = "unit", testName = "FalseIfNotAvailableTest")
-public class FalseIfNotAvailableTest {
-   public void testOriginalExceptionIfUnknownException() {
-      FalseIfNotAvailable function = new FalseIfNotAvailable();
-      RuntimeException exception = new RuntimeException();
-
-      try {
-         function.createOrPropagate(exception);
-      } catch (Exception ex) {
-         assertEquals(ex, exception);
-      }
-   }
-
-   public void testFalseIf5xx() throws Exception {
-      FalseIfNotAvailable function = new FalseIfNotAvailable();
-      HttpResponse response = EasyMock.createMock(HttpResponse.class);
-      HttpResponseException exception = EasyMock.createMock(HttpResponseException.class);
-
-      // Status code is called twice
-      expect(response.getStatusCode()).andReturn(503);
-      expect(response.getStatusCode()).andReturn(503);
-      // Get response gets called twice
-      expect(exception.getResponse()).andReturn(response);
-      expect(exception.getResponse()).andReturn(response);
-      // Get cause is called to determine the root cause
-      expect(exception.getCause()).andReturn(null);
-
-      replay(response);
-      replay(exception);
-
-      assertFalse(function.createOrPropagate(exception));
-
-      verify(response);
-      verify(exception);
-   }
-
-   public void testExceptionIfNot5xx() {
-      FalseIfNotAvailable function = new FalseIfNotAvailable();
-      HttpResponse response = EasyMock.createMock(HttpResponse.class);
-      HttpResponseException exception = EasyMock.createMock(HttpResponseException.class);
-
-      // Status code is called twice
-      expect(response.getStatusCode()).andReturn(600);
-      expect(response.getStatusCode()).andReturn(600);
-      // Get response gets called twice
-      expect(exception.getResponse()).andReturn(response);
-      expect(exception.getResponse()).andReturn(response);
-      // Get cause is called to determine the root cause
-      expect(exception.getCause()).andReturn(null);
-
-      replay(response);
-      replay(exception);
-
-      try {
-         function.createOrPropagate(exception);
-      } catch (Exception ex) {
-         assertEquals(ex, exception);
-      }
-
-      verify(response);
-      verify(exception);
-   }
-
-   public void testFalseIfResourceNotFound() throws Exception {
-      FalseIfNotAvailable function = new FalseIfNotAvailable();
-      ResourceNotFoundException exception = new ResourceNotFoundException();
-
-      assertFalse(function.createOrPropagate(exception));
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/FalseOn5xxTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/FalseOn5xxTest.java b/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/FalseOn5xxTest.java
deleted file mode 100644
index 111cfeb..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/FalseOn5xxTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.fallbacks;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.AbiquoFallbacks.FalseOn5xx;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.HttpResponseException;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link FalseOn5xx} function.
- */
-@Test(groups = "unit", testName = "FalseOn5xxTest")
-public class FalseOn5xxTest {
-   public void testOriginalExceptionIfNotHttpResponseException() {
-      FalseOn5xx function = new FalseOn5xx();
-      RuntimeException exception = new RuntimeException();
-
-      try {
-         function.createOrPropagate(exception);
-      } catch (Exception ex) {
-         assertEquals(ex, exception);
-      }
-   }
-
-   public void testFalseIf5xx() throws Exception {
-      FalseOn5xx function = new FalseOn5xx();
-      HttpResponse response = EasyMock.createMock(HttpResponse.class);
-      HttpResponseException exception = EasyMock.createMock(HttpResponseException.class);
-
-      // Status code is called twice
-      expect(response.getStatusCode()).andReturn(503);
-      expect(response.getStatusCode()).andReturn(503);
-      // Get response gets called twice
-      expect(exception.getResponse()).andReturn(response);
-      expect(exception.getResponse()).andReturn(response);
-      // Get cause is called to determine the root cause
-      expect(exception.getCause()).andReturn(null);
-
-      replay(response);
-      replay(exception);
-
-      assertFalse(function.createOrPropagate(exception));
-
-      verify(response);
-      verify(exception);
-   }
-
-   public void testExceptionIfNot5xx() {
-      FalseOn5xx function = new FalseOn5xx();
-      HttpResponse response = EasyMock.createMock(HttpResponse.class);
-      HttpResponseException exception = EasyMock.createMock(HttpResponseException.class);
-
-      // Status code is called twice
-      expect(response.getStatusCode()).andReturn(600);
-      expect(response.getStatusCode()).andReturn(600);
-      // Get response gets called twice
-      expect(exception.getResponse()).andReturn(response);
-      expect(exception.getResponse()).andReturn(response);
-      // Get cause is called to determine the root cause
-      expect(exception.getCause()).andReturn(null);
-
-      replay(response);
-      replay(exception);
-
-      try {
-         function.createOrPropagate(exception);
-      } catch (Exception ex) {
-         assertEquals(ex, exception);
-      }
-
-      verify(response);
-      verify(exception);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/MovedVolumeTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/MovedVolumeTest.java b/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/MovedVolumeTest.java
deleted file mode 100644
index 8d372fa..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/MovedVolumeTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.fallbacks;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.testng.Assert.assertEquals;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.fallbacks.MovedVolume.ReturnMoveVolumeReference;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.HttpResponseException;
-import org.jclouds.io.Payload;
-import org.jclouds.io.Payloads;
-import org.jclouds.xml.internal.JAXBParser;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.infrastructure.storage.MovedVolumeDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.google.common.io.ByteSource;
-import com.google.inject.TypeLiteral;
-
-/**
- * Unit tests for the {@link MovedVolume} function.
- */
-@Test(groups = "unit", testName = "MovedVolumeTest")
-public class MovedVolumeTest {
-   public void testReturnOriginalExceptionIfNotHttpResponseException() {
-      MovedVolume function = new MovedVolume(new ReturnMoveVolumeReference(new JAXBParser("false"),
-            TypeLiteral.get(MovedVolumeDto.class)));
-
-      RuntimeException exception = new RuntimeException();
-
-      try {
-         function.createOrPropagate(exception);
-      } catch (Exception ex) {
-         assertEquals(ex, exception);
-      }
-   }
-
-   public void testReturnVolume() throws Exception {
-      JAXBParser xmlParser = new JAXBParser("false");
-      MovedVolume function = new MovedVolume(new ReturnMoveVolumeReference(new JAXBParser("false"),
-            TypeLiteral.get(MovedVolumeDto.class)));
-
-      VolumeManagementDto volume = new VolumeManagementDto();
-      volume.setName("Test volume");
-      MovedVolumeDto movedRef = new MovedVolumeDto();
-      movedRef.setVolume(volume);
-
-      HttpResponse response = EasyMock.createMock(HttpResponse.class);
-      HttpResponseException exception = EasyMock.createMock(HttpResponseException.class);
-      Payload payload = Payloads.newByteSourcePayload(ByteSource.wrap(xmlParser.toXML(movedRef).getBytes()));
-
-      // Status code is called once
-      expect(response.getStatusCode()).andReturn(Status.MOVED_PERMANENTLY.getStatusCode());
-      // Get response gets called twice
-      expect(exception.getResponse()).andReturn(response);
-      expect(exception.getResponse()).andReturn(response);
-      // Get payload is called three times: one to deserialize it, and twice to
-      // release it
-      expect(response.getPayload()).andReturn(payload);
-      expect(response.getPayload()).andReturn(payload);
-      expect(response.getPayload()).andReturn(payload);
-      // Get cause is called to determine the root cause
-      expect(exception.getCause()).andReturn(null);
-
-      replay(response);
-      replay(exception);
-
-      function.createOrPropagate(exception);
-
-      verify(response);
-      verify(exception);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/NullOn303Test.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/NullOn303Test.java b/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/NullOn303Test.java
deleted file mode 100644
index 6e6cda0..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/NullOn303Test.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.fallbacks;
-
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-
-import org.easymock.EasyMock;
-import org.jclouds.abiquo.AbiquoFallbacks.NullOn303;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.HttpResponseException;
-import org.testng.annotations.Test;
-
-/**
- * Unit tests for the {@link NullOn303} function.
- */
-@Test(groups = "unit", testName = "NullOn303Test")
-public class NullOn303Test {
-   public void testOriginalExceptionIfNotHttpResponseException() {
-      NullOn303 function = new NullOn303();
-      RuntimeException exception = new RuntimeException();
-
-      try {
-         function.createOrPropagate(exception);
-      } catch (Exception ex) {
-         assertEquals(ex, exception);
-      }
-   }
-
-   public void testNullIf303() throws Exception {
-      NullOn303 function = new NullOn303();
-      HttpResponse response = EasyMock.createMock(HttpResponse.class);
-      HttpResponseException exception = EasyMock.createMock(HttpResponseException.class);
-
-      // Status code is called once
-      expect(response.getStatusCode()).andReturn(303);
-      // Get response gets called twice
-      expect(exception.getResponse()).andReturn(response);
-      expect(exception.getResponse()).andReturn(response);
-      // Get cause is called to determine the root cause
-      expect(exception.getCause()).andReturn(null);
-
-      replay(response);
-      replay(exception);
-
-      assertNull(function.createOrPropagate(exception));
-
-      verify(response);
-      verify(exception);
-   }
-
-   public void testExceptionIfNot303() {
-      NullOn303 function = new NullOn303();
-      HttpResponse response = EasyMock.createMock(HttpResponse.class);
-      HttpResponseException exception = EasyMock.createMock(HttpResponseException.class);
-
-      // Status code is called once
-      expect(response.getStatusCode()).andReturn(600);
-      // Get response gets called twice
-      expect(exception.getResponse()).andReturn(response);
-      expect(exception.getResponse()).andReturn(response);
-      // Get cause is called to determine the root cause
-      expect(exception.getCause()).andReturn(null);
-
-      replay(response);
-      replay(exception);
-
-      try {
-         function.createOrPropagate(exception);
-      } catch (Exception ex) {
-         assertEquals(ex, exception);
-      }
-
-      verify(response);
-      verify(exception);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/PropagateAbiquoExceptionOnNotFoundOr4xxTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/PropagateAbiquoExceptionOnNotFoundOr4xxTest.java b/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/PropagateAbiquoExceptionOnNotFoundOr4xxTest.java
deleted file mode 100644
index ecb472a..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/fallbacks/PropagateAbiquoExceptionOnNotFoundOr4xxTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.fallbacks;
-
-import static org.testng.Assert.assertEquals;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.AbiquoFallbacks.PropagateAbiquoExceptionOnNotFoundOr4xx;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.rest.ResourceNotFoundException;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.transport.error.ErrorsDto;
-
-/**
- * Unit tests for the {@link PropagateAbiquoExceptionOnNotFoundOr4xx} function.
- */
-@Test(groups = "unit", testName = "PropagateAbiquoExceptionOnNotFoundOr4xxTest")
-public class PropagateAbiquoExceptionOnNotFoundOr4xxTest {
-   public void testOriginalExceptionIfNotResourceNotFound() {
-      PropagateAbiquoExceptionOnNotFoundOr4xx function = new PropagateAbiquoExceptionOnNotFoundOr4xx();
-      RuntimeException exception = new RuntimeException();
-
-      try {
-         function.createOrPropagate(exception);
-      } catch (Exception ex) {
-         assertEquals(ex, exception);
-      }
-   }
-
-   public void testOriginalExceptionIfNotAbiquoException() {
-      PropagateAbiquoExceptionOnNotFoundOr4xx function = new PropagateAbiquoExceptionOnNotFoundOr4xx();
-      ResourceNotFoundException exception = new ResourceNotFoundException();
-
-      try {
-         function.createOrPropagate(exception);
-      } catch (Exception ex) {
-         assertEquals(ex, exception);
-      }
-   }
-
-   public void testAbiquoException() {
-      PropagateAbiquoExceptionOnNotFoundOr4xx function = new PropagateAbiquoExceptionOnNotFoundOr4xx();
-      AbiquoException abiquoException = new AbiquoException(Status.NOT_FOUND, new ErrorsDto());
-      ResourceNotFoundException exception = new ResourceNotFoundException(abiquoException);
-
-      try {
-         function.createOrPropagate(exception);
-      } catch (Exception ex) {
-         assertEquals(ex, abiquoException);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/AdminApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/AdminApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/AdminApiTest.java
deleted file mode 100644
index dd2b91a..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/AdminApiTest.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.reflect.Reflection2.method;
-
-import java.io.IOException;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.domain.AdminResources;
-import org.jclouds.abiquo.domain.EnterpriseResources;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.http.functions.ReleasePayloadAndReturn;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.enterprise.PrivilegesDto;
-import com.abiquo.server.core.enterprise.RoleDto;
-import com.abiquo.server.core.enterprise.RolesDto;
-import com.abiquo.server.core.enterprise.UserDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Tests annotation parsing of {@code AdminApi}
- */
-@Test(groups = "unit", testName = "AdminApiTest")
-public class AdminApiTest extends BaseAbiquoApiTest<AdminApi> {
-   /*********************** Role ***********************/
-
-   public void testListRoles() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(AdminApi.class, "listRoles");
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.of()));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/roles HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RolesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetRoleFromUser() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(AdminApi.class, "getRole", UserDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.userPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/roles/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RoleDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testCreateRole() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(AdminApi.class, "createRole", RoleDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(AdminResources.rolePost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/roles HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RoleDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(AdminResources.rolePostPayload()), RoleDto.class,
-            RoleDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteRole() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(AdminApi.class, "deleteRole", RoleDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(AdminResources.rolePut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/roles/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateRole() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(AdminApi.class, "updateRole", RoleDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(AdminResources.rolePut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/roles/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RoleDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(AdminResources.rolePutPayload()), RoleDto.class, RoleDto.BASE_MEDIA_TYPE,
-            false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetRoleById() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(AdminApi.class, "getRole", Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/roles/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + RoleDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testListPrivilegesByRoles() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(AdminApi.class, "listPrivileges", RoleDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(AdminResources.rolePut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/roles/1/action/privileges HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + PrivilegesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Current User **********************/
-
-   public void testGetCurrentUser() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(AdminApi.class, "getCurrentUser");
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/login HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + UserDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/BaseAbiquoApiExpectTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/BaseAbiquoApiExpectTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/BaseAbiquoApiExpectTest.java
deleted file mode 100644
index a9c242c..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/BaseAbiquoApiExpectTest.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import java.util.Properties;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.AbiquoApiMetadata;
-import org.jclouds.abiquo.functions.auth.GetTokenFromApi;
-import org.jclouds.apis.ApiMetadata;
-import org.jclouds.domain.Credentials;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.rest.HttpClient;
-import org.jclouds.rest.internal.BaseRestApiExpectTest;
-
-import com.google.common.base.Function;
-import com.google.inject.AbstractModule;
-import com.google.inject.Module;
-
-/**
- * Base class for Abiquo expect tests.
- */
-public abstract class BaseAbiquoApiExpectTest<S> extends BaseRestApiExpectTest<S> {
-   protected final String tokenAuth = "auth=mock-token";
-
-   public BaseAbiquoApiExpectTest() {
-      provider = "abiquo";
-   }
-
-   @Override
-   protected ApiMetadata createApiMetadata() {
-      return new AbiquoApiMetadata();
-   }
-
-   @Override
-   protected Module createModule() {
-      return new AbstractModule() {
-         @Override
-         protected void configure() {
-            bind(GetTokenFromApi.class).to(MockTokenFromApi.class);
-         }
-      };
-   }
-
-   @Override
-   public S createClient(final Function<HttpRequest, HttpResponse> fn, final Module module, final Properties props) {
-      return clientFrom(createInjector(fn, module, props).getInstance(AbiquoApi.class));
-   }
-
-   protected abstract S clientFrom(AbiquoApi api);
-
-   protected String normalize(final String mediatType) {
-      return MediaType.valueOf(mediatType).toString();
-   }
-
-   @Singleton
-   private static class MockTokenFromApi extends GetTokenFromApi {
-      @Inject
-      public MockTokenFromApi(ProviderMetadata provider, HttpClient http) {
-         super(provider, http);
-      }
-
-      @Override
-      public String apply(Credentials input) {
-         return "mock-token";
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/BaseAbiquoApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/BaseAbiquoApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/BaseAbiquoApiTest.java
deleted file mode 100644
index 6f2adf0..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/BaseAbiquoApiTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.jclouds.Constants.PROPERTY_PRETTY_PRINT_PAYLOADS;
-import static org.testng.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import org.jclouds.abiquo.AbiquoApiMetadata;
-import org.jclouds.abiquo.config.AbiquoHttpApiModule;
-import org.jclouds.abiquo.http.filters.AbiquoAuthentication;
-import org.jclouds.abiquo.http.filters.AppendApiVersionToMediaType;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.providers.AnonymousProviderMetadata;
-import org.jclouds.providers.ProviderMetadata;
-import org.jclouds.rest.internal.BaseRestAnnotationProcessingTest;
-import org.jclouds.xml.XMLParser;
-import org.testng.annotations.BeforeClass;
-
-import com.abiquo.model.transport.SingleResourceTransportDto;
-import com.google.inject.Module;
-
-/**
- * Base class for Abiquo api tests.
- */
-public abstract class BaseAbiquoApiTest<T> extends BaseRestAnnotationProcessingTest<T> {
-   private XMLParser xml;
-
-   @BeforeClass
-   @Override
-   protected void setupFactory() throws IOException {
-      super.setupFactory();
-      xml = injector.getInstance(XMLParser.class);
-   }
-
-   @Override
-   protected void checkFilters(final HttpRequest request) {
-      assertEquals(request.getFilters().size(), 2);
-      assertEquals(request.getFilters().get(0).getClass(), AbiquoAuthentication.class);
-      assertEquals(request.getFilters().get(1).getClass(), AppendApiVersionToMediaType.class);
-   }
-
-   @Override
-   protected Module createModule() {
-      return new AbiquoHttpApiModule();
-   }
-
-   @Override
-   protected ProviderMetadata createProviderMetadata() {
-      return AnonymousProviderMetadata.forApiWithEndpoint(new AbiquoApiMetadata(), "http://localhost/api");
-   }
-
-   @Override
-   protected Properties setupProperties() {
-      Properties props = super.setupProperties();
-      // Do not pretty print payloads in tests
-      props.setProperty(PROPERTY_PRETTY_PRINT_PAYLOADS, "false");
-      return props;
-   }
-
-   protected void assertPayloadEquals(final HttpRequest request, final String toMatch,
-         final Class<? extends SingleResourceTransportDto> entityClass, final String contentType,
-         final boolean contentMD5) throws IOException {
-      // Make sure we don't have formatting issues
-      SingleResourceTransportDto entity = xml.fromXML(toMatch, entityClass);
-      String stringToMatch = xml.toXML(entity, entityClass);
-
-      super.assertPayloadEquals(request, stringToMatch, contentType, contentMD5);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/CloudApiExpectTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/CloudApiExpectTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/CloudApiExpectTest.java
deleted file mode 100644
index 6a05030..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/CloudApiExpectTest.java
+++ /dev/null
@@ -1,590 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jclouds.abiquo.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineOptions;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineTemplateOptions;
-import org.jclouds.abiquo.domain.cloud.options.VolumeOptions;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplatesDto;
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.cloud.VirtualMachineDto;
-import com.abiquo.server.core.cloud.VirtualMachineInstanceDto;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpsDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpsDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.abiquo.server.core.infrastructure.storage.VolumesManagementDto;
-
-/**
- * Expect tests for the {@link CloudApi} class.
- */
-@Test(groups = "unit", testName = "CloudApiExpectTest")
-public class CloudApiExpectTest extends BaseAbiquoApiExpectTest<CloudApi> {
-
-   public void testListAllVirtualMachinesWhenResponseIs2xx() {
-      CloudApi api = requestsSendResponses(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualmachines")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/all-vms.xml",
-                              normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualmachines")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "2").build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/all-vms-lastpage.xml",
-                              normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE))) //
-                  .build());
-
-      PagedIterable<VirtualMachineWithNodeExtendedDto> result = api.listAllVirtualMachines();
-      List<VirtualMachineWithNodeExtendedDto> vms = result.concat().toList();
-
-      assertEquals(vms.size(), 2);
-      assertEquals(vms.get(0).getId(), Integer.valueOf(1));
-      assertEquals(vms.get(1).getId(), Integer.valueOf(2));
-      assertEquals(vms.get(0).getName(), "VM");
-      assertNotNull(vms.get(0).getEditLink());
-   }
-
-   public void testListAllVirtualMachinesWithPagination() {
-      CloudApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualmachines")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "2").build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/all-vms-lastpage.xml",
-                              normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualMachineOptions options = VirtualMachineOptions.builder().startWith(2).build();
-      PaginatedCollection<VirtualMachineWithNodeExtendedDto, VirtualMachinesWithNodeExtendedDto> vms = api
-            .listAllVirtualMachines(options);
-
-      assertEquals(vms.size(), 1);
-      assertEquals(vms.getTotalSize().intValue(), 2);
-      assertEquals(vms.get(0).getId().intValue(), 2);
-   }
-
-   public void testListVirtualMachinesWhenResponseIs2xx() {
-      CloudApi api = requestsSendResponses(
-            HttpRequest.builder() //
-                  .method("GET")
-                  //
-                  .endpoint(
-                        URI.create("http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/vms-page.xml",
-                              normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder() //
-                  .method("GET")
-                  //
-                  .endpoint(
-                        URI.create("http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "2").build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/vms-lastpage.xml",
-                              normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualApplianceDto vapp = new VirtualApplianceDto();
-      vapp.addLink(new RESTLink("virtualmachines",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines"));
-
-      PagedIterable<VirtualMachineWithNodeExtendedDto> result = api.listVirtualMachines(vapp);
-      List<VirtualMachineWithNodeExtendedDto> vms = result.concat().toList();
-
-      assertEquals(vms.size(), 2);
-      assertEquals(vms.get(0).getId(), Integer.valueOf(1));
-      assertEquals(vms.get(1).getId(), Integer.valueOf(2));
-      assertEquals(vms.get(0).getName(), "VM");
-      assertNotNull(vms.get(0).getEditLink());
-   }
-
-   public void testLisVirtualMachinesWithPagination() {
-      CloudApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET")
-                  //
-                  .endpoint(
-                        URI.create("http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "2").build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/vms-lastpage.xml",
-                              normalize(VirtualMachinesWithNodeExtendedDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualApplianceDto vapp = new VirtualApplianceDto();
-      vapp.addLink(new RESTLink("virtualmachines",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines"));
-
-      VirtualMachineOptions options = VirtualMachineOptions.builder().startWith(2).build();
-      PaginatedCollection<VirtualMachineWithNodeExtendedDto, VirtualMachinesWithNodeExtendedDto> vms = api
-            .listVirtualMachines(vapp, options);
-
-      assertEquals(vms.size(), 1);
-      assertEquals(vms.getTotalSize().intValue(), 2);
-      assertEquals(vms.get(0).getId().intValue(), 2);
-   }
-
-   public void testSnapshotVirtualMachineReturns2xx() {
-      CloudApi api = requestSendsResponse(
-            HttpRequest
-                  .builder()
-                  .method("POST")
-                  .endpoint(
-                        URI.create("http://localhost/api/admin/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/instance")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(AcceptedRequestDto.MEDIA_TYPE)) //
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/vm-snapshot.xml",
-                              normalize(VirtualMachineInstanceDto.MEDIA_TYPE))) //
-                  .build(), //
-            HttpResponse
-                  .builder()
-                  .statusCode(202)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/vm-accepted-request.xml",
-                              normalize(VirtualMachineInstanceDto.MEDIA_TYPE))).build());
-
-      VirtualMachineDto vm = new VirtualMachineDto();
-      vm.addLink(new RESTLink("instance",
-            "http://localhost/api/admin/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/instance"));
-      VirtualMachineInstanceDto snapshotConfig = new VirtualMachineInstanceDto();
-      snapshotConfig.setInstanceName("foo");
-
-      AcceptedRequestDto<String> taskRef = api.snapshotVirtualMachine(vm, snapshotConfig);
-      assertNotNull(taskRef);
-   }
-
-   public void testListAvailablePublicIps() {
-      CloudApi api = requestsSendResponses(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PublicIpsDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/publicips-available-page.xml",
-                              normalize(PublicIpsDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PublicIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "3") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/publicips-available-lastpage.xml",
-                              normalize(PublicIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
-      vdc.addLink(new RESTLink("topurchase", "http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase"));
-
-      PagedIterable<PublicIpDto> publicIps = api.listAvailablePublicIps(vdc);
-      List<PublicIpDto> ips = publicIps.concat().toList();
-
-      assertEquals(ips.size(), 4);
-      assertEquals(ips.get(0).getId().intValue(), 1);
-      assertEquals(ips.get(1).getId().intValue(), 2);
-      assertEquals(ips.get(2).getId().intValue(), 3);
-      assertEquals(ips.get(3).getId().intValue(), 4);
-   }
-
-   public void testListAvailablePublicIpsWithPagination() {
-      CloudApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PublicIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "3") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/publicips-available-lastpage.xml",
-                              normalize(PublicIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
-      vdc.addLink(new RESTLink("topurchase", "http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase"));
-
-      IpOptions options = IpOptions.builder().startWith(3).build();
-      PaginatedCollection<PublicIpDto, PublicIpsDto> ips = api.listAvailablePublicIps(vdc, options);
-
-      assertEquals(ips.size(), 2);
-      assertEquals(ips.getTotalSize().intValue(), 4);
-      assertEquals(ips.get(0).getId().intValue(), 3);
-      assertEquals(ips.get(1).getId().intValue(), 4);
-   }
-
-   public void testListPurchasedPublicIps() {
-      CloudApi api = requestsSendResponses(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PublicIpsDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/publicips-purchased-page.xml",
-                              normalize(PublicIpsDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PublicIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "3") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/publicips-purchased-lastpage.xml",
-                              normalize(PublicIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
-      vdc.addLink(new RESTLink("purchased", "http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased"));
-
-      PagedIterable<PublicIpDto> publicIps = api.listPurchasedPublicIps(vdc);
-      List<PublicIpDto> ips = publicIps.concat().toList();
-
-      assertEquals(ips.size(), 4);
-      assertEquals(ips.get(0).getId().intValue(), 1);
-      assertEquals(ips.get(1).getId().intValue(), 2);
-      assertEquals(ips.get(2).getId().intValue(), 3);
-      assertEquals(ips.get(3).getId().intValue(), 4);
-   }
-
-   public void testListPurchasedPublicIpsWithPagination() {
-      CloudApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PublicIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "3") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/publicips-purchased-lastpage.xml",
-                              normalize(PublicIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
-      vdc.addLink(new RESTLink("purchased", "http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased"));
-
-      IpOptions options = IpOptions.builder().startWith(3).build();
-      PaginatedCollection<PublicIpDto, PublicIpsDto> ips = api.listPurchasedPublicIps(vdc, options);
-
-      assertEquals(ips.size(), 2);
-      assertEquals(ips.getTotalSize().intValue(), 4);
-      assertEquals(ips.get(0).getId().intValue(), 3);
-      assertEquals(ips.get(1).getId().intValue(), 4);
-   }
-
-   public void testListPrivteIps() {
-      CloudApi api = requestsSendResponses(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PrivateIpsDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/privateips-page.xml",
-                              normalize(PublicIpsDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PrivateIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/privateips-lastpage.xml",
-                              normalize(PrivateIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips"));
-
-      PagedIterable<PrivateIpDto> privateIps = api.listPrivateNetworkIps(vlan);
-      List<PrivateIpDto> ips = privateIps.concat().toList();
-
-      assertEquals(ips.size(), 2);
-      assertEquals(ips.get(0).getId().intValue(), 1);
-      assertEquals(ips.get(1).getId().intValue(), 2);
-   }
-
-   public void testListPrivateIpsWithPagination() {
-      CloudApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PrivateIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/privateips-lastpage.xml",
-                              normalize(PrivateIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips"));
-
-      IpOptions options = IpOptions.builder().startWith(1).build();
-      PaginatedCollection<PrivateIpDto, PrivateIpsDto> ips = api.listPrivateNetworkIps(vlan, options);
-
-      assertEquals(ips.size(), 1);
-      assertEquals(ips.getTotalSize().intValue(), 2);
-      assertEquals(ips.get(0).getId().intValue(), 2);
-   }
-
-   public void testListAvailableTemplates() {
-      CloudApi api = requestsSendResponses(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://example.com/api/cloud/virtualdatacenters/1/action/templates")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachineTemplatesDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/available-templates-page.xml",
-                              normalize(VirtualMachineTemplatesDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://example.com/api/cloud/virtualdatacenters/1/action/templates")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachineTemplatesDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/available-templates-lastpage.xml",
-                              normalize(VirtualMachineTemplatesDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
-      vdc.addLink(new RESTLink("templates", "http://example.com/api/cloud/virtualdatacenters/1/action/templates"));
-
-      PagedIterable<VirtualMachineTemplateDto> templates = api.listAvailableTemplates(vdc);
-      List<VirtualMachineTemplateDto> all = templates.concat().toList();
-
-      assertEquals(all.size(), 2);
-      assertEquals(all.get(0).getId().intValue(), 15);
-      assertEquals(all.get(1).getId().intValue(), 16);
-   }
-
-   public void testListAvailableTemplatesWithPagination() {
-      CloudApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://example.com/api/cloud/virtualdatacenters/1/action/templates")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VirtualMachineTemplatesDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/available-templates-lastpage.xml",
-                              normalize(VirtualMachineTemplatesDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
-      vdc.addLink(new RESTLink("templates", "http://example.com/api/cloud/virtualdatacenters/1/action/templates"));
-
-      VirtualMachineTemplateOptions options = VirtualMachineTemplateOptions.builder().startWith(1).build();
-      PaginatedCollection<VirtualMachineTemplateDto, VirtualMachineTemplatesDto> templates = api
-            .listAvailableTemplates(vdc, options);
-
-      assertEquals(templates.size(), 1);
-      assertEquals(templates.getTotalSize().intValue(), 2);
-      assertEquals(templates.get(0).getId().intValue(), 16);
-   }
-
-   public void testListVolumes() {
-      CloudApi api = requestsSendResponses(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://example.com/api/cloud/virtualdatacenters/1/volumes")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VolumesManagementDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/volumes-page.xml",
-                              normalize(VolumesManagementDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://example.com/api/cloud/virtualdatacenters/1/volumes")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VolumesManagementDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/volumes-lastpage.xml",
-                              normalize(VolumesManagementDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
-      vdc.addLink(new RESTLink("volumes", "http://example.com/api/cloud/virtualdatacenters/1/volumes"));
-
-      PagedIterable<VolumeManagementDto> volumes = api.listVolumes(vdc);
-      List<VolumeManagementDto> all = volumes.concat().toList();
-
-      assertEquals(all.size(), 2);
-      assertEquals(all.get(0).getId().intValue(), 1530);
-      assertEquals(all.get(1).getId().intValue(), 1531);
-   }
-
-   public void testListVolumesWithPagination() {
-      CloudApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://example.com/api/cloud/virtualdatacenters/1/volumes")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(VolumesManagementDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/volumes-lastpage.xml",
-                              normalize(VolumesManagementDto.MEDIA_TYPE))) //
-                  .build());
-
-      VirtualDatacenterDto vdc = new VirtualDatacenterDto();
-      vdc.addLink(new RESTLink("volumes", "http://example.com/api/cloud/virtualdatacenters/1/volumes"));
-
-      VolumeOptions options = VolumeOptions.builder().startWith(1).build();
-      PaginatedCollection<VolumeManagementDto, VolumesManagementDto> templates = api.listVolumes(vdc, options);
-
-      assertEquals(templates.size(), 1);
-      assertEquals(templates.getTotalSize().intValue(), 2);
-      assertEquals(templates.get(0).getId().intValue(), 1531);
-   }
-
-   @Override
-   protected CloudApi clientFrom(AbiquoApi api) {
-      return api.getCloudApi();
-   }
-
-}


[16/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/CloudApi.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/CloudApi.java b/abiquo/src/main/java/org/jclouds/abiquo/features/CloudApi.java
deleted file mode 100644
index 9b78992..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/CloudApi.java
+++ /dev/null
@@ -1,1253 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import java.io.Closeable;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.binders.AppendToPath;
-import org.jclouds.abiquo.binders.BindToPath;
-import org.jclouds.abiquo.binders.BindToXMLPayloadAndPath;
-import org.jclouds.abiquo.binders.cloud.BindHardDiskRefsToPayload;
-import org.jclouds.abiquo.binders.cloud.BindMoveVolumeToPath;
-import org.jclouds.abiquo.binders.cloud.BindNetworkConfigurationRefToPayload;
-import org.jclouds.abiquo.binders.cloud.BindNetworkRefToPayload;
-import org.jclouds.abiquo.binders.cloud.BindVirtualDatacenterRefToPayload;
-import org.jclouds.abiquo.binders.cloud.BindVolumeRefsToPayload;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.cloud.options.VirtualApplianceOptions;
-import org.jclouds.abiquo.domain.cloud.options.VirtualDatacenterOptions;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineOptions;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineTemplateOptions;
-import org.jclouds.abiquo.domain.cloud.options.VolumeOptions;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.abiquo.fallbacks.MovedVolume;
-import org.jclouds.abiquo.functions.ReturnTaskReferenceOrNull;
-import org.jclouds.abiquo.functions.enterprise.ParseEnterpriseId;
-import org.jclouds.abiquo.functions.infrastructure.ParseDatacenterId;
-import org.jclouds.abiquo.functions.pagination.ParsePrivateIps;
-import org.jclouds.abiquo.functions.pagination.ParsePublicIps;
-import org.jclouds.abiquo.functions.pagination.ParseVirtualMachineTemplates;
-import org.jclouds.abiquo.functions.pagination.ParseVirtualMachines;
-import org.jclouds.abiquo.functions.pagination.ParseVolumes;
-import org.jclouds.abiquo.http.filters.AbiquoAuthentication;
-import org.jclouds.abiquo.http.filters.AppendApiVersionToMediaType;
-import org.jclouds.abiquo.rest.annotations.EndpointLink;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.JAXBResponseParser;
-import org.jclouds.rest.annotations.ParamParser;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.SinceApiVersion;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToXMLPayload;
-
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplatesDto;
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualApplianceStateDto;
-import com.abiquo.server.core.cloud.VirtualAppliancesDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.cloud.VirtualDatacentersDto;
-import com.abiquo.server.core.cloud.VirtualMachineDto;
-import com.abiquo.server.core.cloud.VirtualMachineInstanceDto;
-import com.abiquo.server.core.cloud.VirtualMachineStateDto;
-import com.abiquo.server.core.cloud.VirtualMachineTaskDto;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpsDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpsDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworksDto;
-import com.abiquo.server.core.infrastructure.network.VMNetworkConfigurationsDto;
-import com.abiquo.server.core.infrastructure.storage.DiskManagementDto;
-import com.abiquo.server.core.infrastructure.storage.DisksManagementDto;
-import com.abiquo.server.core.infrastructure.storage.MovedVolumeDto;
-import com.abiquo.server.core.infrastructure.storage.TierDto;
-import com.abiquo.server.core.infrastructure.storage.TiersDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.abiquo.server.core.infrastructure.storage.VolumesManagementDto;
-
-/**
- * Provides synchronous access to Abiquo Cloud API.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/API+Reference">
- *      http://community.abiquo.com/display/ABI20/API+Reference</a>
- */
-@RequestFilters({ AbiquoAuthentication.class, AppendApiVersionToMediaType.class })
-@Path("/cloud")
-public interface CloudApi extends Closeable {
-   /*********************** Virtual Datacenter ***********************/
-
-   /**
-    * List all virtual datacenters.
-    * 
-    * @param options
-    *           Optional query params.
-    * @return The list of Datacenters.
-    */
-   @Named("vdc:list")
-   @GET
-   @Path("/virtualdatacenters")
-   @Consumes(VirtualDatacentersDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualDatacentersDto listVirtualDatacenters(VirtualDatacenterOptions options);
-
-   /**
-    * Get the given virtual datacenter.
-    * 
-    * @param virtualDatacenterId
-    *           The id of the virtual datacenter.
-    * @return The virtual datacenter or <code>null</code> if it does not exist.
-    */
-   @Named("vdc:get")
-   @GET
-   @Path("/virtualdatacenters/{virtualdatacenter}")
-   @Fallback(NullOnNotFoundOr404.class)
-   @Consumes(VirtualDatacenterDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualDatacenterDto getVirtualDatacenter(@PathParam("virtualdatacenter") Integer virtualDatacenterId);
-
-   /**
-    * Create a new virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter to be created.
-    * @param datacenter
-    *           Datacenter where the virtualdatacenter will be deployed.
-    * @param enterprise
-    *           Enterprise of the virtual datacenter.
-    * @return The created virtual datacenter.
-    */
-   @Named("vdc:create")
-   @POST
-   @Path("/virtualdatacenters")
-   @Consumes(VirtualDatacenterDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualDatacenterDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualDatacenterDto createVirtualDatacenter(
-         @BinderParam(BindToXMLPayload.class) final VirtualDatacenterDto virtualDatacenter,
-         @QueryParam("datacenter") @ParamParser(ParseDatacenterId.class) final DatacenterDto datacenter,
-         @QueryParam("enterprise") @ParamParser(ParseEnterpriseId.class) final EnterpriseDto enterprise);
-
-   /**
-    * Updates an existing virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The new attributes for the virtual datacenter.
-    * @return The updated virtual datacenter.
-    */
-   @Named("vdc:update")
-   @PUT
-   @Consumes(VirtualDatacenterDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualDatacenterDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualDatacenterDto updateVirtualDatacenter(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * Deletes an existing virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter to delete.
-    */
-   @Named("vdc:delete")
-   @DELETE
-   void deleteVirtualDatacenter(
-         @EndpointLink("edit") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * List all available templates for the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @return The list of available templates.
-    */
-   @Named("vdc:listtemplates")
-   @GET
-   @Consumes(VirtualMachineTemplatesDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseVirtualMachineTemplates.class)
-   @Transform(ParseVirtualMachineTemplates.ToPagedIterable.class)
-   PagedIterable<VirtualMachineTemplateDto> listAvailableTemplates(
-         @EndpointLink("templates") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * List all available templates for the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param options
-    *           Filtering options.
-    * @return The list of available templates.
-    */
-   @Named("vdc:listtemplates")
-   @GET
-   @Consumes(VirtualMachineTemplatesDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseVirtualMachineTemplates.class)
-   PaginatedCollection<VirtualMachineTemplateDto, VirtualMachineTemplatesDto> listAvailableTemplates(
-         @EndpointLink("templates") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         VirtualMachineTemplateOptions options);
-
-   /**
-    * List all available ips to purchase in the datacenter by the virtual
-    * datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param options
-    *           Filtering options.
-    * @return The list of available ips.
-    */
-   @Named("vdc:listavailablepublicips")
-   @GET
-   @Consumes(PublicIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParsePublicIps.class)
-   @Transform(ParsePublicIps.ToPagedIterable.class)
-   PagedIterable<PublicIpDto> listAvailablePublicIps(
-         @EndpointLink("topurchase") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * List all available ips to purchase in the datacenter by the virtual
-    * datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param options
-    *           Filtering options.
-    * @return The list of available ips.
-    */
-   @Named("vdc:listavailablepublicips")
-   @GET
-   @Consumes(PublicIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParsePublicIps.class)
-   PaginatedCollection<PublicIpDto, PublicIpsDto> listAvailablePublicIps(
-         @EndpointLink("topurchase") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         IpOptions options);
-
-   /**
-    * List all purchased public ip addresses in the virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param options
-    *           Filtering options.
-    * @return The list of purchased ips.
-    */
-   @Named("vdc:listpurchasedpublicips")
-   @GET
-   @Consumes(PublicIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParsePublicIps.class)
-   @Transform(ParsePublicIps.ToPagedIterable.class)
-   PagedIterable<PublicIpDto> listPurchasedPublicIps(
-         @EndpointLink("purchased") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * List all purchased public ip addresses in the virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param options
-    *           Filtering options.
-    * @return The list of purchased ips.
-    */
-   @Named("vdc:listpurchasedpublicips")
-   @GET
-   @Consumes(PublicIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParsePublicIps.class)
-   PaginatedCollection<PublicIpDto, PublicIpsDto> listPurchasedPublicIps(
-         @EndpointLink("purchased") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         IpOptions options);
-
-   /**
-    * Purchase a public IP.
-    * 
-    * @param ip
-    *           The public ip address to purchase.
-    * @return The purchased public ip.
-    */
-   @Named("vdc:purchasepublicip")
-   @PUT
-   @Consumes(PublicIpDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   PublicIpDto purchasePublicIp(@EndpointLink("purchase") @BinderParam(BindToPath.class) PublicIpDto publicIp);
-
-   /**
-    * Release a public IP.
-    * 
-    * @param ip
-    *           The public ip address to purchase.
-    * @return The release public ip.
-    */
-   @Named("vdc:releasepublicip")
-   @PUT
-   @Consumes(PublicIpDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   PublicIpDto releasePublicIp(@EndpointLink("release") @BinderParam(BindToPath.class) PublicIpDto publicIp);
-
-   /**
-    * List the storage tiers available for the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @return The storage tiers available to the given virtual datacenter.
-    */
-   @Named("vdc:listtiers")
-   @GET
-   @Consumes(TiersDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   TiersDto listStorageTiers(
-         @EndpointLink("tiers") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * Get the storage tier from the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param The
-    *           id of the storage tier.
-    * @return The storage tiers available to the given virtual datacenter.
-    */
-   @Named("vdc:gettier")
-   @GET
-   @Fallback(NullOnNotFoundOr404.class)
-   @Consumes(TierDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   TierDto getStorageTier(@EndpointLink("tiers") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         @BinderParam(AppendToPath.class) Integer tierId);
-
-   /*********************** Private Network ***********************/
-
-   /**
-    * Get the default network of the virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @return The default network of the virtual datacenter.
-    */
-   @Named("vdc:getdefaultnetwork")
-   @GET
-   @Consumes(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VLANNetworkDto getDefaultNetwork(
-         @EndpointLink("defaultnetwork") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * Set the default network of the virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param network
-    *           The default network.
-    */
-   @Named("vdc:setdefaultnetwork")
-   @PUT
-   @Produces(LinksDto.BASE_MEDIA_TYPE)
-   void setDefaultNetwork(
-         @EndpointLink("defaultvlan") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         @BinderParam(BindNetworkRefToPayload.class) VLANNetworkDto network);
-
-   /**
-    * List all private networks for a virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @return The list of private networks for the virtual datacenter.
-    */
-   @Named("privatenetwork:list")
-   @GET
-   @Consumes(VLANNetworksDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VLANNetworksDto listPrivateNetworks(
-         @EndpointLink("privatenetworks") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * Get the given private network from the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param virtualApplianceId
-    *           The id of the private network.
-    * @return The private network or <code>null</code> if it does not exist.
-    */
-   @Named("privatenetwork:get")
-   @GET
-   @Fallback(NullOnNotFoundOr404.class)
-   @Consumes(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VLANNetworkDto getPrivateNetwork(
-         @EndpointLink("privatenetworks") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         @BinderParam(AppendToPath.class) Integer privateNetworkId);
-
-   /**
-    * Create a new private network in a virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param privateNetwork
-    *           The private network to be created.
-    * @return The created private network.
-    */
-   @Named("privatenetwork:create")
-   @POST
-   @Consumes(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @Produces(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VLANNetworkDto createPrivateNetwork(
-         @EndpointLink("privatenetworks") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         @BinderParam(BindToXMLPayload.class) VLANNetworkDto privateNetwork);
-
-   /**
-    * Updates an existing private network from the given virtual datacenter.
-    * 
-    * @param privateNetwork
-    *           The new attributes for the private network.
-    * @return The updated private network.
-    */
-   @Named("privatenetwork:update")
-   @PUT
-   @Consumes(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @Produces(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VLANNetworkDto updatePrivateNetwork(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) VLANNetworkDto privateNetwork);
-
-   /**
-    * Deletes an existing private network.
-    * 
-    * @param privateNetwork
-    *           The private network to delete.
-    */
-   @Named("privatenetwork:delete")
-   @DELETE
-   void deletePrivateNetwork(@EndpointLink("edit") @BinderParam(BindToPath.class) VLANNetworkDto privateNetwork);
-
-   /*********************** Private Network IPs ***********************/
-
-   /**
-    * List all ips for a private network.
-    * 
-    * @param network
-    *           The private network.
-    * @return The list of ips for the private network.
-    */
-   @Named("privatenetwork:listips")
-   @GET
-   @Consumes(PrivateIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParsePrivateIps.class)
-   @Transform(ParsePrivateIps.ToPagedIterable.class)
-   PagedIterable<PrivateIpDto> listPrivateNetworkIps(
-         @EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network);
-
-   /**
-    * List all ips for a private network with options.
-    * 
-    * @param network
-    *           The private network.
-    * @param options
-    *           Filtering options.
-    * @return The list of ips for the private network.
-    */
-   @Named("privatenetwork:listips")
-   @GET
-   @Consumes(PrivateIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParsePrivateIps.class)
-   PaginatedCollection<PrivateIpDto, PrivateIpsDto> listPrivateNetworkIps(
-         @EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network, IpOptions options);
-
-   /**
-    * Get the requested ip from the given private network.
-    * 
-    * @param network
-    *           The private network.
-    * @param ipId
-    *           The id of the ip to get.
-    * @return The requested ip.
-    */
-   @Named("privatenetwork:getip")
-   @GET
-   @Consumes(PrivateIpDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   PrivateIpDto getPrivateNetworkIp(@EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network,
-         @BinderParam(AppendToPath.class) Integer ipId);
-
-   /*********************** Virtual Appliance ***********************/
-
-   /**
-    * List all virtual appliance for a virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @return The list of virtual appliances for the virtual datacenter.
-    */
-   @Named("vapp:list")
-   @GET
-   @Consumes(VirtualAppliancesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualAppliancesDto listVirtualAppliances(
-         @EndpointLink("virtualappliances") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * Get the given virtual appliance from the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param virtualApplianceId
-    *           The id of the virtual appliance.
-    * @return The virtual appliance or <code>null</code> if it does not exist.
-    */
-   @Named("vapp:get")
-   @GET
-   @Fallback(NullOnNotFoundOr404.class)
-   @Consumes(VirtualApplianceDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualApplianceDto getVirtualAppliance(
-         @EndpointLink("virtualappliances") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         @BinderParam(AppendToPath.class) Integer virtualApplianceId);
-
-   /**
-    * Create a new virtual appliance in a virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param virtualAppliance
-    *           The virtual appliance to be created.
-    * @return The created virtual appliance.
-    */
-   @Named("vapp:create")
-   @POST
-   @Consumes(VirtualApplianceDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualApplianceDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualApplianceDto createVirtualAppliance(
-         @EndpointLink("virtualappliances") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         @BinderParam(BindToXMLPayload.class) VirtualApplianceDto virtualAppliance);
-
-   /**
-    * Updates an existing virtual appliance from the given virtual datacenter.
-    * 
-    * @param virtualAppliance
-    *           The new attributes for the virtual appliance.
-    * @return The updated virtual appliance.
-    */
-   @Named("vapp:update")
-   @PUT
-   @Consumes(VirtualApplianceDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualApplianceDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualApplianceDto updateVirtualAppliance(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) VirtualApplianceDto virtualAppliance);
-
-   /**
-    * Deletes an existing virtual appliance.
-    * 
-    * @param virtualAppliance
-    *           The virtual appliance to delete.
-    */
-   @Named("vapp:delete")
-   @DELETE
-   void deleteVirtualAppliance(@EndpointLink("edit") @BinderParam(BindToPath.class) VirtualApplianceDto virtualAppliance);
-
-   /**
-    * Deletes an existing virtual appliance.
-    * 
-    * @param virtualAppliance
-    *           The virtual appliance to delete.
-    * @param options
-    *           The options to customize the delete operation (e.g. Force
-    *           delete).
-    */
-   @Named("vapp:delete")
-   @DELETE
-   void deleteVirtualAppliance(
-         @EndpointLink("edit") @BinderParam(BindToPath.class) VirtualApplianceDto virtualAppliance,
-         VirtualApplianceOptions options);
-
-   /**
-    * Deploy a virtual appliance.
-    * 
-    * @param virtualAppliance
-    *           The virtual appliance to deploy
-    * @param options
-    *           the extra options for the deploy process.
-    * @return Response message to the deploy request.
-    */
-   @Named("vapp:deploy")
-   @POST
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualMachineTaskDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   AcceptedRequestDto<String> deployVirtualAppliance(
-         @EndpointLink("deploy") @BinderParam(BindToPath.class) VirtualApplianceDto virtualAppliance,
-         @BinderParam(BindToXMLPayload.class) VirtualMachineTaskDto task);
-
-   /**
-    * Undeploy a virtual appliance.
-    * 
-    * @param virtualAppliance
-    *           The virtual appliance to undeploy
-    * @param options
-    *           the extra options for the undeploy process.
-    * @return Response message to the undeploy request.
-    */
-   @Named("vapp:undeploy")
-   @POST
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualMachineTaskDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   AcceptedRequestDto<String> undeployVirtualAppliance(
-         @EndpointLink("undeploy") @BinderParam(BindToPath.class) VirtualApplianceDto virtualAppliance,
-         @BinderParam(BindToXMLPayload.class) VirtualMachineTaskDto task);
-
-   /**
-    * Get the state of the given virtual appliance.
-    * 
-    * @param virtualAppliance
-    *           The given virtual appliance.
-    * @return The state of the given virtual appliance.
-    */
-   @Named("vapp:getstate")
-   @GET
-   @Consumes(VirtualApplianceStateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualApplianceStateDto getVirtualApplianceState(
-         @EndpointLink("state") @BinderParam(BindToPath.class) VirtualApplianceDto virtualAppliance);
-
-   /**
-    * Gets the price of the given virtual appliance.
-    * 
-    * @param virtualAppliance
-    *           The virtual appliance to get the price of.
-    * @return A <code>String</code> representation of the price of the virtual
-    *         appliance.
-    */
-   @Named("vapp:getprice")
-   @GET
-   @Consumes(MediaType.TEXT_PLAIN)
-   @ResponseParser(ReturnStringIf2xx.class)
-   String getVirtualAppliancePrice(
-         @EndpointLink("price") @BinderParam(BindToPath.class) VirtualApplianceDto virtualAppliance);
-
-   /*********************** Virtual Machine ***********************/
-
-   /**
-    * List all virtual machines available to the current user.
-    * 
-    * @return The list of all virtual machines available to the current user.
-    */
-   @SinceApiVersion("2.4")
-   @Named("vm:listall")
-   @GET
-   @Path("/virtualmachines")
-   @Consumes(VirtualMachinesWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseVirtualMachines.class)
-   @Transform(ParseVirtualMachines.ToPagedIterable.class)
-   PagedIterable<VirtualMachineWithNodeExtendedDto> listAllVirtualMachines();
-
-   /**
-    * List all virtual machines available to the current user.
-    * 
-    * @param options
-    *           The filter options.
-    * @return The list of all virtual machines available to the current user.
-    */
-   @SinceApiVersion("2.4")
-   @Named("vm:listall")
-   @GET
-   @Path("/virtualmachines")
-   @Consumes(VirtualMachinesWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseVirtualMachines.class)
-   PaginatedCollection<VirtualMachineWithNodeExtendedDto, VirtualMachinesWithNodeExtendedDto> listAllVirtualMachines(
-         VirtualMachineOptions options);
-
-   /**
-    * List all virtual machines for a virtual appliance.
-    * 
-    * @param virtualAppliance
-    *           The virtual appliance.
-    * @return The list of virtual machines for the virtual appliance.
-    */
-   @Named("vm:list")
-   @GET
-   @Consumes(VirtualMachinesWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseVirtualMachines.class)
-   @Transform(ParseVirtualMachines.ToPagedIterable.class)
-   PagedIterable<VirtualMachineWithNodeExtendedDto> listVirtualMachines(
-         @EndpointLink("virtualmachines") @BinderParam(BindToPath.class) VirtualApplianceDto virtualAppliance);
-
-   /**
-    * List all virtual machines for a virtual appliance.
-    * 
-    * @param virtualAppliance
-    *           The virtual appliance.
-    * @param options
-    *           The options to filter the list of virtual machines.
-    * @return The list of virtual machines for the virtual appliance.
-    */
-   @Named("vm:list")
-   @GET
-   @Consumes(VirtualMachinesWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseVirtualMachines.class)
-   PaginatedCollection<VirtualMachineWithNodeExtendedDto, VirtualMachinesWithNodeExtendedDto> listVirtualMachines(
-         @EndpointLink("virtualmachines") @BinderParam(BindToPath.class) VirtualApplianceDto virtualAppliance,
-         VirtualMachineOptions options);
-
-   /**
-    * Get the given virtual machine from the given virtual machine.
-    * 
-    * @param virtualAppliance
-    *           The virtual appliance.
-    * @param virtualMachineId
-    *           The id of the virtual machine.
-    * @return The virtual machine or <code>null</code> if it does not exist.
-    */
-   @Named("vm:get")
-   @GET
-   @Fallback(NullOnNotFoundOr404.class)
-   @Consumes(VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualMachineWithNodeExtendedDto getVirtualMachine(
-         @EndpointLink("virtualmachines") @BinderParam(BindToPath.class) VirtualApplianceDto virtualAppliance,
-         @BinderParam(AppendToPath.class) Integer virtualMachineId);
-
-   /**
-    * Create a new virtual machine in a virtual appliance.
-    * 
-    * @param virtualAppliance
-    *           The virtual appliance.
-    * @param virtualMachine
-    *           The virtual machine to be created.
-    * @return The created virtual machine.
-    */
-   @Named("vm:create")
-   @POST
-   @Consumes(VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualMachineWithNodeExtendedDto createVirtualMachine(
-         @EndpointLink("virtualmachines") @BinderParam(BindToPath.class) VirtualApplianceDto virtualAppliance,
-         @BinderParam(BindToXMLPayload.class) VirtualMachineWithNodeExtendedDto virtualMachine);
-
-   /**
-    * Deletes an existing virtual machine.
-    * 
-    * @param virtualMachine
-    *           The virtual machine to delete.
-    */
-   @Named("vm:delete")
-   @DELETE
-   void deleteVirtualMachine(@EndpointLink("edit") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine);
-
-   /**
-    * Updates an existing virtual machine from the given virtual appliance.
-    * 
-    * @param virtualMachine
-    *           The new attributes for the virtual machine.
-    * @return The task reference or <code>null</code> if the operation completed
-    *         synchronously.
-    */
-   @Named("vm:update")
-   @PUT
-   @ResponseParser(ReturnTaskReferenceOrNull.class)
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   AcceptedRequestDto<String> updateVirtualMachine(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) VirtualMachineWithNodeExtendedDto virtualMachine);
-
-   /**
-    * Updates an existing virtual machine from the given virtual appliance.
-    * 
-    * @param virtualMachine
-    *           The new attributes for the virtual machine.
-    * @param options
-    *           The update options.
-    * @return The task reference or <code>null</code> if the operation completed
-    *         synchronously.
-    */
-   @Named("vm:update")
-   @PUT
-   @ResponseParser(ReturnTaskReferenceOrNull.class)
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   AcceptedRequestDto<String> updateVirtualMachine(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) VirtualMachineWithNodeExtendedDto virtualMachine,
-         VirtualMachineOptions options);
-
-   /**
-    * Changes the state an existing virtual machine.
-    * 
-    * @param virtualMachine
-    *           The given virtual machine.
-    * @param state
-    *           The new state.
-    * @return The task reference.
-    */
-   @Named("vm:changestate")
-   @PUT
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualMachineStateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   AcceptedRequestDto<String> changeVirtualMachineState(
-         @EndpointLink("state") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine,
-         @BinderParam(BindToXMLPayload.class) VirtualMachineStateDto state);
-
-   /**
-    * Get the state of the given virtual machine.
-    * 
-    * @param virtualMachine
-    *           The given virtual machine.
-    * @return The state of the given virtual machine.
-    */
-   @Named("vm:getstate")
-   @GET
-   @Consumes(VirtualMachineStateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualMachineStateDto getVirtualMachineState(
-         @EndpointLink("state") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine);
-
-   /**
-    * Deploy a virtual machine with task options.
-    * 
-    * @param virtualMachine
-    *           The virtual machine to deploy.
-    * @param options
-    *           extra deploy options.
-    * @return Response message to the deploy request.
-    */
-   @Named("vm:deploy")
-   @POST
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualMachineTaskDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   AcceptedRequestDto<String> deployVirtualMachine(
-         @EndpointLink("deploy") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine,
-         @BinderParam(BindToXMLPayload.class) VirtualMachineTaskDto options);
-
-   /**
-    * Undeploy a virtual machine with task options.
-    * 
-    * @param virtualMachine
-    *           The virtual machine to undeploy.
-    * @param options
-    *           extra undeploy options.
-    * @return Response message to the undeploy request.
-    */
-   @Named("vm:undeploy")
-   @POST
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualMachineTaskDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   AcceptedRequestDto<String> undeployVirtualMachine(
-         @EndpointLink("undeploy") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine,
-         @BinderParam(BindToXMLPayload.class) VirtualMachineTaskDto options);
-
-   /**
-    * List all available network configurations for a virtual machine.
-    * 
-    * @param virtualMachine
-    *           The virtual machine.
-    * @return The list of network configurations.
-    */
-   @Named("vm:listnetworkconfigurations")
-   @GET
-   @Consumes(VMNetworkConfigurationsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VMNetworkConfigurationsDto listNetworkConfigurations(
-         @EndpointLink("configurations") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine);
-
-   /**
-    * Sets the gateway network to be used by this virtual machine.
-    * 
-    * @param virtualMachine
-    *           The virtual machine.
-    * @param network
-    *           The gateway network to use.
-    */
-   @Named("vm:setgateway")
-   @PUT
-   @Produces(LinksDto.BASE_MEDIA_TYPE)
-   void setGatewayNetwork(
-         @EndpointLink("configurations") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine,
-         @BinderParam(BindNetworkConfigurationRefToPayload.class) VLANNetworkDto network);
-
-   /**
-    * Reboot a virtual machine.
-    * 
-    * @param virtualMachine
-    *           The virtual machine to reboot.
-    * @return Response message to the reset request.
-    */
-   @Named("vm:reboot")
-   @POST
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   AcceptedRequestDto<String> rebootVirtualMachine(
-         @EndpointLink("reset") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine);
-
-   /**
-    * Take a snapshot of the given virtual machine.
-    * <p>
-    * This will create a new virtual machine template in the appliance library
-    * based on the given virtual machine.
-    * 
-    * @param virtualMachine
-    *           The virtual machine to snapshot.
-    * @param snapshotConfig
-    *           The configuration of the snapshot.
-    * @return The task reference to the snapshot process.
-    */
-   @Named("vm:snapshot")
-   @POST
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualMachineInstanceDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   AcceptedRequestDto<String> snapshotVirtualMachine(
-         @EndpointLink("instance") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine,
-         @BinderParam(BindToXMLPayload.class) VirtualMachineInstanceDto snapshotConfig);
-
-   /******************* Virtual Machine Template ***********************/
-
-   /**
-    * Get the template of a virtual machine.
-    * 
-    * @param virtualMachine
-    *           The given virtual machine.
-    * @return The template of the given virtual machine.
-    */
-   @Named("vm:gettemplate")
-   @GET
-   @Consumes(VirtualMachineTemplateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualMachineTemplateDto getVirtualMachineTemplate(
-         @EndpointLink("virtualmachinetemplate") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine);
-
-   /**
-    * Get the volumes attached to the given virtual machine.
-    * 
-    * @param virtualMachine
-    *           The virtual machine.
-    * @return The volumes attached to the given virtual machine.
-    */
-   @Named("vm:listvolumes")
-   @GET
-   @Consumes(VolumesManagementDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VolumesManagementDto listAttachedVolumes(
-         @EndpointLink("volumes") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine);
-
-   /**
-    * Detach all volumes from the given virtual machine.
-    * <p>
-    * If the virtual machine is deployed, the operation will be executed
-    * asynchronously.
-    * 
-    * @param virtualMachine
-    *           The virtual machine.
-    * @return The task reference or <code>null</code> if the operation completed
-    *         synchronously.
-    */
-   @Named("vm:detachvolumes")
-   @DELETE
-   @ResponseParser(ReturnTaskReferenceOrNull.class)
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   AcceptedRequestDto<String> detachAllVolumes(
-         @EndpointLink("volumes") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine);
-
-   /**
-    * Replaces the current volumes attached to the virtual machine with the
-    * given ones.
-    * <p>
-    * If the virtual machine is deployed, the operation will be executed
-    * asynchronously.
-    * 
-    * @param virtualMachine
-    *           The virtual machine.
-    * @param options
-    *           virtual machine parameters
-    * @param volumes
-    *           The new volumes for the virtual machine.
-    * @return The task reference or <code>null</code> if the operation completed
-    *         synchronously.
-    */
-   @Named("vm:changevolumes")
-   @PUT
-   @ResponseParser(ReturnTaskReferenceOrNull.class)
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(LinksDto.BASE_MEDIA_TYPE)
-   AcceptedRequestDto<String> replaceVolumes(
-         @EndpointLink("volumes") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine,
-         VirtualMachineOptions options, @BinderParam(BindVolumeRefsToPayload.class) VolumeManagementDto... volumes);
-
-   /**
-    * List all hard disks attached to the given virtual machine.
-    * 
-    * @param virtualMachine
-    *           The virtual machine.
-    * @return The hard disks attached to the virtual machine.
-    */
-   @Named("vm:listharddisks")
-   @GET
-   @Consumes(DisksManagementDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DisksManagementDto listAttachedHardDisks(
-         @EndpointLink("disks") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine);
-
-   /**
-    * Detach all hard disks from the given virtual machine.
-    * <p>
-    * If the virtual machine is deployed, the operation will be executed
-    * asynchronously.
-    * 
-    * @param virtualMachine
-    *           The virtual machine.
-    * @return The task reference or <code>null</code> if the operation completed
-    *         synchronously.
-    */
-   @Named("vm:detachharddisks")
-   @DELETE
-   @ResponseParser(ReturnTaskReferenceOrNull.class)
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   AcceptedRequestDto<String> detachAllHardDisks(
-         @EndpointLink("disks") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine);
-
-   /**
-    * Replaces the current hard disks attached to the virtual machine with the
-    * given ones.
-    * <p>
-    * If the virtual machine is deployed, the operation will be executed
-    * asynchronously.
-    * 
-    * @param virtualMachine
-    *           The virtual machine.
-    * @param hardDisks
-    *           The new hard disks for the virtual machine.
-    * @return The task reference or <code>null</code> if the operation completed
-    *         synchronously.
-    */
-   @Named("vm:changeharddisks")
-   @PUT
-   @ResponseParser(ReturnTaskReferenceOrNull.class)
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(LinksDto.BASE_MEDIA_TYPE)
-   AcceptedRequestDto<String> replaceHardDisks(
-         @EndpointLink("disks") @BinderParam(BindToPath.class) VirtualMachineDto virtualMachine,
-         @BinderParam(BindHardDiskRefsToPayload.class) DiskManagementDto... hardDisks);
-
-   /*********************** Hard disks ***********************/
-
-   /**
-    * List all hard disks in the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @return The hard disks in the virtual datacenter.
-    */
-   @Named("harddisk:list")
-   @GET
-   @Consumes(DisksManagementDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DisksManagementDto listHardDisks(
-         @EndpointLink("disks") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * Get the hard disk with the given id in the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param diskId
-    *           The id of the hard disk to get.
-    * @return The requested hard disk or <code>null</code> if it does not exist.
-    */
-   @Named("harddisk:get")
-   @GET
-   @Fallback(NullOnNotFoundOr404.class)
-   @Consumes(DiskManagementDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DiskManagementDto getHardDisk(
-         @EndpointLink("disks") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         @BinderParam(AppendToPath.class) Integer diskId);
-
-   /**
-    * Creates a new hard disk in the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter where the hard disk will be created.
-    * @param hardDisk
-    *           The hard disk to create.
-    * @return The created hard disk.
-    */
-   @Named("harddisk:create")
-   @POST
-   @Consumes(DiskManagementDto.BASE_MEDIA_TYPE)
-   @Produces(DiskManagementDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DiskManagementDto createHardDisk(
-         @EndpointLink("disks") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         @BinderParam(BindToXMLPayload.class) DiskManagementDto hardDisk);
-
-   /**
-    * Deletes the given hard disk.
-    * 
-    * @param hardDisk
-    *           The hard disk to delete.
-    */
-   @Named("harddisk:delete")
-   @DELETE
-   void deleteHardDisk(@EndpointLink("edit") @BinderParam(BindToPath.class) DiskManagementDto hardDisk);
-
-   /*********************** Volumes ***********************/
-
-   /**
-    * List all volumes in the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @return The volumes in the virtual datacenter.
-    */
-   @Named("volume:list")
-   @GET
-   @Consumes(VolumesManagementDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseVolumes.class)
-   @Transform(ParseVolumes.ToPagedIterable.class)
-   PagedIterable<VolumeManagementDto> listVolumes(
-         @EndpointLink("volumes") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter);
-
-   /**
-    * List all volumes in the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param options
-    *           Optional parameters to filter the volume list.
-    * @return The volumes in the virtual datacenter.
-    */
-   @Named("volume:list")
-   @GET
-   @Consumes(VolumesManagementDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseVolumes.class)
-   PaginatedCollection<VolumeManagementDto, VolumesManagementDto> listVolumes(
-         @EndpointLink("volumes") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         VolumeOptions options);
-
-   /**
-    * Get a volume from the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter.
-    * @param volumeId
-    *           The id of the volume to get.
-    * @return The volume or <code>null</code> if it does not exist.
-    */
-   @Named("volume:get")
-   @GET
-   @Fallback(NullOnNotFoundOr404.class)
-   @Consumes(VolumeManagementDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VolumeManagementDto getVolume(
-         @EndpointLink("volumes") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         @BinderParam(AppendToPath.class) Integer volumeId);
-
-   /**
-    * Creates a volume in the given virtual datacenter.
-    * 
-    * @param virtualDatacenter
-    *           The virtual datacenter where the volume will be created.
-    * @param volume
-    *           The volume to create. This volume dto must contain a link to the
-    *           tier where the volume should be created.
-    * @return The created volume.
-    */
-   @Named("volume:create")
-   @POST
-   @Consumes(VolumeManagementDto.BASE_MEDIA_TYPE)
-   @Produces(VolumeManagementDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VolumeManagementDto createVolume(
-         @EndpointLink("volumes") @BinderParam(BindToPath.class) VirtualDatacenterDto virtualDatacenter,
-         @BinderParam(BindToXMLPayload.class) VolumeManagementDto volume);
-
-   /**
-    * Modifies the given volume.
-    * <p>
-    * If the virtual machine is deployed and the size of the volume is changed,
-    * then an asynchronous task will be generated to refresh the resources of
-    * the virtual machine in the hypervisor.
-    * 
-    * @param volume
-    *           The volume to modify.
-    * @return The task reference or <code>null</code> if no task was generated.
-    */
-   @Named("volume:update")
-   @PUT
-   @ResponseParser(ReturnTaskReferenceOrNull.class)
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(VolumeManagementDto.BASE_MEDIA_TYPE)
-   AcceptedRequestDto<String> updateVolume(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) VolumeManagementDto volume);
-
-   /**
-    * Delete the given volume.
-    * 
-    * @param volume
-    *           The volume to delete.
-    */
-   @Named("volume:delete")
-   @DELETE
-   void deleteVolume(@EndpointLink("edit") @BinderParam(BindToPath.class) VolumeManagementDto volume);
-
-   /**
-    * Moves the given volume to a new virtual datacenter.
-    * <p>
-    * The Abiquo API will return a 301 (Moved Permanently), so redirects must be
-    * enabled to make this method succeed.
-    * 
-    * @param volume
-    *           The volume to move.
-    * @param newVirtualDatacenter
-    *           The destination virtual datacenter.
-    * @return The reference to the volume in the new virtual datacenter.
-    */
-   @Named("volume:move")
-   @POST
-   @Fallback(MovedVolume.class)
-   @Consumes(MovedVolumeDto.BASE_MEDIA_TYPE)
-   @Produces(LinksDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VolumeManagementDto moveVolume(@BinderParam(BindMoveVolumeToPath.class) VolumeManagementDto volume,
-         @BinderParam(BindVirtualDatacenterRefToPayload.class) VirtualDatacenterDto newVirtualDatacenter);
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/ConfigApi.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/ConfigApi.java b/abiquo/src/main/java/org/jclouds/abiquo/features/ConfigApi.java
deleted file mode 100644
index 6e5ec80..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/ConfigApi.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import java.io.Closeable;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.binders.BindToPath;
-import org.jclouds.abiquo.binders.BindToXMLPayloadAndPath;
-import org.jclouds.abiquo.domain.config.options.LicenseOptions;
-import org.jclouds.abiquo.domain.config.options.PropertyOptions;
-import org.jclouds.abiquo.http.filters.AbiquoAuthentication;
-import org.jclouds.abiquo.http.filters.AppendApiVersionToMediaType;
-import org.jclouds.abiquo.rest.annotations.EndpointLink;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.JAXBResponseParser;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.binders.BindToXMLPayload;
-
-import com.abiquo.server.core.appslibrary.CategoriesDto;
-import com.abiquo.server.core.appslibrary.CategoryDto;
-import com.abiquo.server.core.config.LicenseDto;
-import com.abiquo.server.core.config.LicensesDto;
-import com.abiquo.server.core.config.SystemPropertiesDto;
-import com.abiquo.server.core.config.SystemPropertyDto;
-import com.abiquo.server.core.enterprise.PrivilegeDto;
-import com.abiquo.server.core.enterprise.PrivilegesDto;
-
-/**
- * Provides synchronous access to Abiquo Admin API.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/API+Reference">
- *      http://community.abiquo.com/display/ABI20/API+Reference</a>
- */
-@RequestFilters({ AbiquoAuthentication.class, AppendApiVersionToMediaType.class })
-@Path("/config")
-public interface ConfigApi extends Closeable {
-   /*********************** License ***********************/
-
-   /**
-    * List all licenses.
-    * 
-    * @return The list of licenses.
-    */
-   @Named("license:list")
-   @GET
-   @Path("/licenses")
-   @Consumes(LicensesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   LicensesDto listLicenses();
-
-   /**
-    * List all active/inactive licenses.
-    * 
-    * @param options
-    *           Optional query params.
-    * @return The list of licenses.
-    */
-   @Named("license:list")
-   @GET
-   @Path("/licenses")
-   @Consumes(LicensesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   LicensesDto listLicenses(LicenseOptions options);
-
-   /**
-    * Add a new license.
-    * 
-    * @param license
-    *           The license to add.
-    * @return The added license.
-    */
-   @Named("license:add")
-   @POST
-   @Produces(LicenseDto.BASE_MEDIA_TYPE)
-   @Consumes(LicenseDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Path("/licenses")
-   LicenseDto addLicense(@BinderParam(BindToXMLPayload.class) LicenseDto license);
-
-   /**
-    * Removes an existing license.
-    * 
-    * @param license
-    *           The license to delete.
-    */
-   @Named("license:remove")
-   @DELETE
-   void removeLicense(@EndpointLink("edit") @BinderParam(BindToPath.class) LicenseDto license);
-
-   /*********************** Privilege ***********************/
-
-   /**
-    * List all privileges in the system.
-    * 
-    * @return The list of privileges.
-    */
-   @Named("privilege:list")
-   @GET
-   @Path("/privileges")
-   @Consumes(PrivilegesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   PrivilegesDto listPrivileges();
-
-   /**
-    * Get the given privilege.
-    * 
-    * @param privilegeId
-    *           The id of the privilege.
-    * @return The privilege or <code>null</code> if it does not exist.
-    */
-   @Named("privilege:get")
-   @GET
-   @Path("/privileges/{privilege}")
-   @Consumes(PrivilegeDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   PrivilegeDto getPrivilege(@PathParam("privilege") Integer privilegeId);
-
-   /*********************** System Properties ***********************/
-
-   /**
-    * List all system properties.
-    * 
-    * @return The list of properties.
-    */
-   @Named("property:list")
-   @GET
-   @Path("/properties")
-   @Consumes(SystemPropertiesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   SystemPropertiesDto listSystemProperties();
-
-   /**
-    * List properties with options.
-    * 
-    * @param options
-    *           Optional query params.
-    * @return The list of system properties.
-    */
-   @Named("property:list")
-   @GET
-   @Path("/properties")
-   @Consumes(SystemPropertiesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   SystemPropertiesDto listSystemProperties(PropertyOptions options);
-
-   /**
-    * Updates a system property.
-    * 
-    * @param property
-    *           The new attributes for the system property.
-    * @return The updated system property.
-    */
-   @Named("property:update")
-   @PUT
-   @Produces(SystemPropertyDto.BASE_MEDIA_TYPE)
-   @Consumes(SystemPropertyDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   SystemPropertyDto updateSystemProperty(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) SystemPropertyDto property);
-
-   /*********************** Category ***********************/
-
-   /**
-    * List all categories.
-    * 
-    * @return The list of categories.
-    */
-   @Named("category:list")
-   @GET
-   @Path("/categories")
-   @Consumes(CategoriesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   CategoriesDto listCategories();
-
-   /**
-    * Get the given category.
-    * 
-    * @param categoryId
-    *           The id of the category.
-    * @return The category or <code>null</code> if it does not exist.
-    */
-   @Named("category:get")
-   @GET
-   @Path("/categories/{category}")
-   @Consumes(CategoryDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   CategoryDto getCategory(@PathParam("category") Integer categoryId);
-
-   /**
-    * Create a new category.
-    * 
-    * @param icon
-    *           The category to be created.
-    * @return The created category.
-    */
-   @Named("category:create")
-   @POST
-   @Path("/categories")
-   @Produces(CategoryDto.BASE_MEDIA_TYPE)
-   @Consumes(CategoryDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   CategoryDto createCategory(@BinderParam(BindToXMLPayload.class) CategoryDto category);
-
-   /**
-    * Updates an existing category.
-    * 
-    * @param category
-    *           The new attributes for the category.
-    * @return The updated category.
-    */
-   @Named("category:update")
-   @PUT
-   @Produces(CategoryDto.BASE_MEDIA_TYPE)
-   @Consumes(CategoryDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   CategoryDto updateCategory(@EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) CategoryDto category);
-
-   /**
-    * Deletes an existing category.
-    * 
-    * @param icon
-    *           The category to delete.
-    */
-   @Named("category:delete")
-   @DELETE
-   void deleteCategory(@EndpointLink("edit") @BinderParam(BindToPath.class) CategoryDto category);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/EnterpriseApi.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/EnterpriseApi.java b/abiquo/src/main/java/org/jclouds/abiquo/features/EnterpriseApi.java
deleted file mode 100644
index 295fcf7..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/EnterpriseApi.java
+++ /dev/null
@@ -1,616 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import java.io.Closeable;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.binders.AppendToPath;
-import org.jclouds.abiquo.binders.BindToPath;
-import org.jclouds.abiquo.binders.BindToXMLPayloadAndPath;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.enterprise.options.EnterpriseOptions;
-import org.jclouds.abiquo.domain.enterprise.options.UserOptions;
-import org.jclouds.abiquo.functions.infrastructure.ParseDatacenterId;
-import org.jclouds.abiquo.functions.pagination.ParseEnterprises;
-import org.jclouds.abiquo.functions.pagination.ParseUsers;
-import org.jclouds.abiquo.http.filters.AbiquoAuthentication;
-import org.jclouds.abiquo.http.filters.AppendApiVersionToMediaType;
-import org.jclouds.abiquo.rest.annotations.EndpointLink;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.JAXBResponseParser;
-import org.jclouds.rest.annotations.ParamParser;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToXMLPayload;
-
-import com.abiquo.am.model.TemplatesStateDto;
-import com.abiquo.server.core.appslibrary.DatacenterRepositoryDto;
-import com.abiquo.server.core.appslibrary.TemplateDefinitionListDto;
-import com.abiquo.server.core.appslibrary.TemplateDefinitionListsDto;
-import com.abiquo.server.core.cloud.VirtualAppliancesDto;
-import com.abiquo.server.core.cloud.VirtualDatacentersDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.DatacenterLimitsDto;
-import com.abiquo.server.core.enterprise.DatacentersLimitsDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.enterprise.EnterprisePropertiesDto;
-import com.abiquo.server.core.enterprise.EnterprisesDto;
-import com.abiquo.server.core.enterprise.UserDto;
-import com.abiquo.server.core.enterprise.UsersDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.DatacentersDto;
-import com.abiquo.server.core.infrastructure.MachinesDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworksDto;
-
-/**
- * Provides synchronous access to Abiquo Enterprise API.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/API+Reference">
- *      http://community.abiquo.com/display/ABI20/API+Reference</a>
- */
-@RequestFilters({ AbiquoAuthentication.class, AppendApiVersionToMediaType.class })
-@Path("/admin")
-public interface EnterpriseApi extends Closeable {
-
-   /*********************** Enterprise ********************** */
-
-   /**
-    * List all enterprises.
-    * 
-    * @return The list of Enterprises.
-    */
-   @Named("enterprise:list")
-   @GET
-   @Path("/enterprises")
-   @Consumes(EnterprisesDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseEnterprises.class)
-   @Transform(ParseEnterprises.ToPagedIterable.class)
-   PagedIterable<EnterpriseDto> listEnterprises();
-
-   /**
-    * List enterprises with options.
-    * 
-    * @param options
-    *           Filtering options.
-    * @return The list of Enterprises.
-    */
-   @Named("enterprise:list")
-   @GET
-   @Path("/enterprises")
-   @Consumes(EnterprisesDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseEnterprises.class)
-   PaginatedCollection<EnterpriseDto, EnterprisesDto> listEnterprises(EnterpriseOptions options);
-
-   /**
-    * List filtered enterprises by datacenter.
-    * 
-    * @param datacenter
-    *           The given datacenter.
-    * @param options
-    *           Filtering options.
-    * @return The list of Enterprises.
-    */
-   @Named("enterprise:list")
-   @GET
-   @Consumes(EnterprisesDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseEnterprises.class)
-   PaginatedCollection<EnterpriseDto, EnterprisesDto> listEnterprises(
-         @EndpointLink("enterprises") @BinderParam(BindToPath.class) DatacenterDto datacenter, EnterpriseOptions options);
-
-   /**
-    * Create a new enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise to be created.
-    * @return The created enterprise.
-    */
-   @Named("enterprise:create")
-   @POST
-   @Path("/enterprises")
-   @Produces(EnterpriseDto.BASE_MEDIA_TYPE)
-   @Consumes(EnterpriseDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   EnterpriseDto createEnterprise(@BinderParam(BindToXMLPayload.class) EnterpriseDto enterprise);
-
-   /**
-    * Get the given enterprise.
-    * 
-    * @param enterpriseId
-    *           The id of the enterprise.
-    * @return The enterprise or <code>null</code> if it does not exist.
-    */
-   @Named("enterprise:get")
-   @GET
-   @Path("/enterprises/{enterprise}")
-   @Consumes(EnterpriseDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   EnterpriseDto getEnterprise(@PathParam("enterprise") Integer enterpriseId);
-
-   /**
-    * Updates an existing enterprise.
-    * 
-    * @param enterprise
-    *           The new attributes for the enterprise.
-    * @return The updated enterprise.
-    */
-   @Named("enterprise:update")
-   @PUT
-   @Produces(EnterpriseDto.BASE_MEDIA_TYPE)
-   @Consumes(EnterpriseDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   EnterpriseDto updateEnterprise(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) EnterpriseDto enterprise);
-
-   /**
-    * Deletes an existing enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise to delete.
-    */
-   @Named("enterprise:delete")
-   @DELETE
-   void deleteEnterprise(@EndpointLink("edit") @BinderParam(BindToPath.class) EnterpriseDto enterprise);
-
-   /**
-    * List the allowed datacenters to the given enterprise.
-    * 
-    * @param enterpriseId
-    *           The id of the enterprise.
-    * @return The allowed datacenters to the given enterprise.
-    */
-   @Named("enterprise:listalloweddatacenters")
-   @GET
-   @Path("/datacenters")
-   @Consumes(DatacentersDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DatacentersDto listAllowedDatacenters(@QueryParam("idEnterprise") Integer enterpriseId);
-
-   /**
-    * List all virtual datacenters of an enterprise.
-    * 
-    * @param enterprise
-    *           The given enterprise.
-    * @return The list of Datacenters.
-    */
-   @Named("enterprise:listvirtualdatacenters")
-   @GET
-   @Consumes(VirtualDatacentersDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualDatacentersDto listVirtualDatacenters(
-         @EndpointLink("cloud/virtualdatacenters") @BinderParam(BindToPath.class) EnterpriseDto enterprise);
-
-   /*********************** Enterprise Properties ***********************/
-
-   /**
-    * Get defined properties of the given enterprise.
-    * 
-    * @param enterpriseId
-    *           The enterprise id.
-    * @return Set of enterprise properties.
-    */
-   @Named("enterprise:getproperties")
-   @GET
-   @Consumes(EnterprisePropertiesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   EnterprisePropertiesDto getEnterpriseProperties(
-         @EndpointLink("properties") @BinderParam(BindToPath.class) EnterpriseDto enterprise);
-
-   /**
-    * Updates the given enterprise properties set.
-    * 
-    * @param properties
-    *           The properties set.
-    * @return The updated properties.
-    */
-   @Named("enterprse:setproperties")
-   @PUT
-   @Produces(EnterprisePropertiesDto.BASE_MEDIA_TYPE)
-   @Consumes(EnterprisePropertiesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   EnterprisePropertiesDto updateEnterpriseProperties(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) EnterprisePropertiesDto properties);
-
-   /*********************** Enterprise Limits ***********************/
-
-   /**
-    * Allows the given enterprise to use the given datacenter with the given
-    * limits.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @param datacenter
-    *           The datacenter to allow to the given enterprise.
-    * @param limits
-    *           The usage limits for the enterprise in the given datacenter.
-    * @return The usage limits for the enterprise in the given datacenter.
-    */
-   @Named("limit:create")
-   @POST
-   @Produces(DatacenterLimitsDto.BASE_MEDIA_TYPE)
-   @Consumes(DatacenterLimitsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DatacenterLimitsDto createLimits(
-         @EndpointLink("limits") @BinderParam(BindToPath.class) final EnterpriseDto enterprise,
-         @QueryParam("datacenter") @ParamParser(ParseDatacenterId.class) final DatacenterDto datacenter,
-         @BinderParam(BindToXMLPayload.class) DatacenterLimitsDto limits);
-
-   /**
-    * Retrieves the limits for the given enterprise and datacenter.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @param datacenter
-    *           The datacenter.
-    * @return The usage limits for the enterprise in the given datacenter.
-    */
-   @Named("limit:get")
-   @GET
-   @Consumes(DatacentersLimitsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   DatacentersLimitsDto getLimits(
-         @EndpointLink("limits") @BinderParam(BindToPath.class) final EnterpriseDto enterprise,
-         @QueryParam("datacenter") @ParamParser(ParseDatacenterId.class) final DatacenterDto datacenter);
-
-   /**
-    * Retrieves limits for the given enterprise and any datacenter.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @return The usage limits for the enterprise on any datacenter.
-    */
-   @Named("limit:list")
-   @GET
-   @Consumes(DatacentersLimitsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DatacentersLimitsDto listLimits(@EndpointLink("limits") @BinderParam(BindToPath.class) EnterpriseDto enterprise);
-
-   /**
-    * Updates an existing enterprise-datacenter limits.
-    * 
-    * @param limits
-    *           The new set of limits.
-    * @return The updated limits.
-    */
-   @Named("limit:update")
-   @PUT
-   @Produces(DatacenterLimitsDto.BASE_MEDIA_TYPE)
-   @Consumes(DatacenterLimitsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DatacenterLimitsDto updateLimits(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) DatacenterLimitsDto limits);
-
-   /**
-    * Deletes existing limits for a pair enterprise-datacenter.
-    * 
-    * @param limits
-    *           The limits to delete.
-    */
-   @Named("limit:delete")
-   @DELETE
-   void deleteLimits(@EndpointLink("edit") @BinderParam(BindToPath.class) DatacenterLimitsDto limits);
-
-   /*********************** User ********************** */
-
-   /**
-    * Retrieves users of the given enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @return The users of the enterprise.
-    */
-   @Named("user:list")
-   @GET
-   @Consumes(UsersDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseUsers.class)
-   @Transform(ParseUsers.ToPagedIterable.class)
-   PagedIterable<UserDto> listUsers(@EndpointLink("users") @BinderParam(BindToPath.class) EnterpriseDto enterprise);
-
-   /**
-    * List filtered users by enterprise.
-    * 
-    * @param enterprise
-    *           The given enterprise.
-    * @param options
-    *           Filtering options.
-    * @return The list of Users.
-    */
-   @Named("user:list")
-   @GET
-   @Consumes(UsersDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseUsers.class)
-   PaginatedCollection<UserDto, UsersDto> listUsers(
-         @EndpointLink("users") @BinderParam(BindToPath.class) EnterpriseDto enterprise, UserOptions options);
-
-   /**
-    * Create a new user in the given enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @param user
-    *           The user to be created.
-    * @return The created user.
-    */
-   @Named("user:create")
-   @POST
-   @Produces(UserDto.BASE_MEDIA_TYPE)
-   @Consumes(UserDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   UserDto createUser(@EndpointLink("users") @BinderParam(BindToPath.class) EnterpriseDto enterprise,
-         @BinderParam(BindToXMLPayload.class) UserDto user);
-
-   /**
-    * Get the given user from the given enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @param userId
-    *           The id of the user.
-    * @return The user or <code>null</code> if it does not exist.
-    */
-   @Named("user:get")
-   @GET
-   @Consumes(UserDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   UserDto getUser(@EndpointLink("users") @BinderParam(BindToPath.class) EnterpriseDto enterprise,
-         @BinderParam(AppendToPath.class) Integer userId);
-
-   /**
-    * Updates an existing user.
-    * 
-    * @param enterprise
-    *           The new attributes for the user.
-    * @return The updated user.
-    */
-   @Named("user:update")
-   @PUT
-   @Produces(UserDto.BASE_MEDIA_TYPE)
-   @Consumes(UserDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   UserDto updateUser(@EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) UserDto user);
-
-   /**
-    * Deletes existing user.
-    * 
-    * @param user
-    *           The user to delete.
-    */
-   @Named("user:delete")
-   @DELETE
-   void deleteUser(@EndpointLink("edit") @BinderParam(BindToPath.class) UserDto user);
-
-   /**
-    * Retrieves list of virtual machines by user.
-    * 
-    * @param user
-    *           The user.
-    * @return The list of virtual machines of the user.
-    */
-   @Named("user:listvms")
-   @GET
-   @Consumes(VirtualMachinesWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualMachinesWithNodeExtendedDto listVirtualMachines(
-         @EndpointLink("virtualmachines") @BinderParam(BindToPath.class) final UserDto user);
-
-   /*********************** Datacenter Repository ***********************/
-
-   /**
-    * Get the given datacenter repository from the given enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @param datacenterRepositoryId
-    *           The id of the datacenter repository.
-    * @return The datacenter repository or <code>null</code> if it does not
-    *         exist.
-    */
-   @Named("repository:get")
-   @GET
-   @Consumes(DatacenterRepositoryDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   UserDto getDatacenterRepository(
-         @EndpointLink("datacenterrepositories") @BinderParam(BindToPath.class) EnterpriseDto enterprise,
-         @BinderParam(AppendToPath.class) Integer datacenterRepositoryId);
-
-   /**
-    * Refreshes database with virtual machine templates existing in the
-    * repository filesystem.
-    * 
-    * @param enterpriseId
-    *           Id of the enterprise which information will be refreshed.
-    * @param datacenterRepositoryId
-    *           Id of the datacenter repository containing the templates.
-    */
-   @Named("repository:refresh")
-   @PUT
-   @Path("/enterprises/{enterprise}/datacenterrepositories/{datacenterrepository}/actions/refresh")
-   void refreshTemplateRepository(@PathParam("enterprise") Integer enterpriseId,
-         @PathParam("datacenterrepository") Integer datacenterRepositoryId);
-
-   /*********************** Network ***********************/
-
-   /**
-    * List external networks of the enterprise
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @return The list of external networks created and assigned.
-    */
-   @Named("enterprise:listexternalnetworks")
-   @GET
-   @Consumes(VLANNetworksDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VLANNetworksDto listExternalNetworks(
-         @EndpointLink("externalnetworks") @BinderParam(BindToPath.class) EnterpriseDto enterprise);
-
-   /*********************** Cloud ***********************/
-
-   /**
-    * Retrieves list of virtual appliances by the given enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @return The list of virtual appliances of the enterprise.
-    */
-   @Named("enterprise:listvapps")
-   @GET
-   @Consumes(VirtualAppliancesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualAppliancesDto listVirtualAppliances(
-         @EndpointLink("virtualappliances") @BinderParam(BindToPath.class) final EnterpriseDto enterprise);
-
-   /**
-    * List virtual machines for the enterprise
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @return The list of virtual machines by the enterprise.
-    */
-   @Named("enterprise:listvms")
-   @GET
-   @Consumes(VirtualMachinesWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualMachinesWithNodeExtendedDto listVirtualMachines(
-         @EndpointLink("virtualmachines") @BinderParam(BindToPath.class) EnterpriseDto enterprise);
-
-   /**
-    * List reserved machines for the enterprise
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @return The list of reserved machines by the enterprise.
-    */
-   @Named("enterprise:listreservedmachines")
-   @GET
-   @Consumes(MachinesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   MachinesDto listReservedMachines(
-         @EndpointLink("reservedmachines") @BinderParam(BindToPath.class) EnterpriseDto enterprise);
-
-   /**
-    * List all template definitions in apps library.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @return The list of template definitions by the enterprise.
-    */
-   @Named("templatedefinitionlist:list")
-   @GET
-   @Consumes(TemplateDefinitionListsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   TemplateDefinitionListsDto listTemplateDefinitionLists(
-         @EndpointLink("appslib/templateDefinitionLists") @BinderParam(BindToPath.class) EnterpriseDto enterprise);
-
-   /**
-    * Create a new template definition list in apps library in the given
-    * enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @param template
-    *           The template to be created.
-    * @return The created template.
-    */
-   @Named("templatedefinitionlist:create")
-   @POST
-   @Produces(TemplateDefinitionListDto.BASE_MEDIA_TYPE)
-   @Consumes(TemplateDefinitionListDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   TemplateDefinitionListDto createTemplateDefinitionList(
-         @EndpointLink("appslib/templateDefinitionLists") @BinderParam(BindToPath.class) EnterpriseDto enterprise,
-         @BinderParam(BindToXMLPayload.class) TemplateDefinitionListDto templateList);
-
-   /**
-    * Update an existing template definition list in apps library.
-    * 
-    * @param template
-    *           The template to be update.
-    * @return The updated template.
-    */
-   @Named("templatedefinitionlist:update")
-   @PUT
-   @Produces(TemplateDefinitionListDto.BASE_MEDIA_TYPE)
-   @Consumes(TemplateDefinitionListDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   TemplateDefinitionListDto updateTemplateDefinitionList(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) TemplateDefinitionListDto templateList);
-
-   /**
-    * Deletes existing user.
-    * 
-    * @param user
-    *           The user to delete.
-    */
-   @Named("templatedefinitionlist:delete")
-   @DELETE
-   void deleteTemplateDefinitionList(
-         @EndpointLink("edit") @BinderParam(BindToPath.class) TemplateDefinitionListDto templateList);
-
-   /**
-    * Get the given template definition list from the given enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise.
-    * @param templateListId
-    *           The id of the template definition list.
-    * @return The list or <code>null</code> if it does not exist.
-    */
-   @Named("templatedefinitionlist:get")
-   @GET
-   @Consumes(TemplateDefinitionListDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   TemplateDefinitionListDto getTemplateDefinitionList(
-         @EndpointLink("appslib/templateDefinitionLists") @BinderParam(BindToPath.class) EnterpriseDto enterprise,
-         @BinderParam(AppendToPath.class) Integer templateListId);
-
-   /**
-    * Get the list of status of a template definition list in a datacenter.
-    * 
-    * @param templateList
-    *           The template definition list.
-    * @param datacenter
-    *           The given datacenter.
-    * @return The list of states.
-    */
-   @Named("templatedefinitionlist:status")
-   @GET
-   @Consumes(TemplatesStateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   TemplatesStateDto listTemplateListStatus(
-         @EndpointLink("repositoryStatus") @BinderParam(BindToPath.class) TemplateDefinitionListDto templateList,
-         @QueryParam("datacenterId") @ParamParser(ParseDatacenterId.class) DatacenterDto datacenter);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/EventApi.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/EventApi.java b/abiquo/src/main/java/org/jclouds/abiquo/features/EventApi.java
deleted file mode 100644
index 5b4d6d0..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/EventApi.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import java.io.Closeable;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.event.options.EventOptions;
-import org.jclouds.abiquo.functions.pagination.ParseEvents;
-import org.jclouds.abiquo.http.filters.AbiquoAuthentication;
-import org.jclouds.abiquo.http.filters.AppendApiVersionToMediaType;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.Transform;
-
-import com.abiquo.server.core.event.EventDto;
-import com.abiquo.server.core.event.EventsDto;
-
-/**
- * Provides synchronous access to Abiquo Event API.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/API+Reference">
- *      http://community.abiquo.com/display/ABI20/API+Reference</a>
- */
-@RequestFilters({ AbiquoAuthentication.class, AppendApiVersionToMediaType.class })
-@Path("/events")
-public interface EventApi extends Closeable {
-   /**
-    * List events.
-    * 
-    * @return The list of events.
-    */
-   @Named("event:list")
-   @GET
-   @Consumes(EventsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseEvents.class)
-   @Transform(ParseEvents.ToPagedIterable.class)
-   PagedIterable<EventDto> listEvents();
-
-   /**
-    * List events using filters.
-    * 
-    * @return The list of events using filters.
-    */
-   @Named("event:list")
-   @GET
-   @Consumes(EventsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseEvents.class)
-   PaginatedCollection<EventDto, EventsDto> listEvents(EventOptions options);
-}


[08/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/UserLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/UserLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/UserLiveApiTest.java
deleted file mode 100644
index d113abc..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/enterprise/UserLiveApiTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.enterprise;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.fail;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.enterprise.UserDto;
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link User} domain class.
- */
-@Test(groups = "api", testName = "UserLiveApiTest")
-public class UserLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   public void testUpdate() {
-      String username = env.user.getName();
-      env.user.setName("Manolo");
-      env.user.update();
-
-      // Recover the updated user
-      UserDto updated = env.enterpriseApi.getUser(env.enterprise.unwrap(), env.user.getId());
-
-      assertEquals(updated.getName(), "Manolo");
-
-      env.user.setName(username);
-      env.user.update();
-   }
-
-   public void testCreateRepeated() {
-      User repeated = User.Builder.fromUser(env.user).build();
-
-      try {
-         repeated.save();
-         fail("Should not be able to create users with the same nick");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "USER-4");
-      }
-   }
-
-   public void testChangeRoleAndUpdate() {
-      env.user.setRole(env.anotherRole);
-      env.user.update();
-
-      Role role2 = find(env.enterprise.listUsers(), nick(env.user.getNick())).getRole();
-
-      assertEquals(env.anotherRole.getId(), role2.getId());
-      assertEquals(role2.getName(), "Another role");
-
-      env.user.setRole(env.role);
-      env.user.update();
-   }
-
-   public void testListUser() {
-      Iterable<User> users = env.enterprise.listUsers();
-      assertEquals(size(users), 2);
-
-      users = filter(env.enterprise.listUsers(), nick(env.user.getNick()));
-      assertEquals(size(users), 1);
-
-      users = filter(env.enterprise.listUsers(), nick(env.user.getName() + "FAIL"));
-      assertEquals(size(users), 0);
-   }
-
-   public void testGetCurrentUser() {
-      User user = env.context.getAdministrationService().getCurrentUser();
-      assertNotNull(user);
-      assertEquals(user.getNick(), env.context.getApiContext().getIdentity());
-   }
-
-   private static Predicate<User> nick(final String nick) {
-      return new Predicate<User>() {
-         @Override
-         public boolean apply(User input) {
-            return input.getNick().equals(nick);
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/event/EventLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/event/EventLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/event/EventLiveApiTest.java
deleted file mode 100644
index 33fe3a9..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/event/EventLiveApiTest.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.event;
-
-import static com.google.common.collect.Iterables.find;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-
-import java.util.Date;
-import java.util.UUID;
-
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.cloud.Volume;
-import org.jclouds.abiquo.domain.enterprise.User;
-import org.jclouds.abiquo.domain.event.options.EventOptions;
-import org.jclouds.abiquo.domain.infrastructure.Tier;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.ComponentType;
-import com.abiquo.model.enumerator.EventType;
-import com.abiquo.model.enumerator.SeverityType;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-
-/**
- * Live integration tests for the {@link Event} domain class.
- */
-@Test(groups = "api", testName = "EventLiveApiTest")
-public class EventLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   public void testListEventsFilteredByDatacenter() {
-      String name = randomName();
-      env.datacenter.setName(name);
-      env.datacenter.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).datacenterName(name).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByRack() {
-      String name = randomName();
-      env.rack.setName(name);
-      env.rack.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).rackName(name).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByPM() {
-      String name = randomName();
-      env.machine.setName(name);
-      env.machine.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).physicalMachineName(name).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByStorageDevice() {
-      String name = randomName();
-      env.storageDevice.setName(name);
-      env.storageDevice.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).storageSystemName(name).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByStoragePool() {
-      Tier tier = find(env.datacenter.listTiers(), new Predicate<Tier>() {
-         @Override
-         public boolean apply(Tier input) {
-            return input.getName().equals("Default Tier 2");
-         }
-      });
-
-      try {
-         env.storagePool.setTier(tier);
-         env.storagePool.update();
-
-         EventOptions options = EventOptions.builder().dateFrom(new Date()).storagePoolName(env.storagePool.getName())
-               .build();
-         assertEvents(options);
-      } finally {
-         // Restore the original tier
-         env.storagePool.setTier(env.tier);
-         env.storagePool.update();
-      }
-   }
-
-   public void testListEventsFilteredByEnterprise() {
-      String entName = env.enterprise.getName();
-      String name = randomName();
-      env.enterprise.setName(name);
-      env.enterprise.update();
-
-      // Enterprise current =
-      // env.enterpriseAdminContext.getAdministrationService().getCurrentEnterprise();
-      // current.setName("Enterprise updated");
-      // current.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).enterpriseName(name).build();
-      assertEvents(options);
-
-      env.enterprise.setName(entName);
-      env.enterprise.update();
-   }
-
-   /**
-    * TODO: Using the painUserContext, modifying the user returns this error:
-    * HTTP/1.1 401 Unauthorized
-    **/
-   @Test(enabled = false)
-   public void testListEventsFilteredByUser() {
-      User current = env.plainUserContext.getAdministrationService().getCurrentUser();
-      current.setEmail("test@test.com");
-      current.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).userName(current.getName()).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByVDC() {
-      String name = randomName();
-      env.virtualDatacenter.setName(name);
-      env.virtualDatacenter.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).virtualDatacenterName(name).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByVapp() {
-      String name = randomName();
-      env.virtualAppliance.setName(name);
-      env.virtualAppliance.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).virtualAppName(name).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByVM() {
-      VirtualMachine vm = createVirtualMachine();
-      vm.delete();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).actionPerformed(EventType.VM_DELETE).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByVolume() {
-      String name = randomName();
-      Volume volume = createVolume();
-      volume.setName(name);
-      volume.update();
-      volume.delete(); // We don't need it any more. events already exist
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).volumeName(name).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredBySeverity() {
-      String name = randomName();
-      env.virtualAppliance.setName(name);
-      env.virtualAppliance.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).virtualAppName(name)
-            .severity(SeverityType.INFO).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByActionPerformed() {
-      String name = randomName();
-      env.virtualAppliance.setName(name);
-      env.virtualAppliance.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).virtualAppName(name)
-            .actionPerformed(EventType.VAPP_MODIFY).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByComponent() {
-      String name = randomName();
-      env.virtualAppliance.setName(name);
-      env.virtualAppliance.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).virtualAppName(name)
-            .component(ComponentType.VIRTUAL_APPLIANCE).build();
-      assertEvents(options);
-   }
-
-   public void testListEventsFilteredByDescription() {
-      String name = randomName();
-      env.virtualAppliance.setName(name);
-      env.virtualAppliance.update();
-
-      EventOptions options = EventOptions.builder().dateFrom(new Date()).virtualAppName(name)
-            .description("Virtual appliance '" + name + "' has been modified.").build();
-      assertEvents(options);
-   }
-
-   // Helpers
-
-   private void assertEvents(final EventOptions options) {
-      Iterable<Event> events = env.eventService.listEvents(options);
-      assertTrue(Iterables.size(events) >= 1);
-   }
-
-   private Volume createVolume() {
-      Tier tier = find(env.virtualDatacenter.listStorageTiers(), new Predicate<Tier>() {
-         @Override
-         public boolean apply(Tier input) {
-            return input.getName().equals(env.tier.getName());
-         }
-      });
-
-      Volume volume = Volume.builder(env.context.getApiContext(), env.virtualDatacenter, tier)
-            .name(PREFIX + "Event vol").sizeInMb(32).build();
-
-      volume.save();
-      assertNotNull(volume.getId());
-
-      return volume;
-   }
-
-   private VirtualMachine createVirtualMachine() {
-      VirtualMachine virtualMachine = VirtualMachine
-            .builder(env.context.getApiContext(), env.virtualAppliance, env.template).cpu(2).ram(128)
-            .nameLabel(PREFIX + "events").build();
-
-      virtualMachine.save();
-      assertNotNull(virtualMachine.getId());
-
-      return virtualMachine;
-   }
-
-   private static String randomName() {
-      return PREFIX + UUID.randomUUID().toString().substring(0, 12);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/DatacenterLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/DatacenterLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/DatacenterLiveApiTest.java
deleted file mode 100644
index b80b485..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/DatacenterLiveApiTest.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.enterprise.Limits;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter.Builder;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-
-/**
- * Live integration tests for the {@link Datacenter} domain class.
- */
-@Test(groups = "api", testName = "DatacenterLiveApiTest")
-public class DatacenterLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   public void testUpdate() {
-      env.datacenter.setLocation("New York");
-      env.datacenter.update();
-
-      // Recover the updated datacenter
-      DatacenterDto updated = env.infrastructureApi.getDatacenter(env.datacenter.getId());
-
-      assertEquals(updated.getLocation(), "New York");
-   }
-
-   public void testCheckHypervisorType() {
-      HypervisorType type = env.datacenter.getHypervisorType(env.machine.getIp());
-
-      assertEquals(env.machine.getType(), type);
-   }
-
-   public void testCreateRepeated() {
-      Datacenter repeated = Builder.fromDatacenter(env.datacenter).build();
-
-      try {
-         repeated.save();
-         fail("Should not be able to create datacenters with the same name");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "DC-3");
-      }
-   }
-
-   public void testListLimits() {
-      Iterable<Limits> limits = env.datacenter.listLimits();
-      assertNotNull(limits);
-      assertTrue(size(limits) > 0);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/MachineLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/MachineLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/MachineLiveApiTest.java
deleted file mode 100644
index 00e9ea6..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/MachineLiveApiTest.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.collect.Iterables.find;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-
-import java.net.URI;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.jclouds.abiquo.util.Config;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.enumerator.MachineState;
-import com.abiquo.model.enumerator.RemoteServiceType;
-import com.abiquo.server.core.infrastructure.MachineDto;
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link Machine} domain class.
- */
-@Test(groups = "api", testName = "MachineLiveApiTest")
-public class MachineLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   public void testDiscoverMachineWithouRemoteService() {
-      // Delete node collector
-      RemoteService nc = find(env.datacenter.listRemoteServices(), new Predicate<RemoteService>() {
-         @Override
-         public boolean apply(RemoteService input) {
-            return input.getType().equals(RemoteServiceType.NODE_COLLECTOR);
-         }
-      });
-      nc.delete();
-
-      try {
-         String ip = Config.get("abiquo.hypervisor.address");
-         HypervisorType type = HypervisorType.valueOf(Config.get("abiquo.hypervisor.type"));
-         String user = Config.get("abiquo.hypervisor.user");
-         String pass = Config.get("abiquo.hypervisor.pass");
-
-         env.datacenter.discoverSingleMachine(ip, type, user, pass);
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.NOT_FOUND, "RS-2");
-      }
-
-      URI endpoint = URI.create(env.context.getApiContext().getProviderMetadata().getEndpoint());
-
-      // Restore rs
-      nc = RemoteService.builder(env.context.getApiContext(), env.datacenter).type(RemoteServiceType.NODE_COLLECTOR)
-            .ip(endpoint.getHost()).build();
-      nc.save();
-   }
-
-   public void testUpdate() {
-      env.machine.setName("API Machine");
-      env.machine.update();
-
-      // Recover the updated machine
-      MachineDto updated = env.infrastructureApi.getMachine(env.rack.unwrap(), env.machine.getId());
-      assertEquals(updated.getName(), "API Machine");
-   }
-
-   public void testCheck() {
-      MachineState state = env.machine.check();
-
-      // Recover the machine with same state that has been returned
-      MachineDto machine = env.infrastructureApi.getMachine(env.rack.unwrap(), env.machine.getId());
-      assertEquals(machine.getState(), state);
-   }
-
-   public void testCheckFromDatacenter() {
-      String ip = Config.get("abiquo.hypervisor.address");
-      HypervisorType type = HypervisorType.valueOf(Config.get("abiquo.hypervisor.type"));
-      String user = Config.get("abiquo.hypervisor.user");
-      String pass = Config.get("abiquo.hypervisor.pass");
-
-      MachineState state = env.datacenter.checkMachineState(ip, type, user, pass);
-
-      // Recover the same machine and compare states
-      MachineDto machine = env.infrastructureApi.getMachine(env.rack.unwrap(), env.machine.getId());
-      assertEquals(machine.getState(), state);
-   }
-
-   public void testGetRack() {
-      Rack rack = env.machine.getRack();
-      assertNotNull(rack);
-      assertEquals(rack.getId(), env.rack.getId());
-   }
-
-   public void testListVirtualMachines() {
-      Iterable<VirtualMachine> machines = env.machine.listRemoteVirtualMachines();
-      assertNotNull(machines);
-   }
-
-   public void testReserveMachine() {
-      assertFalse(env.machine.isReserved());
-
-      env.machine.reserveFor(env.enterprise);
-      assertTrue(env.machine.isReserved());
-
-      Enterprise owner = env.machine.getOwnerEnterprise();
-      assertNotNull(owner);
-      assertEquals(owner.getId(), env.enterprise.getId());
-   }
-
-   @Test(dependsOnMethods = "testReserveMachine")
-   public void testCancelReservation() {
-      env.machine.cancelReservationFor(env.enterprise);
-      assertFalse(env.machine.isReserved());
-
-      Enterprise owner = env.machine.getOwnerEnterprise();
-      assertNull(owner);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/NetworkServiceTypeLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/NetworkServiceTypeLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/NetworkServiceTypeLiveApiTest.java
deleted file mode 100644
index 6abddcb..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/NetworkServiceTypeLiveApiTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.abiquo.domain.network.NetworkServiceType;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-/**
- * Live integration tests for the {@link NetworkServiceType} domain class.
- */
-@Test(groups = "api", testName = "NetworkServiceTypeLiveApiTest")
-public class NetworkServiceTypeLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   private NetworkServiceType nst = null;
-
-   @Test
-   public void testCreate() {
-      nst = NetworkServiceType.builder(env.context.getApiContext(), env.datacenter).name("Storage Network").build();
-      nst.save();
-
-      assertNotNull(nst.getId());
-      NetworkServiceType copy = env.datacenter.getNetworkServiceType(nst.getId());
-      assertEquals(copy.getName(), nst.getName());
-
-   }
-
-   @Test(dependsOnMethods = "testCreate")
-   public void testUpdate() {
-      nst.setName("Storage Network Updated");
-      nst.update();
-
-      NetworkServiceType copy = env.datacenter.getNetworkServiceType(nst.getId());
-      assertEquals(copy.getName(), nst.getName());
-   }
-
-   @Test(dependsOnMethods = "testUpdate")
-   public void testDelete() {
-      Integer deleteId = nst.getId();
-      nst.delete();
-
-      // Assert it is deleted
-      assertNull(env.datacenter.getNetworkServiceType(deleteId));
-
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/RackLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/RackLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/RackLiveApiTest.java
deleted file mode 100644
index a916e0b..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/RackLiveApiTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.infrastructure.RackDto;
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link Rack} domain class.
- */
-@Test(groups = "api", testName = "RackLiveApiTest")
-public class RackLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   public void testUpdate() {
-      env.rack.setName("Updated rack");
-      env.rack.update();
-
-      // Recover the updated rack
-      RackDto updated = env.infrastructureApi.getRack(env.datacenter.unwrap(), env.rack.getId());
-
-      assertEquals(updated.getName(), "Updated rack");
-   }
-
-   public void testListRacks() {
-      Iterable<Rack> racks = env.datacenter.listRacks();
-      assertEquals(size(racks), 1);
-
-      racks = filter(env.datacenter.listRacks(), name(env.rack.getName()));
-      assertEquals(size(racks), 1);
-
-      racks = filter(env.datacenter.listRacks(), name(env.rack.getName() + "FAIL"));
-      assertEquals(size(racks), 0);
-   }
-
-   private static Predicate<Rack> name(final String name) {
-      return new Predicate<Rack>() {
-         @Override
-         public boolean apply(Rack input) {
-            return input.getName().equals(name);
-         }
-      };
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/RemoteServiceLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/RemoteServiceLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/RemoteServiceLiveApiTest.java
deleted file mode 100644
index 7a45ffe..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/RemoteServiceLiveApiTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.get;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.assertTrue;
-import static org.testng.Assert.fail;
-
-import java.net.URI;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.infrastructure.RemoteService.Builder;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.RemoteServiceType;
-import com.abiquo.server.core.infrastructure.RemoteServiceDto;
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link RemoteService} domain class.
- */
-@Test(groups = "api", testName = "RemoteServiceLiveApiTest")
-public class RemoteServiceLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   public void testUpdate() {
-      // Update the remote service
-      RemoteService rs = find(env.datacenter.listRemoteServices(), type(RemoteServiceType.VIRTUAL_FACTORY));
-      rs.setUri(rs.getUri());
-      rs.update();
-
-      // Recover the updated remote service
-      RemoteServiceDto updated = env.infrastructureApi.getRemoteService(env.datacenter.unwrap(),
-            RemoteServiceType.VIRTUAL_FACTORY);
-
-      assertEquals(updated.getUri(), rs.getUri());
-   }
-
-   public void testDelete() {
-      RemoteService rs = find(env.datacenter.listRemoteServices(), type(RemoteServiceType.BPM_SERVICE));
-      rs.delete();
-
-      // Recover the deleted remote service
-      RemoteServiceDto deleted = env.infrastructureApi.getRemoteService(env.datacenter.unwrap(),
-            RemoteServiceType.BPM_SERVICE);
-
-      assertNull(deleted);
-
-      URI endpoint = URI.create(env.context.getApiContext().getProviderMetadata().getEndpoint());
-
-      // Restore rs
-      RemoteService bpm = RemoteService.builder(env.context.getApiContext(), env.datacenter)
-            .type(RemoteServiceType.BPM_SERVICE).ip(endpoint.getHost()).build();
-      bpm.save();
-   }
-
-   public void testIsAvailableNonCheckeable() {
-      RemoteService rs = find(env.datacenter.listRemoteServices(), type(RemoteServiceType.DHCP_SERVICE));
-      assertTrue(rs.isAvailable());
-   }
-
-   public void testIsAvailable() {
-      RemoteService rs = find(env.datacenter.listRemoteServices(), type(RemoteServiceType.NODE_COLLECTOR));
-      assertTrue(rs.isAvailable());
-   }
-
-   public void testCreateRepeated() {
-      RemoteService repeated = Builder.fromRemoteService(get(env.remoteServices, 1)).build();
-
-      try {
-         repeated.save();
-         fail("Should not be able to create duplicated remote services in the datacenter");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "RS-6");
-      }
-   }
-
-   public void testListRemoteServices() {
-      Iterable<RemoteService> remoteServices = env.datacenter.listRemoteServices();
-      assertEquals(size(remoteServices), size(env.remoteServices));
-
-      remoteServices = filter(env.datacenter.listRemoteServices(), type(RemoteServiceType.NODE_COLLECTOR));
-      assertEquals(size(remoteServices), 1);
-   }
-
-   private static Predicate<RemoteService> type(final RemoteServiceType type) {
-      return new Predicate<RemoteService>() {
-         @Override
-         public boolean apply(RemoteService input) {
-            return input.getType().equals(type);
-         }
-      };
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/StorageDeviceLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/StorageDeviceLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/StorageDeviceLiveApiTest.java
deleted file mode 100644
index a22fddb..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/StorageDeviceLiveApiTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.infrastructure.storage.StorageDeviceDto;
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link StorageDevice} domain class.
- */
-@Test(groups = "api", testName = "StorageDeviceLiveApiTest")
-public class StorageDeviceLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   public void testUpdate() {
-      env.storageDevice.setName("Updated storage device");
-      env.storageDevice.update();
-
-      // Recover the updated storage device
-      StorageDeviceDto updated = env.infrastructureApi.getStorageDevice(env.datacenter.unwrap(),
-            env.storageDevice.getId());
-
-      assertEquals(updated.getName(), "Updated storage device");
-   }
-
-   public void testListStorageDevices() {
-      Iterable<StorageDevice> storageDevices = env.datacenter.listStorageDevices();
-      assertEquals(size(storageDevices), 1);
-
-      storageDevices = filter(env.datacenter.listStorageDevices(), name(env.storageDevice.getName()));
-      assertEquals(size(storageDevices), 1);
-
-      storageDevices = filter(env.datacenter.listStorageDevices(), name(env.storageDevice.getName() + "FAIL"));
-      assertEquals(size(storageDevices), 0);
-   }
-
-   private static Predicate<StorageDevice> name(final String name) {
-      return new Predicate<StorageDevice>() {
-         @Override
-         public boolean apply(StorageDevice input) {
-            return input.getName().equals(name);
-         }
-      };
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/StoragePoolLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/StoragePoolLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/StoragePoolLiveApiTest.java
deleted file mode 100644
index 0c3bdc0..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/StoragePoolLiveApiTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link StorageDevice} domain class.
- */
-@Test(groups = "api", testName = "StoragePoolLiveApiTest")
-public class StoragePoolLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   public void testGetDevice() {
-      StorageDevice device = env.storagePool.getStorageDevice();
-      assertNotNull(device);
-      assertEquals(device.getId(), env.storageDevice.getId());
-   }
-
-   public void testUpdate() {
-      try {
-         Tier tier3 = find(env.datacenter.listTiers(), new Predicate<Tier>() {
-            @Override
-            public boolean apply(Tier input) {
-               return input.getName().equals("Default Tier 3");
-            }
-         });
-         env.storagePool.setTier(tier3);
-         env.storagePool.update();
-
-         assertEquals(env.storagePool.getTier().getName(), "Default Tier 3");
-      } finally {
-         // Restore the original tier
-         env.storagePool.setTier(env.tier);
-         env.storagePool.update();
-         assertEquals(env.storagePool.getTier().getId(), env.tier.getId());
-      }
-   }
-
-   public void testListStoragePool() {
-      Iterable<StoragePool> storagePools = env.storageDevice.listStoragePools();
-      assertEquals(size(storagePools), 1);
-
-      storagePools = filter(env.storageDevice.listStoragePools(), name(env.storagePool.getName()));
-      assertEquals(size(storagePools), 1);
-
-      storagePools = filter(env.storageDevice.listStoragePools(), name(env.storagePool.getName() + "FAIL"));
-      assertEquals(size(storagePools), 0);
-   }
-
-   public void testRefreshStoragePool() {
-      env.storagePool.refresh();
-   }
-
-   private static Predicate<StoragePool> name(final String name) {
-      return new Predicate<StoragePool>() {
-         @Override
-         public boolean apply(StoragePool input) {
-            return input.getName().equals(name);
-         }
-      };
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/TierLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/TierLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/TierLiveApiTest.java
deleted file mode 100644
index de5460b..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/infrastructure/TierLiveApiTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.infrastructure;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.getLast;
-import static com.google.common.collect.Iterables.size;
-import static org.testng.Assert.assertEquals;
-
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link StorageDevice} domain class.
- */
-@Test(groups = "api", testName = "TierLiveApiTest")
-public class TierLiveApiTest extends BaseAbiquoApiLiveApiTest {
-
-   public void testUpdate() {
-      Tier tier = getLast(env.datacenter.listTiers());
-
-      String previousName = tier.getName();
-      tier.setName("Updated tier");
-      tier.update();
-
-      // Verify the tier has been updated
-      find(env.datacenter.listTiers(), name("Updated tier"));
-
-      // Restore the original name
-      tier.setName(previousName);
-      tier.update();
-   }
-
-   public void testListTiers() {
-      Iterable<Tier> tiers = env.datacenter.listTiers();
-      assertEquals(size(tiers), 4);
-
-      tiers = filter(env.datacenter.listTiers(), name("FAIL"));
-      assertEquals(size(tiers), 0);
-   }
-
-   private static Predicate<Tier> name(final String name) {
-      return new Predicate<Tier>() {
-         @Override
-         public boolean apply(Tier input) {
-            return input.getName().equals(name);
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/network/ExternalNetworkLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/network/ExternalNetworkLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/network/ExternalNetworkLiveApiTest.java
deleted file mode 100644
index 34e3afe..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/network/ExternalNetworkLiveApiTest.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.fail;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.jclouds.abiquo.predicates.IpPredicates;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.infrastructure.network.ExternalIpDto;
-import com.abiquo.server.core.infrastructure.network.ExternalIpsDto;
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link ExternalNetwork} domain class.
- */
-@Test(groups = "api", testName = "ExternalNetworkLiveApiTest")
-public class ExternalNetworkLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   private ExternalNetwork externalNetwork;
-
-   @BeforeClass
-   public void setupNetwork() {
-      externalNetwork = createNetwork(env.externalNetwork, PREFIX + "-externalnetwork-test");
-   }
-
-   @AfterClass
-   public void tearDownNetwork() {
-      externalNetwork.delete();
-   }
-
-   public void testListIps() {
-      PaginatedCollection<ExternalIpDto, ExternalIpsDto> ipsDto = env.context.getApiContext().getApi()
-            .getInfrastructureApi().listExternalIps(externalNetwork.unwrap(), IpOptions.builder().limit(1).build());
-      int totalIps = ipsDto.getTotalSize();
-
-      Iterable<ExternalIp> ips = externalNetwork.listIps();
-      assertEquals(size(ips), totalIps);
-   }
-
-   public void testListIpsWithOptions() {
-      Iterable<ExternalIp> ips = externalNetwork.listIps(IpOptions.builder().limit(5).build());
-      assertEquals(size(ips), 5);
-   }
-
-   public void testListUnusedIps() {
-      PaginatedCollection<ExternalIpDto, ExternalIpsDto> ipsDto = env.context.getApiContext().getApi()
-            .getInfrastructureApi().listExternalIps(externalNetwork.unwrap(), IpOptions.builder().limit(1).build());
-      int totalIps = ipsDto.getTotalSize();
-
-      Iterable<ExternalIp> ips = externalNetwork.listUnusedIps();
-      assertEquals(size(ips), totalIps);
-   }
-
-   public void testUpdateBasicInfo() {
-      externalNetwork.setName("External network Updated");
-      externalNetwork.setPrimaryDNS("8.8.8.8");
-      externalNetwork.setSecondaryDNS("8.8.8.8");
-      externalNetwork.update();
-
-      assertEquals(externalNetwork.getName(), "External network Updated");
-      assertEquals(externalNetwork.getPrimaryDNS(), "8.8.8.8");
-      assertEquals(externalNetwork.getSecondaryDNS(), "8.8.8.8");
-
-      // Refresh the external network
-      ExternalNetwork en = find(env.enterprise.listExternalNetworks(env.datacenter), new Predicate<ExternalNetwork>() {
-         @Override
-         public boolean apply(ExternalNetwork input) {
-            return input.getName().equals(externalNetwork.getName());
-         }
-      });
-
-      assertEquals(en.getId(), externalNetwork.getId());
-      assertEquals(en.getName(), "External network Updated");
-      assertEquals(en.getPrimaryDNS(), "8.8.8.8");
-      assertEquals(en.getSecondaryDNS(), "8.8.8.8");
-   }
-
-   public void testUpdateReadOnlyFields() {
-      ExternalNetwork toUpdate = createNetwork(externalNetwork, PREFIX + "-exttoupdate-test");
-
-      try {
-         toUpdate.setTag(20);
-         toUpdate.setAddress("10.1.0.0");
-         toUpdate.setMask(16);
-         toUpdate.update();
-
-         fail("Tag field should not be editable");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "VLAN-19");
-      } finally {
-         toUpdate.delete();
-      }
-   }
-
-   public void testUpdateWithInvalidValues() {
-      ExternalNetwork toUpdate = createNetwork(externalNetwork, PREFIX + "-exttoupdate-test");
-
-      try {
-         toUpdate.setMask(60);
-         toUpdate.update();
-
-         fail("Invalid mask value");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.BAD_REQUEST, "CONSTR-MAX");
-      } finally {
-         toUpdate.delete();
-      }
-   }
-
-   public void testGetEnterprise() {
-      assertEquals(externalNetwork.getEnterprise().getId(), env.enterprise.getId());
-   }
-
-   public void testGetDatacenter() {
-      assertEquals(externalNetwork.getDatacenter().getId(), env.datacenter.getId());
-   }
-
-   public void testGetNetworkFromIp() {
-      ExternalIp ip = find(externalNetwork.listIps(), IpPredicates.<ExternalIp> notUsed());
-      ExternalNetwork network = ip.getNetwork();
-
-      assertEquals(network.getId(), externalNetwork.getId());
-   }
-
-   private ExternalNetwork createNetwork(final ExternalNetwork from, final String name) {
-      ExternalNetwork network = ExternalNetwork.Builder.fromExternalNetwork(from).build();
-      network.setName(name);
-      network.save();
-      assertNotNull(network.getId());
-      return network;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/network/GenericNetworkLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/network/GenericNetworkLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/network/GenericNetworkLiveApiTest.java
deleted file mode 100644
index 1f8f3d1..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/network/GenericNetworkLiveApiTest.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.collect.Iterables.get;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.enumerator.NetworkType;
-
-/**
- * Live integration tests for the {@link Network} domain class.
- */
-@Test(groups = "api", testName = "GenericNetworkLiveApiTest")
-public class GenericNetworkLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   public void testListDatacenterNetworks() {
-      // Make sure all network types are listed
-      Iterable<Network<?>> networks = env.datacenter.listNetworks();
-      assertNotNull(networks);
-      assertEquals(size(networks), 3);
-   }
-
-   public void testListPublicNetworks() {
-      Iterable<Network<?>> networks = env.datacenter.listNetworks(NetworkType.PUBLIC);
-      assertNotNull(networks);
-      assertEquals(size(networks), 1);
-
-      // Make sure it can be converted
-      get(networks, 0).toPublicNetwork();
-   }
-
-   public void testListExternaletworks() {
-      Iterable<Network<?>> networks = env.datacenter.listNetworks(NetworkType.EXTERNAL);
-      assertNotNull(networks);
-      assertEquals(size(networks), 1);
-
-      // Make sure it can be converted
-      get(networks, 0).toExternalNetwork();
-   }
-
-   public void testListUnmanagedNetworks() {
-      Iterable<Network<?>> networks = env.datacenter.listNetworks(NetworkType.UNMANAGED);
-      assertNotNull(networks);
-      assertEquals(size(networks), 1);
-
-      // Make sure it can be converted
-      get(networks, 0).toUnmanagedNetwork();
-   }
-
-   public void testListPrivateNetworks() {
-      try {
-         env.datacenter.listNetworks(NetworkType.INTERNAL);
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.BAD_REQUEST, "QUERY-1");
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/network/PrivateNetworkLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/network/PrivateNetworkLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/network/PrivateNetworkLiveApiTest.java
deleted file mode 100644
index 532a919..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/network/PrivateNetworkLiveApiTest.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.fail;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.jclouds.abiquo.predicates.IpPredicates;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpsDto;
-
-/**
- * Live integration tests for the {@link PrivateNetwork} domain class.
- */
-@Test(groups = "api", testName = "PrivateNetworkLiveApiTest")
-public class PrivateNetworkLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   private PrivateNetwork privateNetwork;
-
-   @BeforeClass
-   public void setupNetwork() {
-      privateNetwork = createNetwork(env.virtualDatacenter, env.privateNetwork, PREFIX + "-privatenetwork-test");
-   }
-
-   @AfterClass
-   public void tearDownNetwork() {
-      privateNetwork.delete();
-   }
-
-   public void testListIps() {
-      PaginatedCollection<PrivateIpDto, PrivateIpsDto> ipsDto = env.context.getApiContext().getApi().getCloudApi()
-            .listPrivateNetworkIps(privateNetwork.unwrap(), IpOptions.builder().limit(1).build());
-      int totalIps = ipsDto.getTotalSize();
-
-      Iterable<PrivateIp> ips = privateNetwork.listIps();
-      assertEquals(size(ips), totalIps);
-   }
-
-   public void testListIpsWithOptions() {
-      Iterable<PrivateIp> ips = privateNetwork.listIps(IpOptions.builder().limit(5).build());
-      assertEquals(size(ips), 5);
-   }
-
-   public void testListUnusedIps() {
-      PaginatedCollection<PrivateIpDto, PrivateIpsDto> ipsDto = env.context.getApiContext().getApi().getCloudApi()
-            .listPrivateNetworkIps(privateNetwork.unwrap(), IpOptions.builder().limit(1).build());
-      int totalIps = ipsDto.getTotalSize();
-
-      Iterable<PrivateIp> ips = privateNetwork.listUnusedIps();
-      assertEquals(size(ips), totalIps);
-   }
-
-   public void testUpdateBasicInfo() {
-      privateNetwork.setName("Private network Updated");
-      privateNetwork.setPrimaryDNS("8.8.8.8");
-      privateNetwork.setSecondaryDNS("8.8.8.8");
-      privateNetwork.update();
-
-      assertEquals(privateNetwork.getName(), "Private network Updated");
-      assertEquals(privateNetwork.getPrimaryDNS(), "8.8.8.8");
-      assertEquals(privateNetwork.getSecondaryDNS(), "8.8.8.8");
-
-      // Refresh the private network
-      PrivateNetwork pn = env.virtualDatacenter.getPrivateNetwork(privateNetwork.getId());
-
-      assertEquals(pn.getName(), "Private network Updated");
-      assertEquals(pn.getPrimaryDNS(), "8.8.8.8");
-      assertEquals(pn.getSecondaryDNS(), "8.8.8.8");
-   }
-
-   public void testUpdateReadOnlyFields() {
-      PrivateNetwork toUpdate = createNetwork(env.virtualDatacenter, privateNetwork, PREFIX + "-privtoupdate-test");
-
-      try {
-         toUpdate.setTag(20);
-         toUpdate.setAddress("10.1.1.0");
-         toUpdate.setMask(16);
-         toUpdate.update();
-
-         fail("Tag field should not be editable");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "VLAN-10");
-      } finally {
-         toUpdate.delete();
-      }
-   }
-
-   public void testUpdateWithInvalidValues() {
-      PrivateNetwork toUpdate = createNetwork(env.virtualDatacenter, privateNetwork, PREFIX + "-privtoupdate-test");
-
-      try {
-         toUpdate.setMask(60);
-         toUpdate.update();
-
-         fail("Invalid mask value");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.BAD_REQUEST, "CONSTR-MAX");
-      } finally {
-         toUpdate.delete();
-      }
-   }
-
-   public void testGetNetworkFromIp() {
-      PrivateIp ip = find(privateNetwork.listIps(), IpPredicates.<PrivateIp> notUsed());
-      PrivateNetwork network = ip.getNetwork();
-
-      assertEquals(network.getId(), privateNetwork.getId());
-   }
-
-   private PrivateNetwork createNetwork(final VirtualDatacenter vdc, final PrivateNetwork from, final String name) {
-      PrivateNetwork network = PrivateNetwork.Builder.fromPrivateNetwork(from).virtualDatacenter(vdc).build();
-      network.setName(name);
-      network.save();
-      assertNotNull(network.getId());
-      return network;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/network/PublicNetworkLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/network/PublicNetworkLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/network/PublicNetworkLiveApiTest.java
deleted file mode 100644
index e655f5d..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/network/PublicNetworkLiveApiTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.fail;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.jclouds.abiquo.predicates.IpPredicates;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpsDto;
-
-/**
- * Live integration tests for the {@link PublicNetwork} domain class.
- */
-@Test(groups = "api", testName = "PublicNetworkLiveApiTest")
-public class PublicNetworkLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   private PublicNetwork publicNetwork;
-
-   @BeforeClass
-   public void setupNetwork() {
-      publicNetwork = createNetwork(env.publicNetwork, PREFIX + "-publicnetwork-test");
-   }
-
-   @AfterClass
-   public void tearDownNetwork() {
-      publicNetwork.delete();
-   }
-
-   public void testListIps() {
-      PaginatedCollection<PublicIpDto, PublicIpsDto> ipsDto = env.context.getApiContext().getApi()
-            .getInfrastructureApi().listPublicIps(publicNetwork.unwrap(), IpOptions.builder().limit(1).build());
-      int totalIps = ipsDto.getTotalSize();
-
-      Iterable<PublicIp> ips = publicNetwork.listIps();
-      assertEquals(size(ips), totalIps);
-   }
-
-   public void testListIpsWithOptions() {
-      Iterable<PublicIp> ips = publicNetwork.listIps(IpOptions.builder().limit(5).build());
-      assertEquals(size(ips), 5);
-   }
-
-   public void testListUnusedIps() {
-      PaginatedCollection<PublicIpDto, PublicIpsDto> ipsDto = env.context.getApiContext().getApi()
-            .getInfrastructureApi().listPublicIps(publicNetwork.unwrap(), IpOptions.builder().limit(1).build());
-      int totalIps = ipsDto.getTotalSize();
-
-      Iterable<PublicIp> ips = publicNetwork.listUnusedIps();
-      assertEquals(size(ips), totalIps);
-   }
-
-   public void testUpdateBasicInfo() {
-      publicNetwork.setName("Public network Updated");
-      publicNetwork.setPrimaryDNS("8.8.8.8");
-      publicNetwork.setSecondaryDNS("8.8.8.8");
-      publicNetwork.update();
-
-      assertEquals(publicNetwork.getName(), "Public network Updated");
-      assertEquals(publicNetwork.getPrimaryDNS(), "8.8.8.8");
-      assertEquals(publicNetwork.getSecondaryDNS(), "8.8.8.8");
-
-      // Refresh the public network
-      PublicNetwork pn = env.datacenter.getNetwork(publicNetwork.getId()).toPublicNetwork();
-
-      assertEquals(pn.getId(), publicNetwork.getId());
-      assertEquals(pn.getName(), "Public network Updated");
-      assertEquals(pn.getPrimaryDNS(), "8.8.8.8");
-      assertEquals(pn.getSecondaryDNS(), "8.8.8.8");
-   }
-
-   public void testUpdateReadOnlyFields() {
-      PublicNetwork toUpdate = createNetwork(publicNetwork, PREFIX + "-pubtoupdate-test");
-
-      try {
-         toUpdate.setTag(20);
-         toUpdate.setAddress("80.81.81.0");
-         toUpdate.setMask(16);
-         toUpdate.update();
-
-         fail("Tag field should not be editable");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "VLAN-19");
-      } finally {
-         toUpdate.delete();
-      }
-   }
-
-   public void testUpdateWithInvalidValues() {
-      PublicNetwork toUpdate = createNetwork(publicNetwork, PREFIX + "-pubtoupdate-test");
-
-      try {
-         toUpdate.setMask(60);
-         toUpdate.update();
-
-         fail("Invalid mask value");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.BAD_REQUEST, "CONSTR-MAX");
-      } finally {
-         toUpdate.delete();
-      }
-   }
-
-   public void testGetDatacenter() {
-      assertEquals(publicNetwork.getDatacenter().getId(), env.datacenter.getId());
-   }
-
-   public void testGetNetworkFromIp() {
-      PublicIp ip = find(publicNetwork.listIps(), IpPredicates.<PublicIp> notUsed());
-      PublicNetwork network = ip.getNetwork();
-
-      assertEquals(network.getId(), publicNetwork.getId());
-   }
-
-   private PublicNetwork createNetwork(final PublicNetwork from, final String name) {
-      PublicNetwork network = PublicNetwork.Builder.fromPublicNetwork(from).build();
-      network.setName(name);
-      network.save();
-      assertNotNull(network.getId());
-      return network;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/network/UnmanagedNetworkLiveApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/network/UnmanagedNetworkLiveApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/network/UnmanagedNetworkLiveApiTest.java
deleted file mode 100644
index 2fb06ee..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/network/UnmanagedNetworkLiveApiTest.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.size;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.jclouds.abiquo.util.Assert.assertHasError;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.fail;
-
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.exception.AbiquoException;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.abiquo.internal.BaseAbiquoApiLiveApiTest;
-import org.jclouds.abiquo.predicates.IpPredicates;
-import org.testng.annotations.AfterClass;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpsDto;
-import com.google.common.base.Predicate;
-
-/**
- * Live integration tests for the {@link UnmanagedNetwork} domain class.
- */
-@Test(groups = "api", testName = "UnmanagedNetworkLiveApiTest")
-public class UnmanagedNetworkLiveApiTest extends BaseAbiquoApiLiveApiTest {
-   private UnmanagedNetwork unmanagedNetwork;
-
-   @BeforeClass
-   public void setupNetwork() {
-      unmanagedNetwork = createNetwork(env.unmanagedNetwork, PREFIX + "-unmanagednetwork-test");
-   }
-
-   @AfterClass
-   public void tearDownNetwork() {
-      unmanagedNetwork.delete();
-   }
-
-   public void testListIps() {
-      PaginatedCollection<UnmanagedIpDto, UnmanagedIpsDto> ipsDto = env.context.getApiContext().getApi()
-            .getInfrastructureApi().listUnmanagedIps(unmanagedNetwork.unwrap(), IpOptions.builder().limit(1).build());
-      int totalIps = ipsDto.getTotalSize();
-
-      Iterable<UnmanagedIp> ips = unmanagedNetwork.listIps();
-      assertEquals(size(ips), totalIps);
-   }
-
-   public void testListIpsWithOptions() {
-      Iterable<UnmanagedIp> ips = unmanagedNetwork.listIps(IpOptions.builder().limit(5).build());
-      // Unmanaged networks do not have IPs until attached to VMs
-      assertEquals(size(ips), 0);
-   }
-
-   public void testListUnusedIps() {
-      PaginatedCollection<UnmanagedIpDto, UnmanagedIpsDto> ipsDto = env.context.getApiContext().getApi()
-            .getInfrastructureApi().listUnmanagedIps(unmanagedNetwork.unwrap(), IpOptions.builder().limit(1).build());
-      int totalIps = ipsDto.getTotalSize();
-
-      Iterable<UnmanagedIp> ips = unmanagedNetwork.listUnusedIps();
-      assertEquals(size(ips), totalIps);
-   }
-
-   public void testUpdateBasicInfo() {
-      unmanagedNetwork.setName("Unmanaged network Updated");
-      unmanagedNetwork.setPrimaryDNS("8.8.8.8");
-      unmanagedNetwork.setSecondaryDNS("8.8.8.8");
-      unmanagedNetwork.update();
-
-      assertEquals(unmanagedNetwork.getName(), "Unmanaged network Updated");
-      assertEquals(unmanagedNetwork.getPrimaryDNS(), "8.8.8.8");
-      assertEquals(unmanagedNetwork.getSecondaryDNS(), "8.8.8.8");
-
-      // Refresh the unmanaged network
-      UnmanagedNetwork en = find(env.enterprise.listUnmanagedNetworks(env.datacenter),
-            new Predicate<UnmanagedNetwork>() {
-               @Override
-               public boolean apply(UnmanagedNetwork input) {
-                  return input.getName().equals(unmanagedNetwork.getName());
-               }
-            });
-
-      assertEquals(en.getId(), unmanagedNetwork.getId());
-      assertEquals(en.getName(), "Unmanaged network Updated");
-      assertEquals(en.getPrimaryDNS(), "8.8.8.8");
-      assertEquals(en.getSecondaryDNS(), "8.8.8.8");
-   }
-
-   public void testUpdateReadOnlyFields() {
-      UnmanagedNetwork toUpdate = createNetwork(unmanagedNetwork, PREFIX + "-umtoupdate-test");
-
-      try {
-         toUpdate.setTag(20);
-         toUpdate.setAddress("10.2.0.0");
-         toUpdate.setMask(16);
-         toUpdate.update();
-
-         fail("Tag field should not be editable");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.CONFLICT, "VLAN-19");
-      } finally {
-         toUpdate.delete();
-      }
-   }
-
-   public void testUpdateWithInvalidValues() {
-      UnmanagedNetwork toUpdate = createNetwork(unmanagedNetwork, PREFIX + "-umtoupdate-test");
-
-      try {
-         toUpdate.setMask(60);
-         toUpdate.update();
-
-         fail("Invalid mask value");
-      } catch (AbiquoException ex) {
-         assertHasError(ex, Status.BAD_REQUEST, "CONSTR-MAX");
-      } finally {
-         toUpdate.delete();
-      }
-   }
-
-   public void testGetEnterprise() {
-      assertEquals(unmanagedNetwork.getEnterprise().getId(), env.enterprise.getId());
-   }
-
-   public void testGetDatacenter() {
-      assertEquals(unmanagedNetwork.getDatacenter().getId(), env.datacenter.getId());
-   }
-
-   public void testGetNetworkFromIp() {
-      UnmanagedIp ip = find(unmanagedNetwork.listIps(), IpPredicates.<UnmanagedIp> notUsed(), null);
-      // Unmanaged networks do not have IPs until attached to VMs
-      assertNull(ip);
-   }
-
-   private UnmanagedNetwork createNetwork(final UnmanagedNetwork from, final String name) {
-      UnmanagedNetwork network = UnmanagedNetwork.Builder.fromUnmanagedNetwork(from).build();
-      network.setName(name);
-      network.save();
-      assertNotNull(network.getId());
-      return network;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/environment/CloudTestEnvironment.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/environment/CloudTestEnvironment.java b/abiquo/src/test/java/org/jclouds/abiquo/environment/CloudTestEnvironment.java
deleted file mode 100644
index 72dd187..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/environment/CloudTestEnvironment.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.environment;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.isEmpty;
-import static org.jclouds.abiquo.reference.AbiquoTestConstants.PREFIX;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-
-import org.jclouds.ContextBuilder;
-import org.jclouds.abiquo.AbiquoApiMetadata;
-import org.jclouds.abiquo.AbiquoContext;
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.network.PrivateNetwork;
-import org.jclouds.abiquo.features.CloudApi;
-import org.jclouds.abiquo.features.services.EventService;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.Ordering;
-import com.google.common.primitives.Longs;
-
-/**
- * Test environment for cloud live tests.
- */
-public class CloudTestEnvironment extends InfrastructureTestEnvironment {
-
-   // Environment data made public so tests can use them easily
-   public CloudApi cloudApi;
-
-   public EventService eventService;
-
-   public VirtualDatacenter virtualDatacenter;
-
-   public VirtualAppliance virtualAppliance;
-
-   public VirtualMachine virtualMachine;
-
-   public VirtualMachineTemplate template;
-
-   public PrivateNetwork privateNetwork;
-
-   public Enterprise defaultEnterprise;
-
-   public AbiquoContext plainUserContext;
-
-   public AbiquoContext enterpriseAdminContext;
-
-   public CloudTestEnvironment(final AbiquoContext context) {
-      super(context);
-      this.cloudApi = context.getApiContext().getApi().getCloudApi();
-      this.eventService = context.getEventService();
-   }
-
-   @Override
-   public void setup() throws Exception {
-      // Create base infrastructure
-      super.setup();
-
-      createUserContext();
-      createEnterpriseAdminContext();
-
-      findDefaultEnterprise();
-      createVirtualDatacenter();
-      createVirtualAppliance();
-      refreshTemplateRepository();
-      createVirtualMachine();
-   }
-
-   @Override
-   public void tearDown() throws Exception {
-      closeEnterpriseAdminContext();
-      closeUserContext();
-
-      deleteVirtualMachine();
-      deleteVirtualAppliance();
-      deleteVirtualDatacenter();
-
-      // Delete base infrastructure
-      super.tearDown();
-   }
-
-   // Setup
-
-   private void createUserContext() {
-      String endpoint = checkNotNull(System.getProperty("test.abiquo.endpoint"), "test.abiquo.endpoint");
-
-      plainUserContext = ContextBuilder.newBuilder(new AbiquoApiMetadata()) //
-            .endpoint(endpoint) //
-            .credentials("abiquo", "jclouds") //
-            .build(AbiquoContext.class);
-   }
-
-   private void createEnterpriseAdminContext() {
-      String endpoint = checkNotNull(System.getProperty("test.abiquo.endpoint"), "test.abiquo.endpoint");
-
-      enterpriseAdminContext = ContextBuilder.newBuilder(new AbiquoApiMetadata()) //
-            .endpoint(endpoint) //
-            .credentials("jclouds-admin", "admin") //
-            .build(AbiquoContext.class);
-   }
-
-   protected void findDefaultEnterprise() {
-      defaultEnterprise = find(context.getAdministrationService().listEnterprises(), new Predicate<Enterprise>() {
-         @Override
-         public boolean apply(Enterprise input) {
-            return input.getName().equals("Abiquo");
-         }
-      });
-   }
-
-   protected void createVirtualDatacenter() {
-      privateNetwork = PrivateNetwork.builder(context.getApiContext()).name("DefaultNetwork").gateway("192.168.1.1")
-            .address("192.168.1.0").mask(24).build();
-
-      virtualDatacenter = VirtualDatacenter.builder(context.getApiContext(), datacenter, defaultEnterprise)
-            .name(PREFIX + "Virtual Aloha").cpuCountLimits(18, 20).hdLimitsInMb(279172872, 279172872)
-            .publicIpsLimits(2, 3).ramLimits(19456, 20480).storageLimits(289910292, 322122547).vlansLimits(3, 4)
-            .hypervisorType(machine.getType()).network(privateNetwork).build();
-
-      virtualDatacenter.save();
-      assertNotNull(virtualDatacenter.getId());
-
-      privateNetwork = find(virtualDatacenter.listPrivateNetworks(), new Predicate<PrivateNetwork>() {
-         @Override
-         public boolean apply(PrivateNetwork input) {
-            return input.getName().equals(privateNetwork.getName());
-         }
-      });
-   }
-
-   protected void createVirtualAppliance() {
-      virtualAppliance = VirtualAppliance.builder(context.getApiContext(), virtualDatacenter)
-            .name(PREFIX + "Virtual AppAloha").build();
-
-      virtualAppliance.save();
-      assertNotNull(virtualAppliance.getId());
-   }
-
-   protected void createVirtualMachine() {
-      Iterable<VirtualMachineTemplate> templates = virtualDatacenter.listAvailableTemplates();
-      assertFalse(isEmpty(templates));
-
-      template = templateBySize().min(templates);
-
-      virtualMachine = VirtualMachine.builder(context.getApiContext(), virtualAppliance, template).cpu(2)
-            .nameLabel(PREFIX + "VM Aloha").ram(128).build();
-
-      virtualMachine.save();
-      assertNotNull(virtualMachine.getId());
-
-   }
-
-   protected void refreshTemplateRepository() {
-      defaultEnterprise.refreshTemplateRepository(datacenter);
-   }
-
-   // Tear down
-
-   private void closeUserContext() {
-      plainUserContext.close();
-   }
-
-   private void closeEnterpriseAdminContext() {
-      enterpriseAdminContext.close();
-   }
-
-   protected void deleteVirtualDatacenter() {
-      if (virtualDatacenter != null && enterprise != null && datacenter != null) {
-         Integer idVirtualDatacenter = virtualDatacenter.getId();
-         virtualDatacenter.delete();
-         assertNull(cloudApi.getVirtualDatacenter(idVirtualDatacenter));
-      }
-   }
-
-   protected void deleteVirtualAppliance() {
-      if (virtualAppliance != null && virtualDatacenter != null) {
-         Integer idVirtualAppliance = virtualAppliance.getId();
-         virtualAppliance.delete();
-         assertNull(cloudApi.getVirtualAppliance(virtualDatacenter.unwrap(), idVirtualAppliance));
-      }
-   }
-
-   protected void deleteVirtualMachine() {
-      if (virtualMachine != null && virtualAppliance != null && virtualDatacenter != null) {
-         Integer idVirtualMachine = virtualMachine.getId();
-         virtualMachine.delete();
-         assertNull(cloudApi.getVirtualMachine(virtualAppliance.unwrap(), idVirtualMachine));
-      }
-   }
-
-   public static Ordering<VirtualMachineTemplate> templateBySize() {
-      return new Ordering<VirtualMachineTemplate>() {
-         @Override
-         public int compare(final VirtualMachineTemplate left, final VirtualMachineTemplate right) {
-            return Longs.compare(left.getDiskFileSize(), right.getDiskFileSize());
-         }
-      };
-   }
-
-}


[06/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/CloudApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/CloudApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/CloudApiTest.java
deleted file mode 100644
index 55a85a6..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/CloudApiTest.java
+++ /dev/null
@@ -1,1097 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.reflect.Reflection2.method;
-
-import java.io.IOException;
-
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.domain.CloudResources;
-import org.jclouds.abiquo.domain.EnterpriseResources;
-import org.jclouds.abiquo.domain.InfrastructureResources;
-import org.jclouds.abiquo.domain.NetworkResources;
-import org.jclouds.abiquo.domain.cloud.options.VirtualDatacenterOptions;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineOptions;
-import org.jclouds.abiquo.fallbacks.MovedVolume;
-import org.jclouds.abiquo.functions.ReturnTaskReferenceOrNull;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.http.functions.ReleasePayloadAndReturn;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualApplianceStateDto;
-import com.abiquo.server.core.cloud.VirtualAppliancesDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.cloud.VirtualDatacentersDto;
-import com.abiquo.server.core.cloud.VirtualMachineDto;
-import com.abiquo.server.core.cloud.VirtualMachineStateDto;
-import com.abiquo.server.core.cloud.VirtualMachineTaskDto;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworksDto;
-import com.abiquo.server.core.infrastructure.network.VMNetworkConfigurationsDto;
-import com.abiquo.server.core.infrastructure.storage.DiskManagementDto;
-import com.abiquo.server.core.infrastructure.storage.DisksManagementDto;
-import com.abiquo.server.core.infrastructure.storage.MovedVolumeDto;
-import com.abiquo.server.core.infrastructure.storage.TierDto;
-import com.abiquo.server.core.infrastructure.storage.TiersDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.abiquo.server.core.infrastructure.storage.VolumesManagementDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Tests annotation parsing of {@code CloudApi}
- */
-@Test(groups = "unit", testName = "CloudApiTest")
-public class CloudApiTest extends BaseAbiquoApiTest<CloudApi> {
-   /*********************** Virtual Datacenter ***********************/
-
-   public void testListVirtualDatacentersParams() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "listVirtualDatacenters", VirtualDatacenterOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(VirtualDatacenterOptions.builder().datacenterId(1).enterpriseId(1).build())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters?datacenter=1&enterprise=1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualDatacentersDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListVirtualDatacentersNoParams() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "listVirtualDatacenters", VirtualDatacenterOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(VirtualDatacenterOptions.builder().build())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualDatacentersDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCreateVirtualDatacenter() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "createVirtualDatacenter", VirtualDatacenterDto.class,
-            DatacenterDto.class, EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            CloudResources.virtualDatacenterPost(), InfrastructureResources.datacenterPut(),
-            EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/cloud/virtualdatacenters?datacenter=1&enterprise=1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualDatacenterDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.virtualDatacenterPostPayload()),
-            VirtualDatacenterDto.class, VirtualDatacenterDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetVirtualDatacenter() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getVirtualDatacenter", Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualDatacenterDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateVirtualDatacenter() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "updateVirtualDatacenter", VirtualDatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/cloud/virtualdatacenters/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualDatacenterDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.virtualDatacenterPutPayload()),
-            VirtualDatacenterDto.class, VirtualDatacenterDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteVirtualDatacenter() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(CloudApi.class, "deleteVirtualDatacenter", VirtualDatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/cloud/virtualdatacenters/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Ips ***********************/
-
-   public void testPurchasePublicIp() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "purchasePublicIp", PublicIpDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(NetworkResources.publicIpToPurchase())));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/5/publicips/purchased/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + PublicIpDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testReleasePublicIp() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "releasePublicIp", PublicIpDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(NetworkResources.publicIpToRelease())));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/5/publicips/topurchase/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + PublicIpDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Available templates ***********************/
-
-   /*********************** Storage Tiers ***********************/
-
-   public void testListStorageTiers() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "listStorageTiers", VirtualDatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters/1/tiers HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TiersDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetStorageTier() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getStorageTier", VirtualDatacenterDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters/1/tiers/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TierDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testGetDefaultNetwork() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getDefaultNetwork", VirtualDatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworkDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testSetDefaultNetworkInternal() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "setDefaultNetwork", VirtualDatacenterDto.class,
-            VLANNetworkDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), NetworkResources.privateNetworkPut())));
-
-      RESTLink netLink = NetworkResources.privateNetworkPut().getEditLink();
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/1/action/defaultvlan HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, withHeader("<links><link href=\"" + netLink.getHref()
-            + "\" rel=\"internalnetwork\"/></links>"), LinksDto.class, LinksDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testSetDefaultNetworkExternal() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "setDefaultNetwork", VirtualDatacenterDto.class,
-            VLANNetworkDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), NetworkResources.externalNetworkPut())));
-
-      RESTLink netLink = NetworkResources.externalNetworkPut().getEditLink();
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/1/action/defaultvlan HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, withHeader("<links><link href=\"" + netLink.getHref()
-            + "\" rel=\"externalnetwork\"/></links>"), LinksDto.class, LinksDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Private Network ***********************/
-
-   public void testListPrivateNetworks() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "listPrivateNetworks", VirtualDatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters/1/privatenetworks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworksDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetPrivateNetwork() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getPrivateNetwork", VirtualDatacenterDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworkDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testCreatePrivateNetwork() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "createPrivateNetwork", VirtualDatacenterDto.class,
-            VLANNetworkDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), NetworkResources.vlanPost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/cloud/virtualdatacenters/1/privatenetworks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworkDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(NetworkResources.vlanNetworkPostPayload()), VLANNetworkDto.class,
-            VLANNetworkDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdatePrivateNetwork() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "updatePrivateNetwork", VLANNetworkDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(NetworkResources.privateNetworkPut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworkDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(NetworkResources.privateNetworkPutPayload()), VLANNetworkDto.class,
-            VLANNetworkDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeletePrivateNetwork() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(CloudApi.class, "deletePrivateNetwork", VLANNetworkDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(NetworkResources.privateNetworkPut())));
-
-      assertRequestLineEquals(request,
-            "DELETE http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Private Network IPs ***********************/
-
-   public void testGetPrivateNetworkIp() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getPrivateNetworkIp", VLANNetworkDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(NetworkResources.privateNetworkPut(), 1)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + PrivateIpDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Virtual Appliance ***********************/
-
-   public void testListVirtualAppliances() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "listVirtualAppliances", VirtualDatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualAppliancesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetVirtualAppliance() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getVirtualAppliance", VirtualDatacenterDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), 1)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualApplianceDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testGetVirtualApplianceState() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getVirtualApplianceState", VirtualApplianceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualAppliancePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/state HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualApplianceStateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCreateVirtualAppliance() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "createVirtualAppliance", VirtualDatacenterDto.class,
-            VirtualApplianceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), CloudResources.virtualAppliancePost())));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/cloud/virtualdatacenters/1/virtualappliances HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualApplianceDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.virtualAppliancePostPayload()), VirtualApplianceDto.class,
-            VirtualApplianceDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateVirtualAppliance() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "updateVirtualAppliance", VirtualApplianceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualAppliancePut())));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualApplianceDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.virtualAppliancePutPayload()), VirtualApplianceDto.class,
-            VirtualApplianceDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteVirtualAppliance() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(CloudApi.class, "deleteVirtualAppliance", VirtualApplianceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualAppliancePut())));
-
-      assertRequestLineEquals(request,
-            "DELETE http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeployVirtualAppliance() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "deployVirtualAppliance", VirtualApplianceDto.class,
-            VirtualMachineTaskDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualAppliancePut(), CloudResources.deployOptions())));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/action/deploy HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.deployPayload()), VirtualMachineTaskDto.class,
-            VirtualMachineTaskDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUndeployVirtualAppliance() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "undeployVirtualAppliance", VirtualApplianceDto.class,
-            VirtualMachineTaskDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualAppliancePut(), CloudResources.undeployOptions())));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/action/undeploy HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.undeployPayload()), VirtualMachineTaskDto.class,
-            VirtualMachineTaskDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetVirtualAppliancePrice() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getVirtualAppliancePrice", VirtualApplianceDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualAppliancePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/action/price HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MediaType.TEXT_PLAIN + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReturnStringIf2xx.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Virtual Machine ***********************/
-
-   public void testGetVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getVirtualMachine", VirtualApplianceDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualAppliancePut(), 1)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testCreateVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "createVirtualMachine", VirtualApplianceDto.class,
-            VirtualMachineWithNodeExtendedDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualAppliancePut(), CloudResources.virtualMachinePost())));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.virtualMachinePostPayload()),
-            VirtualMachineWithNodeExtendedDto.class, VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "updateVirtualMachine", VirtualMachineWithNodeExtendedDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.virtualMachinePutPayload()),
-            VirtualMachineWithNodeExtendedDto.class, VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ReturnTaskReferenceOrNull.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateVirtualMachineWithOptions() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "updateVirtualMachine", VirtualMachineWithNodeExtendedDto.class,
-            VirtualMachineOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(
-            method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut(), VirtualMachineOptions.builder().force(true)
-                  .build())));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1?force=true HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.virtualMachinePutPayload()),
-            VirtualMachineWithNodeExtendedDto.class, VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ReturnTaskReferenceOrNull.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testChangeVirtualMachineState() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "changeVirtualMachineState", VirtualMachineDto.class,
-            VirtualMachineStateDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut(), CloudResources.virtualMachineState())));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/state HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.virtualMachineStatePayload()),
-            VirtualMachineStateDto.class, VirtualMachineStateDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteVirtualMachine() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(CloudApi.class, "deleteVirtualMachine", VirtualMachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(request,
-            "DELETE http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetVirtualMachineState() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getVirtualMachineState", VirtualMachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/state HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualMachineStateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeployVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "deployVirtualMachine", VirtualMachineDto.class,
-            VirtualMachineTaskDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut(), CloudResources.deployOptions())));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/deploy HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.deployPayload()), VirtualMachineTaskDto.class,
-            VirtualMachineTaskDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUndeployVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "undeployVirtualMachine", VirtualMachineDto.class,
-            VirtualMachineTaskDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut(), CloudResources.undeployOptions())));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/undeploy HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.undeployPayload()), VirtualMachineTaskDto.class,
-            VirtualMachineTaskDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testRebootVirtualMachine() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "rebootVirtualMachine", VirtualMachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/reset HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListNetworkConfigurations() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "listNetworkConfigurations", VirtualMachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(
-            request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/configurations HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VMNetworkConfigurationsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testSetGatewayNetwork() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "setGatewayNetwork", VirtualMachineDto.class,
-            VLANNetworkDto.class);
-
-      VirtualMachineDto vm = CloudResources.virtualMachinePut();
-      VLANNetworkDto network = NetworkResources.privateNetworkPut();
-
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(vm, network)));
-
-      String configLink = vm.searchLink("configurations").getHref() + "/" + network.getId();
-
-      assertRequestLineEquals(
-            request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/configurations HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, withHeader("<links><link href=\"" + configLink
-            + "\" rel=\"network_configuration\"/></links>"), LinksDto.class, LinksDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Virtual Machine Template ***********************/
-
-   public void testGetVirtualMachineTemplate() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getVirtualMachineTemplate", VirtualMachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualMachineTemplateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListAttachedVolumes() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "listAttachedVolumes", VirtualMachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/volumes HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VolumesManagementDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDetachAllVolumes() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "detachAllVolumes", VirtualMachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(request,
-            "DELETE http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/volumes HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReturnTaskReferenceOrNull.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testReplaceVolumes() throws SecurityException, NoSuchMethodException, IOException {
-      VolumeManagementDto first = CloudResources.volumePut();
-      VolumeManagementDto second = CloudResources.volumePut();
-      second.getEditLink().setHref(second.getEditLink().getHref() + "second");
-
-      Invokable<?, ?> method = method(CloudApi.class, "replaceVolumes", VirtualMachineDto.class,
-            VirtualMachineOptions.class, VolumeManagementDto[].class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(
-            method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut(), VirtualMachineOptions.builder().force(true)
-                  .build(), new VolumeManagementDto[] { first, second })));
-
-      String editLink = CloudResources.volumePut().getEditLink().getHref();
-      assertRequestLineEquals(
-            request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/volumes?force=true HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader("<links><link href=\"" + editLink + "\" rel=\"volume\"/><link href=\""
-            + editLink + "second\" rel=\"volume\"/></links>"), LinksDto.class, LinksDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ReturnTaskReferenceOrNull.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListAttachedHardDisks() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "listAttachedHardDisks", VirtualMachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/disks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DisksManagementDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDetachAllHardDisks() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "detachAllHardDisks", VirtualMachineDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut())));
-
-      assertRequestLineEquals(request,
-            "DELETE http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/disks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReturnTaskReferenceOrNull.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testReplaceHardDisks() throws SecurityException, NoSuchMethodException, IOException {
-      DiskManagementDto first = CloudResources.hardDiskPut();
-      DiskManagementDto second = CloudResources.hardDiskPut();
-      second.getEditLink().setHref(second.getEditLink().getHref() + "second");
-
-      Invokable<?, ?> method = method(CloudApi.class, "replaceHardDisks", VirtualMachineDto.class,
-            DiskManagementDto[].class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualMachinePut(), new DiskManagementDto[] { first, second })));
-
-      String editLink = CloudResources.hardDiskPut().getEditLink().getHref();
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/disks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader("<links><link href=\"" + editLink + "\" rel=\"disk\"/><link href=\""
-            + editLink + "second\" rel=\"disk\"/></links>"), LinksDto.class, LinksDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ReturnTaskReferenceOrNull.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Hard disks ***********************/
-
-   public void testListHardDisks() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "listHardDisks", VirtualDatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters/1/disks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DisksManagementDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetHardDisk() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getHardDisk", VirtualDatacenterDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters/1/disks/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DiskManagementDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testCreateHardDisk() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "createHardDisk", VirtualDatacenterDto.class,
-            DiskManagementDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), CloudResources.hardDiskPost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/cloud/virtualdatacenters/1/disks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DiskManagementDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.hardDiskPostPayload()), DiskManagementDto.class,
-            DiskManagementDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteHardDisk() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "deleteHardDisk", DiskManagementDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.hardDiskPut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/cloud/virtualdatacenters/1/disks/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Volumes ***********************/
-
-   public void testGetVolume() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "getVolume", VirtualDatacenterDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/cloud/virtualdatacenters/1/volumes/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VolumeManagementDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testCreateVolume() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "createVolume", VirtualDatacenterDto.class,
-            VolumeManagementDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.virtualDatacenterPut(), CloudResources.volumePost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/cloud/virtualdatacenters/1/volumes HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VolumeManagementDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.volumePostPayload()), VolumeManagementDto.class,
-            VolumeManagementDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateVolume() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "updateVolume", VolumeManagementDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.volumePut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/cloud/virtualdatacenters/1/volumes/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + AcceptedRequestDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.volumePutPayload()), VolumeManagementDto.class,
-            VolumeManagementDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ReturnTaskReferenceOrNull.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteVolume() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "deleteVolume", VolumeManagementDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.volumePut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/cloud/virtualdatacenters/1/volumes/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testMoveVolume() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(CloudApi.class, "moveVolume", VolumeManagementDto.class,
-            VirtualDatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(CloudResources.volumePut(), CloudResources.virtualDatacenterPut())));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/cloud/virtualdatacenters/1/volumes/1/action/move HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MovedVolumeDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(CloudResources.virtualDatacenterRefPayload()), LinksDto.class,
-            LinksDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, MovedVolume.class);
-
-      checkFilters(request);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/ConfigApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/ConfigApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/ConfigApiTest.java
deleted file mode 100644
index faf7ee5..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/ConfigApiTest.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.reflect.Reflection2.method;
-
-import java.io.IOException;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.domain.ConfigResources;
-import org.jclouds.abiquo.domain.config.options.LicenseOptions;
-import org.jclouds.abiquo.domain.config.options.PropertyOptions;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.http.functions.ReleasePayloadAndReturn;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.appslibrary.CategoriesDto;
-import com.abiquo.server.core.appslibrary.CategoryDto;
-import com.abiquo.server.core.config.LicenseDto;
-import com.abiquo.server.core.config.LicensesDto;
-import com.abiquo.server.core.config.SystemPropertiesDto;
-import com.abiquo.server.core.config.SystemPropertyDto;
-import com.abiquo.server.core.enterprise.PrivilegeDto;
-import com.abiquo.server.core.enterprise.PrivilegesDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Tests annotation parsing of {@code ConfigApi}.
- */
-@Test(groups = "unit", testName = "ConfigApiTest")
-public class ConfigApiTest extends BaseAbiquoApiTest<ConfigApi> {
-   /*********************** License ***********************/
-
-   public void testListLicenses() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "listLicenses");
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.of()));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/config/licenses HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + LicensesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListLicenseWithOptions() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "listLicenses", LicenseOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(LicenseOptions.builder().active(true).build())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/config/licenses?active=true HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + LicensesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testAddLicense() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "addLicense", LicenseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(ConfigResources.licensePost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/config/licenses HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + LicenseDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(ConfigResources.licensePostPayload()), LicenseDto.class,
-            LicenseDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testRemoveLicense() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "removeLicense", LicenseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(ConfigResources.licensePut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/config/licenses/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Privilege ***********************/
-
-   public void testListPrivileges() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "listPrivileges");
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.of()));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/config/privileges HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + PrivilegesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetPrivilege() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "getPrivilege", Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/config/privileges/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + PrivilegeDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   /*********************** System Properties ***********************/
-
-   public void testListSystemProperties() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "listSystemProperties");
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.of()));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/config/properties HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + SystemPropertiesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListSystemPropertiesWithOptions() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "listSystemProperties", PropertyOptions.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(PropertyOptions.builder().component("api").build())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/config/properties?component=api HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + SystemPropertiesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateSystemProperty() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "updateSystemProperty", SystemPropertyDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(ConfigResources.propertyPut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/config/properties/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + SystemPropertyDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(ConfigResources.propertyPutPayload()), SystemPropertyDto.class,
-            SystemPropertyDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Category ***********************/
-
-   public void testListCategories() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "listCategories");
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.of()));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/config/categories HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + CategoriesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetCategory() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "getCategory", Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/config/categories/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + CategoryDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testCreateCategory() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "createCategory", CategoryDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(ConfigResources.categoryPost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/config/categories HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + CategoryDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(ConfigResources.categoryPostPayload()), CategoryDto.class,
-            CategoryDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateCategory() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(ConfigApi.class, "updateCategory", CategoryDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(ConfigResources.categoryPut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/config/categories/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + CategoryDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(ConfigResources.categoryPutPayload()), CategoryDto.class,
-            CategoryDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteCategory() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(ConfigApi.class, "deleteCategory", CategoryDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(ConfigResources.categoryPut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/config/categories/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseApiExpectTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseApiExpectTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseApiExpectTest.java
deleted file mode 100644
index dcd4f7e..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseApiExpectTest.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.enterprise.options.EnterpriseOptions;
-import org.jclouds.abiquo.domain.enterprise.options.UserOptions;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.enterprise.EnterprisesDto;
-import com.abiquo.server.core.enterprise.UserDto;
-import com.abiquo.server.core.enterprise.UsersDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-
-/**
- * Expect tests for the {@link EnterpriseApi} class.
- */
-@Test(groups = "unit", testName = "EnterpriseApiExpectTest")
-public class EnterpriseApiExpectTest extends BaseAbiquoApiExpectTest<EnterpriseApi> {
-
-   public void testListUsersWithoutPagination() {
-      EnterpriseApi api = requestsSendResponses(
-            HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost/api/admin/enterprises/1/users")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(UsersDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/users-page.xml", normalize(UsersDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost/api/admin/enterprises/1/users")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(UsersDto.MEDIA_TYPE)) //
-                  .addQueryParam("numResults", "2") //
-                  .addQueryParam("page", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/users-lastpage.xml",
-                              normalize(UsersDto.MEDIA_TYPE))) //
-                  .build());
-
-      EnterpriseDto enterprise = new EnterpriseDto();
-      enterprise.addLink(new RESTLink("users", "http://localhost/api/admin/enterprises/1/users"));
-
-      PagedIterable<UserDto> result = api.listUsers(enterprise);
-      List<UserDto> all = result.concat().toList();
-
-      assertEquals(all.size(), 3);
-      assertEquals(all.get(0).getId().intValue(), 1);
-      assertEquals(all.get(1).getId().intValue(), 2);
-      assertEquals(all.get(2).getId().intValue(), 3);
-   }
-
-   public void testListUsersWithPagination() {
-      EnterpriseApi api = requestSendsResponse(
-            HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost/api/admin/enterprises/1/users")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(UsersDto.MEDIA_TYPE)) //
-                  .addQueryParam("page", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/users-lastpage.xml",
-                              normalize(UsersDto.MEDIA_TYPE))) //
-                  .build());
-
-      EnterpriseDto enterprise = new EnterpriseDto();
-      enterprise.addLink(new RESTLink("users", "http://localhost/api/admin/enterprises/1/users"));
-
-      UserOptions options = UserOptions.builder().page(1).build();
-      PaginatedCollection<UserDto, UsersDto> result = api.listUsers(enterprise, options);
-
-      assertEquals(result.size(), 1);
-      assertEquals(result.getTotalSize().intValue(), 3);
-      assertEquals(result.get(0).getId().intValue(), 3);
-      assertNotNull(result.searchLink("first"));
-      assertNotNull(result.searchLink("last"));
-   }
-
-   public void testListEnterprises() {
-      EnterpriseApi api = requestSendsResponse(
-            HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost/api/admin/enterprises")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(EnterprisesDto.MEDIA_TYPE)) //
-                  .addQueryParam("limit", "1") //
-                  .addQueryParam("has", "text") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/enterprises-page.xml",
-                              normalize(EnterprisesDto.MEDIA_TYPE))) //
-                  .build());
-
-      EnterpriseOptions options = EnterpriseOptions.builder().limit(1).has("text").build();
-      PaginatedCollection<EnterpriseDto, EnterprisesDto> result = api.listEnterprises(options);
-
-      assertEquals(result.size(), 1);
-      assertEquals(result.getTotalSize().intValue(), 2);
-      assertEquals(result.get(0).getId().intValue(), 1);
-      assertNotNull(result.searchLink("first"));
-      assertNotNull(result.searchLink("last"));
-   }
-
-   public void testListEnterprisesByDatacenterWithOptions() {
-      EnterpriseApi api = requestSendsResponse(
-            HttpRequest.builder().method("GET")
-                  .endpoint(URI.create("http://localhost/api/admin/datacenters/1/action/enterprises")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(EnterprisesDto.MEDIA_TYPE)) //
-                  .addQueryParam("limit", "1") //
-                  .addQueryParam("has", "text") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/enterprises-page.xml",
-                              normalize(EnterprisesDto.MEDIA_TYPE))) //
-                  .build());
-
-      DatacenterDto datacenter = new DatacenterDto();
-      datacenter.addLink(new RESTLink("enterprises", "http://localhost/api/admin/datacenters/1/action/enterprises"));
-
-      EnterpriseOptions options = EnterpriseOptions.builder().limit(1).has("text").build();
-      PaginatedCollection<EnterpriseDto, EnterprisesDto> result = api.listEnterprises(datacenter, options);
-
-      assertEquals(result.size(), 1);
-      assertEquals(result.getTotalSize().intValue(), 2);
-      assertEquals(result.get(0).getId().intValue(), 1);
-      assertNotNull(result.searchLink("first"));
-      assertNotNull(result.searchLink("last"));
-   }
-
-   public void testListEnterprisesReturns2xx() {
-      EnterpriseApi api = requestsSendResponses(
-            HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost/api/admin/enterprises")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(EnterprisesDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/enterprises-page.xml",
-                              normalize(EnterprisesDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost/api/admin/enterprises")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(EnterprisesDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/enterprises-lastpage.xml",
-                              normalize(EnterprisesDto.MEDIA_TYPE))) //
-                  .build());
-
-      PagedIterable<EnterpriseDto> result = api.listEnterprises();
-      List<EnterpriseDto> all = result.concat().toList();
-
-      assertEquals(all.size(), 2);
-      assertEquals(all.get(0).getId().intValue(), 1);
-      assertEquals(all.get(1).getId().intValue(), 2);
-   }
-
-   @Override
-   protected EnterpriseApi clientFrom(AbiquoApi api) {
-      return api.getEnterpriseApi();
-   }
-}


[17/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/NetworkServiceType.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/NetworkServiceType.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/NetworkServiceType.java
deleted file mode 100644
index ae3e68e..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/NetworkServiceType.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto;
-
-/**
- * Network Service Type defines a network service.
- * 
- * The network Service Type is used to select the network interface of the
- * target host where a NIC in the virtual machine will be attached.
- * 
- * They are scoped at {@link Datacenter} level: two {@link NetworkServiceType}
- * can have the same name if they belong to a different {@link Datacenter}
- */
-public class NetworkServiceType extends DomainWrapper<NetworkServiceTypeDto> {
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-      return new Builder(context, datacenter);
-   }
-
-   /**
-    * Helper class to build {@link NetworkServiceType} in a controlled way.
-    * 
-    */
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private Datacenter datacenter;
-
-      private String name;
-
-      public Builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-         super();
-         checkNotNull(datacenter, ValidationErrors.NULL_RESOURCE + Datacenter.class);
-         this.datacenter = datacenter;
-         this.context = context;
-      }
-
-      public NetworkServiceType build() {
-         NetworkServiceTypeDto dto = new NetworkServiceTypeDto();
-         dto.setName(this.name);
-
-         NetworkServiceType nst = new NetworkServiceType(context, dto);
-         nst.datacenter = this.datacenter;
-         return nst;
-      }
-
-      public Builder name(final String name) {
-         this.name = checkNotNull(name, ValidationErrors.MISSING_REQUIRED_FIELD + name);
-         return this;
-      }
-   }
-
-   /** The datacenter where the NetworkServiceType belongs. */
-   private Datacenter datacenter;
-
-   /** Constructor will only be used by the builder. */
-   protected NetworkServiceType(final ApiContext<AbiquoApi> context, final NetworkServiceTypeDto target) {
-      super(context, target);
-   }
-
-   /**
-    * Delete the Network Service Type.
-    */
-   public void delete() {
-      context.getApi().getInfrastructureApi().deleteNetworkServiceType(target);
-      target = null;
-   }
-
-   /**
-    * Create a new Network Service Type
-    */
-   public void save() {
-      target = context.getApi().getInfrastructureApi().createNetworkServiceType(datacenter.unwrap(), target);
-   }
-
-   /**
-    * Update Network Service Type information in the server with the data from
-    * this NST.
-    */
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateNetworkServiceType(target);
-   }
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public Boolean isDefaultNST() {
-      return target.isDefaultNST();
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   @Override
-   public String toString() {
-      return "NetworkServiceType [id=" + getId() + ", name=" + getName() + ", isDefault=" + isDefaultNST() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Nic.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Nic.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Nic.java
deleted file mode 100644
index ee39f80..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/Nic.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.infrastructure.network.NicDto;
-
-/**
- * Adds high level functionality to {@link NicDto}.
- * 
- * @see API: <a href=
- *      "http://community.abiquo.com/display/ABI20/VirtualMachineNetworkConfiguration"
- *      > http://community.abiquo.com/display/ABI20/
- *      VirtualMachineNetworkConfiguration</a>
- */
-public class Nic extends DomainWrapper<NicDto> {
-   /**
-    * Constructor to be used only by the builder (if any).
-    */
-   protected Nic(final ApiContext<AbiquoApi> context, final NicDto target) {
-      super(context, target);
-   }
-
-   // Parent access
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getIp() {
-      return target.getIp();
-   }
-
-   public String getMac() {
-      return target.getMac();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PrivateIp.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PrivateIp.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PrivateIp.java
deleted file mode 100644
index 3bf7596..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PrivateIp.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds generic high level functionality to {@link PrivateIpDto}.
- */
-public class PrivateIp extends Ip<PrivateIpDto, PrivateNetwork> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected PrivateIp(final ApiContext<AbiquoApi> context, final PrivateIpDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   @Override
-   public PrivateNetwork getNetwork() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.PRIVATE_NETWORK),
-            ValidationErrors.MISSING_REQUIRED_LINK + " " + ParentLinkName.PRIVATE_NETWORK);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<VLANNetworkDto> parser = new ParseXMLWithJAXB<VLANNetworkDto>(context.utils().xml(),
-            TypeLiteral.get(VLANNetworkDto.class));
-
-      return wrap(context, PrivateNetwork.class, parser.apply(response));
-   }
-
-   @Override
-   public NetworkType getNetworkType() {
-      return NetworkType.INTERNAL;
-   }
-
-   @Override
-   public String toString() {
-      return "PrivateIp [networkType=" + getNetworkType() + ", id=" + getId() + ", ip=" + getIp() + ", mac=" + getMac()
-            + ", name=" + getName() + ", networkName=" + getNetworkName() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PrivateNetwork.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PrivateNetwork.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PrivateNetwork.java
deleted file mode 100644
index 75d9931..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PrivateNetwork.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpsDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-
-/**
- * Adds high level functionality to private {@link VLANNetworkDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/Private+Network+Resource"
- *      > http://community.abiquo.com/display/ABI20/Private+Network+Resource</a>
- */
-public class PrivateNetwork extends Network<PrivateIp> {
-   /** The virtual datacenter where the network belongs. */
-   private VirtualDatacenter virtualDatacenter;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected PrivateNetwork(final ApiContext<AbiquoApi> context, final VLANNetworkDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Private+Network+Resource#PrivateNetworkResource-DeleteaPrivateNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Private+Network+Resource#
-    *      PrivateNetworkResource -DeleteaPrivateNetwork</a>
-    */
-   @Override
-   public void delete() {
-      context.getApi().getCloudApi().deletePrivateNetwork(target);
-      target = null;
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Private+Network+Resource#PrivateNetworkResource-CreateaPrivateNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Private+Network+Resource#
-    *      PrivateNetworkResource -CreateaPrivateNetwork</a>
-    */
-   @Override
-   public void save() {
-      target = context.getApi().getCloudApi().createPrivateNetwork(virtualDatacenter.unwrap(), target);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Private+Network+Resource#PrivateNetworkResource-UpdateaPrivateNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Private+Network+Resource#
-    *      PrivateNetworkResource -UpdateaPrivateNetwork</a>
-    */
-   @Override
-   public void update() {
-      target = context.getApi().getCloudApi().updatePrivateNetwork(target);
-   }
-
-   @Override
-   public Iterable<PrivateIp> listIps() {
-      PagedIterable<PrivateIpDto> ips = context.getApi().getCloudApi().listPrivateNetworkIps(target);
-      return wrap(context, PrivateIp.class, ips.concat());
-   }
-
-   @Override
-   public Iterable<PrivateIp> listIps(final IpOptions options) {
-      PaginatedCollection<PrivateIpDto, PrivateIpsDto> ips = context.getApi().getCloudApi()
-            .listPrivateNetworkIps(target, options);
-      return wrap(context, PrivateIp.class, ips.toPagedIterable().concat());
-   }
-
-   // Override to apply the filter in the server side
-   @Override
-   public Iterable<PrivateIp> listUnusedIps() {
-      IpOptions options = IpOptions.builder().free(true).build();
-      PaginatedCollection<PrivateIpDto, PrivateIpsDto> ips = context.getApi().getCloudApi()
-            .listPrivateNetworkIps(target, options);
-      return wrap(context, PrivateIp.class, ips.toPagedIterable().concat());
-   }
-
-   @Override
-   public PrivateIp getIp(final Integer id) {
-      PrivateIpDto ip = context.getApi().getCloudApi().getPrivateNetworkIp(target, id);
-      return wrap(context, PrivateIp.class, ip);
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context) {
-      return new Builder(context);
-   }
-
-   public static class Builder extends NetworkBuilder<Builder> {
-      private VirtualDatacenter virtualDatacenter;
-
-      public Builder(final ApiContext<AbiquoApi> context) {
-         super(context);
-         this.context = context;
-      }
-
-      public Builder virtualDatacenter(final VirtualDatacenter virtualDatacenter) {
-         this.virtualDatacenter = virtualDatacenter;
-         return this;
-      }
-
-      public PrivateNetwork build() {
-         VLANNetworkDto dto = new VLANNetworkDto();
-         dto.setName(name);
-         dto.setTag(tag);
-         dto.setGateway(gateway);
-         dto.setAddress(address);
-         dto.setMask(mask);
-         dto.setPrimaryDNS(primaryDNS);
-         dto.setSecondaryDNS(secondaryDNS);
-         dto.setSufixDNS(suffixDNS);
-         dto.setDefaultNetwork(defaultNetwork);
-         dto.setUnmanaged(false);
-         dto.setType(NetworkType.INTERNAL);
-
-         PrivateNetwork network = new PrivateNetwork(context, dto);
-         network.virtualDatacenter = virtualDatacenter;
-
-         return network;
-      }
-
-      public static Builder fromPrivateNetwork(final PrivateNetwork in) {
-         return PrivateNetwork.builder(in.context).name(in.getName()).tag(in.getTag()).gateway(in.getGateway())
-               .address(in.getAddress()).mask(in.getMask()).primaryDNS(in.getPrimaryDNS())
-               .secondaryDNS(in.getSecondaryDNS()).suffixDNS(in.getSuffixDNS()).defaultNetwork(in.getDefaultNetwork())
-               .virtualDatacenter(in.virtualDatacenter);
-      }
-   }
-
-   @Override
-   public String toString() {
-      return "Private " + super.toString();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PublicIp.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PublicIp.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PublicIp.java
deleted file mode 100644
index 07b33b8..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PublicIp.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds generic high level functionality to {@link PublicIpDto}.
- */
-public class PublicIp extends AbstractPublicIp<PublicIpDto, PublicNetwork> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected PublicIp(final ApiContext<AbiquoApi> context, final PublicIpDto target) {
-      super(context, target);
-   }
-
-   @Override
-   public PublicNetwork getNetwork() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.PUBLIC_NETWORK),
-            ValidationErrors.MISSING_REQUIRED_LINK + ParentLinkName.PUBLIC_NETWORK);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<VLANNetworkDto> parser = new ParseXMLWithJAXB<VLANNetworkDto>(context.utils().xml(),
-            TypeLiteral.get(VLANNetworkDto.class));
-
-      return wrap(context, PublicNetwork.class, parser.apply(response));
-   }
-
-   @Override
-   public NetworkType getNetworkType() {
-      return NetworkType.PUBLIC;
-   }
-
-   @Override
-   public String toString() {
-      return "PublicIp [networkType=" + getNetworkType() + ", available=" + isAvailable() + ", quarantine="
-            + isQuarantine() + ", id=" + getId() + ", ip=" + getIp() + ", mac=" + getMac() + ", name=" + getName()
-            + ", networkName=" + getNetworkName() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PublicNetwork.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PublicNetwork.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PublicNetwork.java
deleted file mode 100644
index 0aeaba4..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/PublicNetwork.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpsDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.google.common.base.Optional;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds high level functionality to public {@link VLANNetworkDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/Public+Network+Resource"
- *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource</a>
- */
-public class PublicNetwork extends Network<PublicIp> {
-   /** The datacenter where the network belongs. */
-   private Datacenter datacenter;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected PublicNetwork(final ApiContext<AbiquoApi> context, final VLANNetworkDto target) {
-      super(context, target);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Public+Network+Resource#PublicNetworkResource-DeleteaPublicNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource#
-    *      PublicNetworkResource -DeleteaPublicNetwork</a>
-    */
-   @Override
-   public void delete() {
-      context.getApi().getInfrastructureApi().deleteNetwork(target);
-      target = null;
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Public+Network+Resource#PublicNetworkResource-CreateanewPublicNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource#
-    *      PublicNetworkResource -CreateanewPublicNetwork</a>
-    */
-   @Override
-   public void save() {
-      target = context.getApi().getInfrastructureApi().createNetwork(datacenter.unwrap(), target);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Public+Network+Resource#PublicNetworkResource-UpdateaPublicNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource#
-    *      PublicNetworkResource -UpdateaPublicNetwork</a>
-    */
-   @Override
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateNetwork(target);
-   }
-
-   @Override
-   public Iterable<PublicIp> listIps() {
-      PagedIterable<PublicIpDto> ips = context.getApi().getInfrastructureApi().listPublicIps(target);
-      return wrap(context, PublicIp.class, ips.concat());
-   }
-
-   @Override
-   public Iterable<PublicIp> listIps(final IpOptions options) {
-      PaginatedCollection<PublicIpDto, PublicIpsDto> ips = context.getApi().getInfrastructureApi()
-            .listPublicIps(target, options);
-      return wrap(context, PublicIp.class, ips.toPagedIterable().concat());
-   }
-
-   @Override
-   public PublicIp getIp(final Integer id) {
-      PublicIpDto ip = context.getApi().getInfrastructureApi().getPublicIp(target, id);
-      return wrap(context, PublicIp.class, ip);
-   }
-
-   // Parent access
-
-   public Datacenter getDatacenter() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.DATACENTER), ValidationErrors.MISSING_REQUIRED_LINK
-            + " " + ParentLinkName.DATACENTER);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<DatacenterDto> parser = new ParseXMLWithJAXB<DatacenterDto>(context.utils().xml(),
-            TypeLiteral.get(DatacenterDto.class));
-
-      datacenter = wrap(context, Datacenter.class, parser.apply(response));
-      return datacenter;
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-      return new Builder(context, datacenter);
-   }
-
-   public static class Builder extends NetworkBuilder<Builder> {
-      private Datacenter datacenter;
-
-      private Optional<NetworkServiceType> networkServiceType = Optional.absent();
-
-      public Builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter) {
-         super(context);
-         this.datacenter = checkNotNull(datacenter,
-               ValidationErrors.NULL_RESOURCE + Datacenter.class.getCanonicalName());
-         this.context = context;
-      }
-
-      public Builder datacenter(final Datacenter datacenter) {
-         this.datacenter = checkNotNull(datacenter,
-               ValidationErrors.NULL_RESOURCE + Datacenter.class.getCanonicalName());
-         return this;
-      }
-
-      public Builder networkServiceType(final NetworkServiceType networkServiceType) {
-         this.networkServiceType = Optional.of(networkServiceType);
-         return this;
-      }
-
-      public PublicNetwork build() {
-         VLANNetworkDto dto = new VLANNetworkDto();
-         dto.setName(name);
-         dto.setTag(tag);
-         dto.setGateway(gateway);
-         dto.setAddress(address);
-         dto.setMask(mask);
-         dto.setPrimaryDNS(primaryDNS);
-         dto.setSecondaryDNS(secondaryDNS);
-         dto.setSufixDNS(suffixDNS);
-         dto.setDefaultNetwork(defaultNetwork);
-         dto.setUnmanaged(false);
-         dto.setType(NetworkType.PUBLIC);
-
-         NetworkServiceType nst = networkServiceType.or(datacenter.defaultNetworkServiceType());
-         dto.addLink(new RESTLink("networkservicetype", nst.unwrap().getEditLink().getHref()));
-
-         PublicNetwork network = new PublicNetwork(context, dto);
-         network.datacenter = datacenter;
-
-         return network;
-      }
-
-      public static Builder fromPublicNetwork(final PublicNetwork in) {
-         return PublicNetwork.builder(in.context, in.datacenter).name(in.getName()).tag(in.getTag())
-               .gateway(in.getGateway()).address(in.getAddress()).mask(in.getMask()).primaryDNS(in.getPrimaryDNS())
-               .secondaryDNS(in.getSecondaryDNS()).suffixDNS(in.getSuffixDNS()).defaultNetwork(in.getDefaultNetwork());
-      }
-   }
-
-   @Override
-   public String toString() {
-      return "Public " + super.toString();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/UnmanagedIp.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/UnmanagedIp.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/UnmanagedIp.java
deleted file mode 100644
index e3579ec..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/UnmanagedIp.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds generic high level functionality to {@link UnmanagedIpDto}.
- */
-public class UnmanagedIp extends AbstractPublicIp<UnmanagedIpDto, UnmanagedNetwork> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected UnmanagedIp(final ApiContext<AbiquoApi> context, final UnmanagedIpDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   @Override
-   public UnmanagedNetwork getNetwork() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.UNMANAGED_NETWORK),
-            ValidationErrors.MISSING_REQUIRED_LINK + " " + ParentLinkName.UNMANAGED_NETWORK);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<VLANNetworkDto> parser = new ParseXMLWithJAXB<VLANNetworkDto>(context.utils().xml(),
-            TypeLiteral.get(VLANNetworkDto.class));
-
-      return wrap(context, UnmanagedNetwork.class, parser.apply(response));
-   }
-
-   @Override
-   public NetworkType getNetworkType() {
-      return NetworkType.UNMANAGED;
-   }
-
-   @Override
-   public String toString() {
-      return "UnmanagedIp [networkType=" + getNetworkType() + ", available=" + isAvailable() + ", quarantine="
-            + isQuarantine() + ", id=" + getId() + ", ip=" + getIp() + ", mac=" + getMac() + ", name=" + getName()
-            + ", networkName=" + getNetworkName() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/UnmanagedNetwork.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/UnmanagedNetwork.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/UnmanagedNetwork.java
deleted file mode 100644
index 3980a42..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/UnmanagedNetwork.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpsDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.google.common.base.Optional;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds high level functionality to external {@link VLANNetworkDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/Public+Network+Resource"
- *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource</a>
- */
-public class UnmanagedNetwork extends Network<UnmanagedIp> {
-   /** The datacenter where the network belongs. */
-   private Datacenter datacenter;
-
-   /** The enterprise where the network belongs. */
-   private Enterprise enterprise;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected UnmanagedNetwork(final ApiContext<AbiquoApi> context, final VLANNetworkDto target) {
-      super(context, target);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Public+Network+Resource#PublicNetworkResource-DeleteanUnmanagedNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource#
-    *      PublicNetworkResource -DeleteanUnmanagedNetwork</a>
-    */
-   @Override
-   public void delete() {
-      context.getApi().getInfrastructureApi().deleteNetwork(target);
-      target = null;
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Public+Network+Resource#PublicNetworkResource-CreateanewUnmanagedNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource#
-    *      PublicNetworkResource -CreateanewUnmanagedNetwork</a>
-    */
-   @Override
-   public void save() {
-      this.addEnterpriseLink();
-      target = context.getApi().getInfrastructureApi().createNetwork(datacenter.unwrap(), target);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Public+Network+Resource#PublicNetworkResource-UpdateanUnmanagedNetwork"
-    *      > http://community.abiquo.com/display/ABI20/Public+Network+Resource#
-    *      PublicNetworkResource -UpdateanUnmanagedNetwork</a>
-    */
-   @Override
-   public void update() {
-      target = context.getApi().getInfrastructureApi().updateNetwork(target);
-   }
-
-   @Override
-   public Iterable<UnmanagedIp> listIps() {
-      PagedIterable<UnmanagedIpDto> ips = context.getApi().getInfrastructureApi().listUnmanagedIps(target);
-      return wrap(context, UnmanagedIp.class, ips.concat());
-   }
-
-   @Override
-   public Iterable<UnmanagedIp> listIps(final IpOptions options) {
-      PaginatedCollection<UnmanagedIpDto, UnmanagedIpsDto> ips = context.getApi().getInfrastructureApi()
-            .listUnmanagedIps(target, options);
-      return wrap(context, UnmanagedIp.class, ips.toPagedIterable().concat());
-   }
-
-   @Override
-   public UnmanagedIp getIp(final Integer id) {
-      UnmanagedIpDto ip = context.getApi().getInfrastructureApi().getUnmanagedIp(target, id);
-      return wrap(context, UnmanagedIp.class, ip);
-   }
-
-   // Parent access
-
-   public Enterprise getEnterprise() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.ENTERPRISE), ValidationErrors.MISSING_REQUIRED_LINK
-            + " " + ParentLinkName.ENTERPRISE);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<EnterpriseDto> parser = new ParseXMLWithJAXB<EnterpriseDto>(context.utils().xml(),
-            TypeLiteral.get(EnterpriseDto.class));
-
-      enterprise = wrap(context, Enterprise.class, parser.apply(response));
-      return enterprise;
-   }
-
-   public Datacenter getDatacenter() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.DATACENTER), ValidationErrors.MISSING_REQUIRED_LINK
-            + " " + ParentLinkName.DATACENTER);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<DatacenterDto> parser = new ParseXMLWithJAXB<DatacenterDto>(context.utils().xml(),
-            TypeLiteral.get(DatacenterDto.class));
-
-      datacenter = wrap(context, Datacenter.class, parser.apply(response));
-      return datacenter;
-   }
-
-   private void addEnterpriseLink() {
-      checkNotNull(enterprise, ValidationErrors.NULL_RESOURCE + Enterprise.class);
-      checkNotNull(enterprise.getId(),
-            ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + Enterprise.class.getCanonicalName());
-
-      RESTLink link = enterprise.unwrap().searchLink("edit");
-
-      checkNotNull(link, ValidationErrors.MISSING_REQUIRED_LINK);
-
-      target.addLink(new RESTLink("enterprise", link.getHref()));
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter,
-         final Enterprise enterprise) {
-      return new Builder(context, datacenter, enterprise);
-   }
-
-   public static class Builder extends NetworkBuilder<Builder> {
-      private Datacenter datacenter;
-
-      private Enterprise enterprise;
-
-      private Optional<NetworkServiceType> networkServiceType = Optional.absent();
-
-      public Builder(final ApiContext<AbiquoApi> context, final Datacenter datacenter, final Enterprise enterprise) {
-         super(context);
-         this.datacenter = checkNotNull(datacenter,
-               ValidationErrors.NULL_RESOURCE + Datacenter.class.getCanonicalName());
-         this.enterprise = checkNotNull(enterprise,
-               ValidationErrors.NULL_RESOURCE + Enterprise.class.getCanonicalName());
-         this.context = context;
-      }
-
-      public Builder datacenter(final Datacenter datacenter) {
-         this.datacenter = checkNotNull(datacenter,
-               ValidationErrors.NULL_RESOURCE + Datacenter.class.getCanonicalName());
-         return this;
-      }
-
-      public Builder enterprise(final Enterprise enterprise) {
-         this.enterprise = checkNotNull(enterprise,
-               ValidationErrors.NULL_RESOURCE + Enterprise.class.getCanonicalName());
-         return this;
-      }
-
-      public Builder networkServiceType(final NetworkServiceType networkServiceType) {
-         this.networkServiceType = Optional.of(networkServiceType);
-         return this;
-      }
-
-      public UnmanagedNetwork build() {
-         VLANNetworkDto dto = new VLANNetworkDto();
-         dto.setName(name);
-         dto.setTag(tag);
-         dto.setGateway(gateway);
-         dto.setAddress(address);
-         dto.setMask(mask);
-         dto.setPrimaryDNS(primaryDNS);
-         dto.setSecondaryDNS(secondaryDNS);
-         dto.setSufixDNS(suffixDNS);
-         dto.setDefaultNetwork(defaultNetwork);
-         dto.setUnmanaged(true);
-         dto.setType(NetworkType.UNMANAGED);
-
-         NetworkServiceType nst = networkServiceType.or(datacenter.defaultNetworkServiceType());
-         dto.getLinks().add(new RESTLink("networkservicetype", nst.unwrap().getEditLink().getHref()));
-
-         UnmanagedNetwork network = new UnmanagedNetwork(context, dto);
-         network.datacenter = datacenter;
-         network.enterprise = enterprise;
-
-         return network;
-      }
-
-      public static Builder fromUnmanagedNetwork(final UnmanagedNetwork in) {
-         return UnmanagedNetwork.builder(in.context, in.datacenter, in.enterprise).name(in.getName()).tag(in.getTag())
-               .gateway(in.getGateway()).address(in.getAddress()).mask(in.getMask()).primaryDNS(in.getPrimaryDNS())
-               .secondaryDNS(in.getSecondaryDNS()).suffixDNS(in.getSuffixDNS()).defaultNetwork(in.getDefaultNetwork());
-      }
-   }
-
-   @Override
-   public String toString() {
-      return "Unmanaged " + super.toString();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/options/IpOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/options/IpOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/options/IpOptions.java
deleted file mode 100644
index a1d2f36..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/options/IpOptions.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network.options;
-
-import org.jclouds.abiquo.domain.options.FilterOptions.BaseFilterOptionsBuilder;
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query ips.
- */
-public class IpOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      IpOptions options = new IpOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder extends BaseFilterOptionsBuilder<Builder> {
-      private Boolean free;
-
-      public Builder free(final boolean free) {
-         this.free = free;
-         return this;
-      }
-
-      public IpOptions build() {
-         IpOptions options = new IpOptions();
-
-         if (free != null) {
-            options.queryParameters.put("free", String.valueOf(free));
-         }
-
-         return addFilterOptions(options);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/network/options/NetworkOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/options/NetworkOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/network/options/NetworkOptions.java
deleted file mode 100644
index df92d99..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/network/options/NetworkOptions.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.network.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-import com.abiquo.model.enumerator.NetworkType;
-
-/**
- * Available options to query networks.
- */
-public class NetworkOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      NetworkOptions options = new NetworkOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-      private NetworkType type;
-
-      private Boolean all;
-
-      public Builder type(final NetworkType type) {
-         this.type = type;
-         return this;
-      }
-
-      public Builder all(final boolean all) {
-         this.all = all;
-         return this;
-      }
-
-      public NetworkOptions build() {
-         NetworkOptions options = new NetworkOptions();
-
-         if (type != null) {
-            options.queryParameters.put("type", String.valueOf(type));
-         }
-
-         if (all != null) {
-            options.queryParameters.put("all", String.valueOf(all));
-         }
-
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/options/FilterOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/options/FilterOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/options/FilterOptions.java
deleted file mode 100644
index 7f4808d..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/options/FilterOptions.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-import com.google.common.collect.Multimap;
-
-/**
- * Available options to filter and pagination methods.
- */
-public class FilterOptions extends BaseHttpRequestOptions {
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      FilterOptions options = new FilterOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static FilterOptionsBuilder builder() {
-      return new FilterOptionsBuilder();
-   }
-
-   public static class FilterOptionsBuilder extends BaseFilterOptionsBuilder<FilterOptionsBuilder> {
-      public FilterOptions build() {
-         FilterOptions options = new FilterOptions();
-         return super.addFilterOptions(options);
-      }
-   }
-
-   @SuppressWarnings("unchecked")
-   public static class BaseFilterOptionsBuilder<T extends BaseFilterOptionsBuilder<T>> {
-      protected Integer startWith;
-
-      protected Integer limit;
-
-      protected String by;
-
-      protected String has;
-
-      protected Boolean asc;
-
-      public T startWith(final int startWith) {
-         this.startWith = startWith;
-         return (T) this;
-      }
-
-      public T has(final String has) {
-         this.has = has;
-         return (T) this;
-      }
-
-      public T limit(final int limit) {
-         this.limit = limit;
-         return (T) this;
-      }
-
-      public T orderBy(final String by) {
-         this.by = by;
-         return (T) this;
-      }
-
-      public T asc(final boolean asc) {
-         this.asc = asc;
-         return (T) this;
-      }
-
-      protected <O extends BaseHttpRequestOptions> O addFilterOptions(final O options) {
-         Multimap<String, String> queryParameters = options.buildQueryParameters();
-
-         if (startWith != null) {
-            queryParameters.put("startwith", startWith.toString());
-         }
-
-         if (limit != null) {
-            queryParameters.put("limit", limit.toString());
-         }
-
-         if (has != null) {
-            queryParameters.put("has", has);
-         }
-
-         if (by != null) {
-            queryParameters.put("by", by);
-         }
-
-         if (asc != null) {
-            queryParameters.put("asc", asc.toString());
-         }
-
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/task/AsyncJob.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/task/AsyncJob.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/task/AsyncJob.java
deleted file mode 100644
index 36872b4..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/task/AsyncJob.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.task;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.task.Job.JobState;
-import com.abiquo.server.core.task.Job.JobType;
-import com.abiquo.server.core.task.JobDto;
-
-/**
- * Adds generic high level functionality to {JobDto}.
- */
-public class AsyncJob extends DomainWrapper<JobDto> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected AsyncJob(final ApiContext<AbiquoApi> context, final JobDto target) {
-      super(context, target);
-   }
-
-   // Delegate methods
-
-   public String getDescription() {
-      return target.getDescription();
-   }
-
-   public String getId() {
-      return target.getId();
-   }
-
-   public JobState getRollbackState() {
-      return target.getRollbackState();
-   }
-
-   public JobState getState() {
-      return target.getState();
-   }
-
-   public long getTimestamp() {
-      return target.getTimestamp();
-   }
-
-   public JobType getType() {
-      return target.getType();
-   }
-
-   @Override
-   public String toString() {
-      return "AsyncJob [id=" + getId() + ", description=" + getDescription() + ", rollbackState=" + getRollbackState()
-            + ", state=" + getState() + ", timestamp=" + getTimestamp() + ", type=" + getType() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/task/AsyncTask.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/task/AsyncTask.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/task/AsyncTask.java
deleted file mode 100644
index 50018c3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/task/AsyncTask.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.task;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.SingleResourceTransportDto;
-import com.abiquo.server.core.task.TaskDto;
-import com.abiquo.server.core.task.enums.TaskState;
-import com.abiquo.server.core.task.enums.TaskType;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds generic high level functionality to {TaskDto}.
- * 
- * @param <T>
- *           The type of the result generated by the task.
- * @param <D>
- *           The type of the dto generated by the task.
- */
-public abstract class AsyncTask<T extends DomainWrapper<D>, D extends SingleResourceTransportDto> extends
-      DomainWrapper<TaskDto> {
-   /** The type of the result generated by the task. */
-   private Class<T> resultDomainClass;
-
-   /** The type of the dto generated by the task. */
-   private Class<D> resultDtoClass;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected AsyncTask(final ApiContext<AbiquoApi> context, final TaskDto target, final Class<T> resultDomainClass,
-         final Class<D> resultDtoClass) {
-      super(context, target);
-      this.resultDomainClass = resultDomainClass;
-      this.resultDtoClass = resultDtoClass;
-   }
-
-   // Domain operations
-
-   /**
-    * Refresh the state of the task.
-    */
-   @Override
-   public void refresh() {
-      RESTLink self = checkNotNull(target.searchLink("self"), ValidationErrors.MISSING_REQUIRED_LINK + "self");
-
-      target = context.getApi().getTaskApi().getTask(self);
-   }
-
-   public T getResult() {
-      RESTLink link = target.searchLink(ParentLinkName.TASK_RESULT);
-      if (link == null) {
-         // The task may still be in progress or has failed
-         return null;
-      }
-
-      HttpResponse response = context.getApi().get(link);
-      ParseXMLWithJAXB<D> parser = new ParseXMLWithJAXB<D>(context.utils().xml(), TypeLiteral.get(resultDtoClass));
-
-      return wrap(context, resultDomainClass, parser.apply(response));
-   }
-
-   // Children access
-
-   /**
-    * Get the individual jobs that compose the current task.
-    */
-   public Iterable<AsyncJob> getJobs() {
-      return wrap(context, AsyncJob.class, target.getJobs().getCollection());
-   }
-
-   // Conversion helpers
-
-   public ConversionTask asConversionTask() {
-      return ConversionTask.class.cast(this);
-   }
-
-   public VirtualMachineTask asVirtualMachineTask() {
-      return VirtualMachineTask.class.cast(this);
-   }
-
-   public VirtualMachineTemplateTask asVirtualMachineTemplateTask() {
-      return VirtualMachineTemplateTask.class.cast(this);
-   }
-
-   // Delegate methods
-
-   public String getOwnerId() {
-      return target.getOwnerId();
-   }
-
-   public TaskState getState() {
-      return target.getState();
-   }
-
-   public String getTaskId() {
-      return target.getTaskId();
-   }
-
-   public long getTimestamp() {
-      return target.getTimestamp();
-   }
-
-   public TaskType getType() {
-      return target.getType();
-   }
-
-   public String getUserId() {
-      return target.getUserId();
-   }
-
-   @Override
-   public String toString() {
-      return "AsyncTask [taskId=" + getTaskId() + ", ownerId=" + getOwnerId() + ", timestamp=" + getTimestamp()
-            + ", userId=" + getUserId() + ", state=" + getState() + ", type=" + getType() + "]";
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/task/ConversionTask.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/task/ConversionTask.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/task/ConversionTask.java
deleted file mode 100644
index 391e0d3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/task/ConversionTask.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jclouds.abiquo.domain.task;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.Conversion;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.appslibrary.ConversionDto;
-import com.abiquo.server.core.task.TaskDto;
-
-/**
- * Task that produces a {@link Conversion}.
- */
-public class ConversionTask extends AsyncTask<Conversion, ConversionDto> {
-   protected ConversionTask(final ApiContext<AbiquoApi> context, final TaskDto target) {
-      super(context, target, Conversion.class, ConversionDto.class);
-   }
-
-   @Override
-   public String toString() {
-      return "Conversion" + super.toString();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/task/VirtualMachineTask.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/task/VirtualMachineTask.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/task/VirtualMachineTask.java
deleted file mode 100644
index 09e5d8d..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/task/VirtualMachineTask.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jclouds.abiquo.domain.task;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.task.TaskDto;
-
-/**
- * Task that produces a {@link VirtualMachine}.
- */
-public class VirtualMachineTask extends AsyncTask<VirtualMachine, VirtualMachineWithNodeExtendedDto> {
-   protected VirtualMachineTask(final ApiContext<AbiquoApi> context, final TaskDto target) {
-      super(context, target, VirtualMachine.class, VirtualMachineWithNodeExtendedDto.class);
-   }
-
-   @Override
-   public String toString() {
-      return "VirtualMachine" + super.toString();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/task/VirtualMachineTemplateTask.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/task/VirtualMachineTemplateTask.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/task/VirtualMachineTemplateTask.java
deleted file mode 100644
index dbee665..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/task/VirtualMachineTemplateTask.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jclouds.abiquo.domain.task;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.task.TaskDto;
-
-/**
- * Task that produces a {@link VirtualMachineTemplate}.
- */
-public class VirtualMachineTemplateTask extends AsyncTask<VirtualMachineTemplate, VirtualMachineTemplateDto> {
-   protected VirtualMachineTemplateTask(final ApiContext<AbiquoApi> context, final TaskDto target) {
-      super(context, target, VirtualMachineTemplate.class, VirtualMachineTemplateDto.class);
-   }
-
-   @Override
-   public String toString() {
-      return "VirtualMachineTemplate" + super.toString();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/util/LinkUtils.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/util/LinkUtils.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/util/LinkUtils.java
deleted file mode 100644
index 62ad535..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/util/LinkUtils.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.util;
-
-import static com.google.common.collect.Iterables.filter;
-
-import java.util.List;
-
-import org.jclouds.abiquo.predicates.LinkPredicates;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.SingleResourceTransportDto;
-import com.google.common.collect.ImmutableList;
-
-/**
- * Utility method to work with {@link RESTLink} objects.
- */
-public class LinkUtils {
-   /**
-    * Get the link that points to the current resource.
-    * 
-    * @param dto
-    *           The target dto.
-    * @return The link to the current resource.
-    */
-   public static RESTLink getSelfLink(final SingleResourceTransportDto dto) {
-      RESTLink link = dto.searchLink("edit");
-      return link == null ? dto.searchLink("self") : link;
-   }
-
-   /**
-    * Filter the given link list and return only the links that point to a NIC.
-    * 
-    * @param links
-    *           The list with the links to filter.
-    * @return A list with all links that point to a NIC.
-    */
-   public static List<RESTLink> filterNicLinks(final List<RESTLink> links) {
-      return ImmutableList.copyOf(filter(links, LinkPredicates.isNic()));
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/fallbacks/MovedVolume.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/fallbacks/MovedVolume.java b/abiquo/src/main/java/org/jclouds/abiquo/fallbacks/MovedVolume.java
deleted file mode 100644
index 9d55d3e..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/fallbacks/MovedVolume.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.fallbacks;
-
-import static com.google.common.base.Throwables.getCausalChain;
-import static com.google.common.base.Throwables.propagate;
-import static com.google.common.collect.Iterables.find;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.Fallback;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.HttpResponseException;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.server.core.infrastructure.storage.MovedVolumeDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Predicate;
-import com.google.inject.TypeLiteral;
-
-/**
- * Return false on service error exceptions.
- */
-@Singleton
-public class MovedVolume implements Fallback<VolumeManagementDto> {
-
-   @Singleton
-   @VisibleForTesting
-   static class ReturnMoveVolumeReference extends ParseXMLWithJAXB<MovedVolumeDto> {
-      @Inject
-      public ReturnMoveVolumeReference(final XMLParser xml, final TypeLiteral<MovedVolumeDto> type) {
-         super(xml, type);
-      }
-
-   }
-
-   private ParseXMLWithJAXB<MovedVolumeDto> parser;
-
-   @Inject
-   public MovedVolume(final ReturnMoveVolumeReference parser) {
-      this.parser = parser;
-   }
-
-   @Override
-   public VolumeManagementDto createOrPropagate(Throwable from) throws Exception {
-      Throwable exception = find(getCausalChain(from), isMovedException(from), null);
-
-      if (exception != null) {
-         HttpResponseException responseException = (HttpResponseException) exception;
-         HttpResponse response = responseException.getResponse();
-
-         return parser.apply(response).getVolume();
-      }
-
-      throw propagate(from);
-   }
-
-   private static Predicate<Throwable> isMovedException(final Throwable exception) {
-      return new Predicate<Throwable>() {
-         @Override
-         public boolean apply(final Throwable input) {
-            if (input instanceof HttpResponseException) {
-               HttpResponse response = ((HttpResponseException) input).getResponse();
-               return response != null && response.getStatusCode() == Status.MOVED_PERMANENTLY.getStatusCode();
-            }
-
-            return false;
-         }
-      };
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/AdminApi.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/AdminApi.java b/abiquo/src/main/java/org/jclouds/abiquo/features/AdminApi.java
deleted file mode 100644
index 811c791..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/AdminApi.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import java.io.Closeable;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.binders.BindToPath;
-import org.jclouds.abiquo.binders.BindToXMLPayloadAndPath;
-import org.jclouds.abiquo.functions.enterprise.ParseEnterpriseId;
-import org.jclouds.abiquo.http.filters.AbiquoAuthentication;
-import org.jclouds.abiquo.http.filters.AppendApiVersionToMediaType;
-import org.jclouds.abiquo.rest.annotations.EndpointLink;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.JAXBResponseParser;
-import org.jclouds.rest.annotations.ParamParser;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.binders.BindToXMLPayload;
-
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.enterprise.PrivilegesDto;
-import com.abiquo.server.core.enterprise.RoleDto;
-import com.abiquo.server.core.enterprise.RolesDto;
-import com.abiquo.server.core.enterprise.UserDto;
-
-/**
- * Provides synchronous access to Abiquo Admin API.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/API+Reference">
- *      http://community.abiquo.com/display/ABI20/API+Reference</a>
- */
-@RequestFilters({ AbiquoAuthentication.class, AppendApiVersionToMediaType.class })
-public interface AdminApi extends Closeable {
-   /* ********************** User ********************** */
-
-   /**
-    * Get the information of the current user.
-    * 
-    * @return The information of the current user.
-    */
-   @Named("user:get")
-   @GET
-   @Path("/login")
-   @Consumes(UserDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   UserDto getCurrentUser();
-
-   /* ********************** Role ********************** */
-
-   /**
-    * List global roles.
-    * 
-    * @return The list of global Roles.
-    */
-   @Named("role:list")
-   @GET
-   @Path("/admin/roles")
-   @Consumes(RolesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   RolesDto listRoles();
-
-   /**
-    * List enterprise roles.
-    * 
-    * @return The list of Roles for the given enterprise.
-    */
-   @Named("role:list")
-   @GET
-   @Path("/admin/roles")
-   @Consumes(RolesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   RolesDto listRoles(@QueryParam("identerprise") @ParamParser(ParseEnterpriseId.class) final EnterpriseDto enterprise);
-
-   /**
-    * Retrieves the role of the given user.
-    * 
-    * @param user
-    *           The user.
-    * @return The role of the user.
-    */
-   @Named("role:get")
-   @GET
-   @Consumes(RoleDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   RoleDto getRole(@EndpointLink("role") @BinderParam(BindToPath.class) UserDto user);
-
-   /**
-    * Get the given role.
-    * 
-    * @param roleId
-    *           The id of the role.
-    * @return The role or <code>null</code> if it does not exist.
-    */
-   @Named("role:get")
-   @GET
-   @Path("/admin/roles/{role}")
-   @Consumes(RoleDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   RoleDto getRole(@PathParam("role") Integer roleId);
-
-   /**
-    * Deletes an existing role.
-    * 
-    * @param role
-    *           The role to delete.
-    */
-   @Named("role:delete")
-   @DELETE
-   void deleteRole(@EndpointLink("edit") @BinderParam(BindToPath.class) RoleDto role);
-
-   /**
-    * Updates an existing role.
-    * 
-    * @param role
-    *           The new attributes for the role.
-    * @return The updated role.
-    */
-   @Named("role:update")
-   @PUT
-   @Produces(RoleDto.BASE_MEDIA_TYPE)
-   @Consumes(RoleDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   RoleDto updateRole(@EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) RoleDto role);
-
-   /**
-    * Create a new role.
-    * 
-    * @param role
-    *           The role to be created.
-    * @return The created role.
-    */
-   @Named("role:create")
-   @POST
-   @Path("/admin/roles")
-   @Produces(RoleDto.BASE_MEDIA_TYPE)
-   @Consumes(RoleDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   RoleDto createRole(@BinderParam(BindToXMLPayload.class) RoleDto role);
-
-   /**
-    * Get privileges of the given role.
-    * 
-    * @param role
-    *           The role.
-    * @return The list of privileges.
-    */
-   @Named("privilege:list")
-   @GET
-   @Consumes(PrivilegesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   PrivilegesDto listPrivileges(@EndpointLink("privileges") @BinderParam(BindToPath.class) RoleDto role);
-}


[21/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachine.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachine.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachine.java
deleted file mode 100644
index 25b6667..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachine.java
+++ /dev/null
@@ -1,887 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWithTasksWrapper;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineOptions;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.network.Ip;
-import org.jclouds.abiquo.domain.network.Network;
-import org.jclouds.abiquo.domain.network.UnmanagedNetwork;
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.domain.task.VirtualMachineTemplateTask;
-import org.jclouds.abiquo.domain.util.LinkUtils;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.monitor.VirtualMachineMonitor;
-import org.jclouds.abiquo.predicates.LinkPredicates;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.abiquo.strategy.cloud.ListAttachedNics;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.cloud.VirtualMachineInstanceDto;
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.abiquo.server.core.cloud.VirtualMachineStateDto;
-import com.abiquo.server.core.cloud.VirtualMachineTaskDto;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpDto;
-import com.abiquo.server.core.infrastructure.network.VMNetworkConfigurationDto;
-import com.abiquo.server.core.infrastructure.network.VMNetworkConfigurationsDto;
-import com.abiquo.server.core.infrastructure.storage.DiskManagementDto;
-import com.abiquo.server.core.infrastructure.storage.DisksManagementDto;
-import com.abiquo.server.core.infrastructure.storage.DvdManagementDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.abiquo.server.core.infrastructure.storage.VolumesManagementDto;
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds high level functionality to {@link VirtualMachineWithNodeExtendedDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/VirtualMachineResource">
- *      http://community.abiquo.com/display/ABI20/VirtualMachineResource</a>
- */
-public class VirtualMachine extends DomainWithTasksWrapper<VirtualMachineWithNodeExtendedDto> {
-   /** The virtual appliance where the virtual machine belongs. */
-   private VirtualAppliance virtualAppliance;
-
-   /** The virtual machine template of the virtual machine. */
-   private VirtualMachineTemplate template;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected VirtualMachine(final ApiContext<AbiquoApi> context, final VirtualMachineWithNodeExtendedDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * Delete the virtual machine.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualMachineResource#VirtualMachineResource-Deleteavirtualmachine"
-    *      > http://community.abiquo.com/display/ABI20/VirtualMachineResource#
-    *      VirtualMachineResource -Deleteavirtualmachine</a>
-    */
-   public void delete() {
-      context.getApi().getCloudApi().deleteVirtualMachine(target);
-      target = null;
-   }
-
-   /**
-    * Create a new virtual machine in Abiquo.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualMachineResource#VirtualMachineResource-Createavirtualmachine"
-    *      > http://community.abiquo.com/display/ABI20/VirtualMachineResource#
-    *      VirtualMachineResource-Createavirtualmachine</a>
-    */
-   public void save() {
-      checkNotNull(template, ValidationErrors.NULL_RESOURCE + VirtualMachineTemplate.class);
-      checkNotNull(template.getId(), ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + VirtualMachineTemplate.class);
-
-      this.updateLink(target, ParentLinkName.VIRTUAL_MACHINE_TEMPLATE, template.unwrap(), "edit");
-
-      target = context.getApi().getCloudApi().createVirtualMachine(virtualAppliance.unwrap(), target);
-   }
-
-   /**
-    * Update virtual machine information in the server with the data from this
-    * virtual machine. This is an asynchronous call. This method returns a
-    * {@link org.jclouds.abiquo.domain.task.AsyncTask} object that keeps track
-    * of the task completion. Please refer to the documentation for details.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualMachineResource#VirtualMachineResource-Modifyavirtualmachine"
-    *      > http://community.abiquo.com/display/ABI20/VirtualMachineResource#
-    *      VirtualMachineResource-Modifyavirtualmachine</a>
-    * @see github: <a href=
-    *      "https://github.com/abiquo/jclouds-abiquo/wiki/Asynchronous-monitor-example"
-    *      > https://github.com/abiquo/jclouds-abiquo/wiki/Asynchronous-monitor-
-    *      example</a>
-    * @return The task reference or <code>null</code> if the operation completed
-    *         synchronously.
-    */
-   public VirtualMachineTask update() {
-      AcceptedRequestDto<String> taskRef = context.getApi().getCloudApi().updateVirtualMachine(target);
-      return taskRef == null ? null : getTask(taskRef).asVirtualMachineTask();
-   }
-
-   /**
-    * Update virtual machine information in the server with the data from this
-    * virtual machine. This is an asynchronous call. This method returns a
-    * {@link org.jclouds.abiquo.domain.task.AsyncTask} object that keeps track
-    * of the task completion. Please refer to the documentation for details.
-    * 
-    * @param force
-    *           Force update.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualMachineResource#VirtualMachineResource-Modifyavirtualmachine"
-    *      > http://community.abiquo.com/display/ABI20/VirtualMachineResource#
-    *      VirtualMachineResource-Modifyavirtualmachine</a>
-    * @see github: <a href=
-    *      "https://github.com/abiquo/jclouds-abiquo/wiki/Asynchronous-monitor-example"
-    *      > https://github.com/abiquo/jclouds-abiquo/wiki/Asynchronous-monitor-
-    *      example</a>
-    * @return The task reference or <code>null</code> if the operation completed
-    *         synchronously.
-    */
-   public VirtualMachineTask update(final boolean force) {
-      AcceptedRequestDto<String> taskRef = context.getApi().getCloudApi()
-            .updateVirtualMachine(target, VirtualMachineOptions.builder().force(force).build());
-      return taskRef == null ? null : getTask(taskRef).asVirtualMachineTask();
-   }
-
-   /**
-    * Change the state of the virtual machine. This is an asynchronous call.
-    * This method returns a {@link org.jclouds.abiquo.domain.task.AsyncTask}
-    * object that keeps track of the task completion. Please refer to the
-    * documentation for details.
-    * 
-    * @param state
-    *           The new state of the virtual machine.
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualMachineResource#VirtualMachineResource-Changethestateofavirtualmachine"
-    *      > http://community.abiquo.com/display/ABI20/VirtualMachineResource#
-    *      VirtualMachineResource-Changethestateofavirtualmachine</a>
-    * @see github: <a href=
-    *      "https://github.com/abiquo/jclouds-abiquo/wiki/Asynchronous-monitor-example"
-    *      > https://github.com/abiquo/jclouds-abiquo/wiki/Asynchronous-monitor-
-    *      example</a>
-    * @return The task reference or <code>null</code> if the operation completed
-    *         synchronously.
-    */
-   public VirtualMachineTask changeState(final VirtualMachineState state) {
-      VirtualMachineStateDto dto = new VirtualMachineStateDto();
-      dto.setState(state);
-
-      AcceptedRequestDto<String> taskRef = context.getApi().getCloudApi().changeVirtualMachineState(target, dto);
-
-      return getTask(taskRef).asVirtualMachineTask();
-   }
-
-   /**
-    * Retrieve the state of the virtual machine.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualMachineResource#VirtualMachineResource-Retrievethestateofthevirtualmachine"
-    *      > http://community.abiquo.com/display/ABI20/VirtualMachineResource#
-    *      VirtualMachineResource-Retrievethestateofthevirtualmachine</a>
-    * @return Current state of the virtual machine.
-    */
-   public VirtualMachineState getState() {
-      VirtualMachineStateDto stateDto = context.getApi().getCloudApi().getVirtualMachineState(target);
-      VirtualMachineState state = stateDto.getState();
-      target.setState(state);
-      target.setIdState(state.id());
-      return state;
-   }
-
-   /**
-    * Take a snapshot of the given virtual machine.
-    * <p>
-    * This will create a new {@link VirtualMachineTemplate} in the appliance
-    * library based on the given virtual machine.
-    * 
-    * @param snapshotName
-    *           The name of the snapshot.
-    * @return The task reference to the snapshot process.
-    */
-   public VirtualMachineTemplateTask snapshot(final String snapshotName) {
-      VirtualMachineInstanceDto snapshotConfig = new VirtualMachineInstanceDto();
-      snapshotConfig.setInstanceName(snapshotName);
-
-      AcceptedRequestDto<String> response = context.getApi().getCloudApi()
-            .snapshotVirtualMachine(target, snapshotConfig);
-
-      return getTask(response).asVirtualMachineTemplateTask();
-   }
-
-   // Parent access
-
-   /**
-    * Retrieve the virtual appliance where this virtual machine is.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualApplianceResource#VirtualApplianceResource-Retrieveavirtualappliance"
-    *      > http://community.abiquo.com/display/ABI20/VirtualApplianceResource#
-    *      VirtualApplianceResource-Retrieveavirtualappliance</a>
-    * @return The virtual appliance where this virtual machine is.
-    */
-   public VirtualAppliance getVirtualAppliance() {
-      RESTLink link = checkNotNull(target.searchLink(ParentLinkName.VIRTUAL_APPLIANCE),
-            ValidationErrors.MISSING_REQUIRED_LINK + " " + ParentLinkName.VIRTUAL_APPLIANCE);
-
-      HttpResponse response = context.getApi().get(link);
-
-      ParseXMLWithJAXB<VirtualApplianceDto> parser = new ParseXMLWithJAXB<VirtualApplianceDto>(context.utils().xml(),
-            TypeLiteral.get(VirtualApplianceDto.class));
-
-      return wrap(context, VirtualAppliance.class, parser.apply(response));
-   }
-
-   /**
-    * Retrieve the virtual datacenter where this virtual machine is.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualDatacenterResource#VirtualDatacenterResource-Retireveavirtualdatacenter"
-    *      > http://community.abiquo.com/display/ABI20/VirtualDatacenterResource
-    *      # VirtualDatacenterResource-Retireveavirtualdatacenter</a>
-    * @return The virtual datacenter where this virtual machine is.
-    */
-   public VirtualDatacenter getVirtualDatacenter() {
-      Integer virtualDatacenterId = target.getIdFromLink(ParentLinkName.VIRTUAL_DATACENTER);
-      VirtualDatacenterDto dto = context.getApi().getCloudApi().getVirtualDatacenter(virtualDatacenterId);
-      return wrap(context, VirtualDatacenter.class, dto);
-   }
-
-   /**
-    * Retrieve the enterprise of this virtual machine.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/EnterpriseResource#EnterpriseResource-RetrieveanEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/EnterpriseResource#
-    *      EnterpriseResource- RetrieveanEnterprise</a>
-    * @return Enterprise of this virtual machine.
-    */
-   public Enterprise getEnterprise() {
-      Integer enterpriseId = target.getIdFromLink(ParentLinkName.ENTERPRISE);
-      EnterpriseDto dto = context.getApi().getEnterpriseApi().getEnterprise(enterpriseId);
-      return wrap(context, Enterprise.class, dto);
-   }
-
-   /**
-    * Retrieve the template of this virtual machine.
-    * 
-    * @return Template of this virtual machine.
-    */
-   public VirtualMachineTemplate getTemplate() {
-      VirtualMachineTemplateDto dto = context.getApi().getCloudApi().getVirtualMachineTemplate(target);
-      return wrap(context, VirtualMachineTemplate.class, dto);
-   }
-
-   // Children access
-
-   public Iterable<HardDisk> listAttachedHardDisks() {
-      refresh();
-      DisksManagementDto hardDisks = context.getApi().getCloudApi().listAttachedHardDisks(target);
-      return wrap(context, HardDisk.class, hardDisks.getCollection());
-   }
-
-   public Iterable<Volume> listAttachedVolumes() {
-      refresh();
-      VolumesManagementDto volumes = context.getApi().getCloudApi().listAttachedVolumes(target);
-      return wrap(context, Volume.class, volumes.getCollection());
-   }
-
-   public Iterable<Ip<?, ?>> listAttachedNics() {
-      // The strategy will refresh the vm. There is no need to do it here
-      ListAttachedNics strategy = context.utils().injector().getInstance(ListAttachedNics.class);
-      return ImmutableList.copyOf(strategy.execute(this));
-   }
-
-   // Actions
-
-   public VirtualMachineTask deploy() {
-      return deploy(false);
-   }
-
-   public VirtualMachineTask deploy(final boolean forceEnterpriseSoftLimits) {
-      VirtualMachineTaskDto force = new VirtualMachineTaskDto();
-      force.setForceEnterpriseSoftLimits(forceEnterpriseSoftLimits);
-
-      AcceptedRequestDto<String> response = context.getApi().getCloudApi().deployVirtualMachine(unwrap(), force);
-
-      return getTask(response).asVirtualMachineTask();
-   }
-
-   public VirtualMachineTask undeploy() {
-      return undeploy(false);
-   }
-
-   public VirtualMachineTask undeploy(final boolean forceUndeploy) {
-      VirtualMachineTaskDto force = new VirtualMachineTaskDto();
-      force.setForceUndeploy(forceUndeploy);
-
-      AcceptedRequestDto<String> response = context.getApi().getCloudApi().undeployVirtualMachine(unwrap(), force);
-
-      return getTask(response).asVirtualMachineTask();
-   }
-
-   /**
-    * Reboot a virtual machine. This is an asynchronous call. This method
-    * returns a {@link org.jclouds.abiquo.domain.task.AsyncTask} object that
-    * keeps track of the task completion. Please refer to the documentation for
-    * details.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/VirtualMachineResource#VirtualMachineResource-Resetavirtualmachine"
-    *      > http://community.abiquo.com/display/ABI20/Rack+Resource#/
-    *      VirtualMachineResource#
-    *      VirtualMachineResource-Resetavirtualmachine</a>
-    * @see github: <a href=
-    *      "https://github.com/abiquo/jclouds-abiquo/wiki/Asynchronous-monitor-example"
-    *      > https://github.com/abiquo/jclouds-abiquo/wiki/Asynchronous-monitor-
-    *      example</a>
-    * @return The task reference or <code>null</code> if the operation completed
-    *         synchronously.
-    */
-   public VirtualMachineTask reboot() {
-      AcceptedRequestDto<String> response = context.getApi().getCloudApi().rebootVirtualMachine(unwrap());
-
-      return getTask(response).asVirtualMachineTask();
-   }
-
-   public VirtualMachineTask attachHardDisks(final HardDisk... hardDisks) {
-      List<HardDisk> expected = Lists.newArrayList(listAttachedHardDisks());
-      expected.addAll(Arrays.asList(hardDisks));
-
-      HardDisk[] disks = new HardDisk[expected.size()];
-      return setHardDisks(expected.toArray(disks));
-   }
-
-   public VirtualMachineTask detachAllHardDisks() {
-      AcceptedRequestDto<String> taskRef = context.getApi().getCloudApi().detachAllHardDisks(target);
-      return taskRef == null ? null : getTask(taskRef).asVirtualMachineTask();
-   }
-
-   public VirtualMachineTask detachHardDisks(final HardDisk... hardDisks) {
-      List<HardDisk> expected = Lists.newArrayList(listAttachedHardDisks());
-      Iterables.removeIf(expected, hardDiskIdIn(hardDisks));
-
-      HardDisk[] disks = new HardDisk[expected.size()];
-      return setHardDisks(expected.toArray(disks));
-   }
-
-   public VirtualMachineTask setHardDisks(final HardDisk... hardDisks) {
-      AcceptedRequestDto<String> taskRef = context.getApi().getCloudApi()
-            .replaceHardDisks(target, toHardDiskDto(hardDisks));
-      return taskRef == null ? null : getTask(taskRef).asVirtualMachineTask();
-   }
-
-   public VirtualMachineTask attachVolumes(final Volume... volumes) {
-      List<Volume> expected = Lists.newArrayList(listAttachedVolumes());
-      expected.addAll(Arrays.asList(volumes));
-
-      Volume[] vols = new Volume[expected.size()];
-      return setVolumes(true, expected.toArray(vols));
-   }
-
-   public VirtualMachineTask detachAllVolumes() {
-      AcceptedRequestDto<String> taskRef = context.getApi().getCloudApi().detachAllVolumes(target);
-      return taskRef == null ? null : getTask(taskRef).asVirtualMachineTask();
-   }
-
-   public VirtualMachineTask detachVolumes(final Volume... volumes) {
-      List<Volume> expected = Lists.newArrayList(listAttachedVolumes());
-      Iterables.removeIf(expected, volumeIdIn(volumes));
-
-      Volume[] vols = new Volume[expected.size()];
-      return setVolumes(true, expected.toArray(vols));
-   }
-
-   public VirtualMachineTask setVolumes(final Boolean forceSoftLimits, final Volume... volumes) {
-      AcceptedRequestDto<String> taskRef = context
-            .getApi()
-            .getCloudApi()
-            .replaceVolumes(target, VirtualMachineOptions.builder().force(forceSoftLimits).build(),
-                  toVolumeDto(volumes));
-
-      return taskRef == null ? null : getTask(taskRef).asVirtualMachineTask();
-   }
-
-   public VirtualMachineTask setVolumes(final Volume... volumes) {
-      return setVolumes(true, volumes);
-   }
-
-   public VirtualMachineTask setNics(final List<Ip<?, ?>> ips) {
-      // By default the network of the first ip will be used as a gateway
-      return setNics(ips != null && !ips.isEmpty() ? ips.get(0).getNetwork() : null, ips, null);
-   }
-
-   public VirtualMachineTask setNics(final List<Ip<?, ?>> ips, final List<UnmanagedNetwork> unmanagedNetworks) {
-      // By default the network of the first ip will be used as a gateway
-      Network<?> gateway = null;
-      if (ips != null && !ips.isEmpty()) {
-         gateway = ips.get(0).getNetwork();
-      } else if (unmanagedNetworks != null && !unmanagedNetworks.isEmpty()) {
-         gateway = unmanagedNetworks.get(0);
-      }
-
-      return setNics(gateway, ips, unmanagedNetworks);
-   }
-
-   public VirtualMachineTask setNics(final Network<?> gatewayNetwork, final List<Ip<?, ?>> ips) {
-      return setNics(gatewayNetwork, ips, null);
-   }
-
-   public VirtualMachineTask setNics(final Network<?> gatewayNetwork, final List<Ip<?, ?>> ips,
-         final List<UnmanagedNetwork> unmanagedNetworks) {
-      // Remove the gateway configuration and the current nics
-      Iterables.removeIf(target.getLinks(),
-            Predicates.or(LinkPredicates.isNic(), LinkPredicates.rel(ParentLinkName.NETWORK_GATEWAY)));
-
-      // Add the given nics in the appropriate order
-      int i = 0;
-      if (ips != null) {
-         for (i = 0; i < ips.size(); i++) {
-            RESTLink source = LinkUtils.getSelfLink(ips.get(i).unwrap());
-            RESTLink link = new RESTLink("nic" + i, source.getHref());
-            link.setType(ips.get(i).unwrap().getBaseMediaType());
-            target.addLink(link);
-         }
-      }
-
-      // Add unmanaged network references, if given
-      if (unmanagedNetworks != null) {
-         for (UnmanagedNetwork unmanaged : unmanagedNetworks) {
-            RESTLink source = checkNotNull(unmanaged.unwrap().searchLink("ips"), ValidationErrors.MISSING_REQUIRED_LINK
-                  + "ips");
-
-            RESTLink link = new RESTLink("nic" + i, source.getHref());
-            link.setType(UnmanagedIpDto.BASE_MEDIA_TYPE);
-            target.addLink(link);
-            i++;
-         }
-      }
-
-      VirtualMachineTask task = update(true);
-      if (gatewayNetwork == null) {
-         return task;
-      }
-
-      // If there is a gateway network, we have to wait until the network
-      // configuration links are
-      // available
-      if (task != null) {
-         VirtualMachineState originalState = target.getState();
-         VirtualMachineMonitor monitor = context.utils().injector().getInstance(MonitoringService.class)
-               .getVirtualMachineMonitor();
-         monitor.awaitState(originalState, this);
-      }
-
-      // Set the new network configuration
-
-      // Refresh virtual machine, to get the new configuration links
-      refresh();
-
-      VMNetworkConfigurationsDto configs = context.getApi().getCloudApi().listNetworkConfigurations(target);
-
-      Iterables.removeIf(target.getLinks(), LinkPredicates.rel(ParentLinkName.NETWORK_GATEWAY));
-      for (VMNetworkConfigurationDto config : configs.getCollection()) {
-         if (config.getGateway().equalsIgnoreCase(gatewayNetwork.getGateway())) {
-            target.addLink(new RESTLink(ParentLinkName.NETWORK_GATEWAY, config.getEditLink().getHref()));
-            break;
-         }
-      }
-
-      return update(true);
-   }
-
-   // TODO: Get current gateway network
-
-   public void setGatewayNetwork(final Network<?> network) {
-      context.getApi().getCloudApi().setGatewayNetwork(target, network.unwrap());
-      refresh(); // First refresh the target and its links
-   }
-
-   /**
-    * Checks if the virtual machine is persistent.
-    * <p>
-    * Persistent virtual machines have the system disc in an external volume.
-    * This way, when the virtual machine is undeployed, the contents of the
-    * system disk remain in the storage device and the user can deploy the
-    * virtual machine again without losing the data in the system disk.
-    * 
-    * @return Boolean indicating if the virtual machine is persistent.
-    */
-   public boolean isPersistent() {
-      return getTemplate().unwrap().searchLink("volume") != null;
-   }
-
-   public boolean hasDvd() {
-      return target.getDvd() != null;
-   }
-
-   public void attachDvd() {
-      DvdManagementDto dvd = new DvdManagementDto();
-      RESTLink link = new RESTLink("image", "");
-      dvd.addLink(link);
-      target.setDvd(dvd);
-   }
-
-   public void detachDvd() {
-      target.setDvd(null);
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final VirtualAppliance virtualAppliance,
-         final VirtualMachineTemplate template) {
-      return new Builder(context, virtualAppliance, template);
-   }
-
-   public static class Builder {
-      private final ApiContext<AbiquoApi> context;
-
-      private VirtualAppliance virtualAppliance;
-
-      private final VirtualMachineTemplate template;
-
-      private String nameLabel;
-
-      private String internalName;
-
-      private String description;
-
-      private Integer ram;
-
-      private Integer cpu;
-
-      private Integer vncPort;
-
-      private String vncAddress;
-
-      private Integer idState;
-
-      private Integer idType;
-
-      private String password;
-
-      private String keymap;
-
-      private String uuid;
-
-      private boolean dvd;
-
-      public Builder(final ApiContext<AbiquoApi> context, final VirtualAppliance virtualAppliance,
-            final VirtualMachineTemplate template) {
-         super();
-         checkNotNull(virtualAppliance, ValidationErrors.NULL_RESOURCE + VirtualAppliance.class);
-         this.virtualAppliance = virtualAppliance;
-         this.template = template;
-         this.context = context;
-      }
-
-      public Builder nameLabel(final String nameLabel) {
-         this.nameLabel = checkNotNull(nameLabel, "nameLabel must not be null");
-         return this;
-      }
-
-      public Builder description(final String description) {
-         this.description = description;
-         return this;
-      }
-
-      public Builder ram(final int ram) {
-         this.ram = ram;
-         return this;
-      }
-
-      public Builder cpu(final int cpu) {
-         this.cpu = cpu;
-         return this;
-      }
-
-      public Builder password(final String password) {
-         this.password = password;
-         return this;
-      }
-
-      public Builder keymap(final String keymap) {
-         this.keymap = keymap;
-         return this;
-      }
-
-      public Builder dvd(final boolean dvd) {
-         this.dvd = dvd;
-         return this;
-      }
-
-      // This methods are used only to build a builder from an existing
-      // VirtualMachine but should
-      // never be used by the user. This fields are set automatically by Abiquo
-
-      private Builder vncPort(final int vdrpPort) {
-         this.vncPort = vdrpPort;
-         return this;
-      }
-
-      private Builder vncAddress(final String vdrpIP) {
-         this.vncAddress = vdrpIP;
-         return this;
-      }
-
-      private Builder idState(final int idState) {
-         this.idState = idState;
-         return this;
-      }
-
-      private Builder idType(final int idType) {
-         this.idType = idType;
-         return this;
-      }
-
-      private Builder internalName(final String internalName) {
-         this.internalName = internalName;
-         return this;
-      }
-
-      public Builder virtualAppliance(final VirtualAppliance virtualAppliance) {
-         checkNotNull(virtualAppliance, ValidationErrors.NULL_RESOURCE + VirtualAppliance.class);
-         this.virtualAppliance = virtualAppliance;
-         return this;
-      }
-
-      public VirtualMachine build() {
-         VirtualMachineWithNodeExtendedDto dto = new VirtualMachineWithNodeExtendedDto();
-         dto.setNodeName(checkNotNull(nameLabel, ValidationErrors.MISSING_REQUIRED_FIELD + "nameLabel"));
-         dto.setDescription(description);
-         dto.setHdInBytes(template.getHdRequired());
-         dto.setVdrpIP(vncAddress);
-
-         if (cpu != null) {
-            dto.setCpu(cpu);
-         }
-
-         if (ram != null) {
-            dto.setRam(ram);
-         }
-
-         if (vncPort != null) {
-            dto.setVdrpPort(vncPort);
-         }
-
-         if (idState != null) {
-            dto.setIdState(idState);
-         }
-
-         if (idType != null) {
-            dto.setIdType(idType);
-         }
-
-         if (internalName != null) {
-            dto.setName(internalName);
-         }
-
-         dto.setPassword(password);
-         dto.setKeymap(keymap);
-         dto.setUuid(uuid);
-
-         // DVD
-         if (dvd) {
-            DvdManagementDto dvd = new DvdManagementDto();
-            RESTLink link = new RESTLink("image", "");
-            dvd.addLink(link);
-            dto.setDvd(dvd);
-         }
-
-         VirtualMachine virtualMachine = new VirtualMachine(context, dto);
-         virtualMachine.virtualAppliance = virtualAppliance;
-         virtualMachine.template = template;
-
-         return virtualMachine;
-      }
-
-      public static Builder fromVirtualMachine(final VirtualMachine in) {
-         return VirtualMachine.builder(in.context, in.virtualAppliance, in.template).internalName(in.getInternalName())
-               .nameLabel(in.getNameLabel()).description(in.getDescription()).ram(in.getRam()).cpu(in.getCpu())
-               .vncAddress(in.getVncAddress()).vncPort(in.getVncPort()).idState(in.getIdState()).idType(in.getIdType())
-               .password(in.getPassword()).keymap(in.getKeymap()).dvd(in.hasDvd());
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getCpu() {
-      return target.getCpu();
-   }
-
-   public String getDescription() {
-      return target.getDescription();
-   }
-
-   // Read-only field. This value is computed from the size of the Template
-   public Long getHdInBytes() {
-      return target.getHdInBytes();
-   }
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public int getIdState() {
-      return target.getIdState();
-   }
-
-   public int getIdType() {
-      return target.getIdType();
-   }
-
-   public String getNameLabel() {
-      return target.getNodeName();
-   }
-
-   public String getOwnerName() {
-      return target.getUserName() + " " + target.getUserSurname();
-   }
-
-   public String getInternalName() {
-      return target.getName();
-   }
-
-   public String getPassword() {
-      return target.getPassword();
-   }
-
-   public Integer getRam() {
-      return target.getRam();
-   }
-
-   public String getUuid() {
-      return target.getUuid();
-   }
-
-   public String getVncAddress() {
-      return target.getVdrpIP();
-   }
-
-   public int getVncPort() {
-      return target.getVdrpPort();
-   }
-
-   public String getKeymap() {
-      return target.getKeymap();
-   }
-
-   public void setCpu(final int cpu) {
-      target.setCpu(cpu);
-   }
-
-   public void setDescription(final String description) {
-      target.setDescription(description);
-   }
-
-   public void setNameLabel(final String nameLabel) {
-      target.setNodeName(nameLabel);
-   }
-
-   public void setPassword(final String password) {
-      target.setPassword(password);
-   }
-
-   public void setRam(final int ram) {
-      target.setRam(ram);
-   }
-
-   public void setKeymap(final String keymap) {
-      target.setKeymap(keymap);
-   }
-
-   private static VolumeManagementDto[] toVolumeDto(final Volume... volumes) {
-      checkNotNull(volumes, "must provide at least one volume");
-
-      VolumeManagementDto[] dtos = new VolumeManagementDto[volumes.length];
-      for (int i = 0; i < volumes.length; i++) {
-         dtos[i] = volumes[i].unwrap();
-      }
-
-      return dtos;
-   }
-
-   private static DiskManagementDto[] toHardDiskDto(final HardDisk... hardDisks) {
-      checkNotNull(hardDisks, "must provide at least one hard disk");
-
-      DiskManagementDto[] dtos = new DiskManagementDto[hardDisks.length];
-      for (int i = 0; i < hardDisks.length; i++) {
-         dtos[i] = hardDisks[i].unwrap();
-      }
-
-      return dtos;
-   }
-
-   private static Predicate<Volume> volumeIdIn(final Volume... volumes) {
-      return new Predicate<Volume>() {
-         List<Integer> ids = volumeIds(Arrays.asList(volumes));
-
-         @Override
-         public boolean apply(final Volume input) {
-            return ids.contains(input.getId());
-         }
-      };
-   }
-
-   private static Predicate<HardDisk> hardDiskIdIn(final HardDisk... hardDisks) {
-      return new Predicate<HardDisk>() {
-         List<Integer> ids = hardDisksIds(Arrays.asList(hardDisks));
-
-         @Override
-         public boolean apply(final HardDisk input) {
-            return ids.contains(input.getId());
-         }
-      };
-   }
-
-   private static List<Integer> volumeIds(final List<Volume> volumes) {
-      return Lists.transform(volumes, new Function<Volume, Integer>() {
-         @Override
-         public Integer apply(final Volume input) {
-            return input.getId();
-         }
-      });
-   }
-
-   private static List<Integer> hardDisksIds(final List<HardDisk> HardDisk) {
-      return Lists.transform(HardDisk, new Function<HardDisk, Integer>() {
-         @Override
-         public Integer apply(final HardDisk input) {
-            return input.getId();
-         }
-      });
-   }
-
-   @Override
-   public String toString() {
-      return "VirtualMachine [id=" + getId() + ", state=" + target.getState().name() + ", cpu=" + getCpu()
-            + ", description=" + getDescription() + ", hdInBytes=" + getHdInBytes() + ", idType=" + getIdType()
-            + ", nameLabel=" + getNameLabel() + ", internalName=" + getInternalName() + ", password=" + getPassword()
-            + ", ram=" + getRam() + ", uuid=" + getUuid() + ", vncAddress=" + getVncAddress() + ", vncPort="
-            + getVncPort() + ", keymap=" + getKeymap() + ", dvd=" + hasDvd() + "]";
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplate.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplate.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplate.java
deleted file mode 100644
index 30cb26b..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplate.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Date;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.cloud.options.ConversionOptions;
-import org.jclouds.abiquo.domain.config.Category;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.infrastructure.Tier;
-import org.jclouds.abiquo.domain.task.ConversionTask;
-import org.jclouds.abiquo.domain.task.VirtualMachineTemplateTask;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.ConversionState;
-import com.abiquo.model.enumerator.DiskFormatType;
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.abiquo.server.core.appslibrary.CategoryDto;
-import com.abiquo.server.core.appslibrary.ConversionDto;
-import com.abiquo.server.core.appslibrary.ConversionsDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplatePersistentDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds high level functionality to {@link VirtualMachineTemplateDto}.
- * 
- * @see API: <a href=
- *      "http://community.abiquo.com/display/ABI20/Virtual+Machine+Template+Resource"
- *      >
- *      http://community.abiquo.com/display/ABI20/Virtual+Machine+Template+Resource
- *      </a>
- */
-public class VirtualMachineTemplate extends DomainWrapper<VirtualMachineTemplateDto> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected VirtualMachineTemplate(final ApiContext<AbiquoApi> context, final VirtualMachineTemplateDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   public void delete() {
-      context.getApi().getVirtualMachineTemplateApi().deleteVirtualMachineTemplate(target);
-      target = null;
-   }
-
-   public void update() {
-      target = context.getApi().getVirtualMachineTemplateApi().updateVirtualMachineTemplate(target);
-   }
-
-   public VirtualMachineTemplateTask makePersistent(final VirtualDatacenter vdc, final Volume volume,
-         final String persistentTemplateName) {
-      RESTLink storageLink = volume.unwrap().getEditLink();
-      storageLink.setRel("volume");
-      return makePersistent(vdc, storageLink, persistentTemplateName, null);
-   }
-
-   public VirtualMachineTemplateTask makePersistent(final VirtualDatacenter vdc, final Tier tier,
-         final String persistentTemplateName, final String persistentVolumeName) {
-      // infrastructure
-      RESTLink storageLink = tier.unwrap().getEditLink();
-      if (storageLink == null) {
-         // cloud
-         storageLink = tier.unwrap().searchLink("self");
-      }
-      storageLink.setRel(ParentLinkName.TIER);
-      return makePersistent(vdc, storageLink, persistentTemplateName, persistentVolumeName);
-   }
-
-   private VirtualMachineTemplateTask makePersistent(final VirtualDatacenter vdc, final RESTLink storageLink,
-         final String persistentTemplateName, final String persistentVolumeName) {
-      VirtualMachineTemplatePersistentDto persistentData = new VirtualMachineTemplatePersistentDto();
-      persistentData.setPersistentTemplateName(persistentTemplateName);
-      persistentData.setPersistentVolumeName(persistentVolumeName);
-      RESTLink vdcLink = new RESTLink(ParentLinkName.VIRTUAL_DATACENTER, vdc.unwrap().getEditLink().getHref());
-      RESTLink templateLink = new RESTLink(ParentLinkName.VIRTUAL_MACHINE_TEMPLATE, target.getEditLink().getHref());
-
-      persistentData.addLink(vdcLink);
-      persistentData.addLink(storageLink);
-      persistentData.addLink(templateLink);
-
-      // SCG:
-      // A simple user should not have permissions to obtain a datacenter
-      // repository, but at this
-      // point we have the datacenter repository and enterprise ids in the own
-      // target uri. So we
-      // can obtain the path where do the POST
-      // Assumption that to create a new object a user needs to get the parent
-      // object cannot be
-      // applied in this case
-      String editUri = getURI().getPath();
-      Pattern p = Pattern.compile("\\d+");
-      Matcher m = p.matcher(editUri);
-      m.find();
-      Integer idEnt = Integer.valueOf(m.group());
-      m.find();
-      Integer idDcRepo = Integer.valueOf(m.group());
-
-      AcceptedRequestDto<String> response = context.getApi().getVirtualMachineTemplateApi()
-            .createPersistentVirtualMachineTemplate(idEnt, idDcRepo, persistentData);
-
-      return getTask(response).asVirtualMachineTemplateTask();
-   }
-
-   // Children access
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Category+Resource#CategoryResource-Retrieveacategory"
-    *      > http://community.abiquo.com/display/ABI20/Category+Resource#
-    *      CategoryResource- Retrieveacategory</a>
-    */
-   public Category getCategory() {
-      Integer categoryId = target.getIdFromLink(ParentLinkName.CATEGORY);
-      CategoryDto category = context.getApi().getConfigApi().getCategory(categoryId);
-      return wrap(context, Category.class, category);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/Abiquo/Volume+Resource#VolumeResource-Retrieveavolume"
-    *      > http://community.abiquo.com/display/Abiquo/Volume+Resource#
-    *      VolumeResource- Retrieveavolume</a>
-    */
-   public Volume getVolume() {
-      if (this.isPersistent()) {
-         HttpResponse rp = checkNotNull(context.getApi().get(target.searchLink("volume")), "volume");
-
-         ParseXMLWithJAXB<VolumeManagementDto> parser = new ParseXMLWithJAXB<VolumeManagementDto>(
-               context.utils().xml(), TypeLiteral.get(VolumeManagementDto.class));
-
-         VolumeManagementDto dto = parser.apply(rp);
-         return new Volume(context, dto);
-      }
-      return null;
-   }
-
-   public boolean isPersistent() {
-      return target.searchLink("volume") != null;
-   }
-
-   // Parent access
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Enterprise+Resource#EnterpriseResource-RetrieveanEnterprise"
-    *      > http://community.abiquo.com/display/ABI20/Enterprise+Resource#
-    *      EnterpriseResource- RetrieveanEnterprise</a>
-    */
-   public Enterprise getEnterprise() {
-      Integer enterpriseId = target.getIdFromLink(ParentLinkName.ENTERPRISE);
-      return wrap(context, Enterprise.class, context.getApi().getEnterpriseApi().getEnterprise(enterpriseId));
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Datacenter+Resource#DatacenterResource-RetrieveaDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Datacenter+Resource#
-    *      DatacenterResource- RetrieveaDatacenter</a>
-    */
-   public Datacenter getDatacenter() {
-      Integer repositoryId = target.getIdFromLink(ParentLinkName.DATACENTER_REPOSITORY);
-      return wrap(context, Datacenter.class, context.getApi().getInfrastructureApi().getDatacenter(repositoryId));
-   }
-
-   /**
-    * List all the conversions for the virtual machine template.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Conversion+Resource#ConversionResource-ListConversions"
-    *      > http://community.abiquo.com/display/ABI20/Conversion+Resource#
-    *      ConversionResource- ListConversions</a>
-    * @return all the conversions of the virtual machine template
-    */
-   public Iterable<Conversion> listConversions() {
-      ConversionsDto convs = context.getApi().getVirtualMachineTemplateApi().listConversions(target);
-      return wrap(context, Conversion.class, convs.getCollection());
-   }
-
-   /**
-    * List conversions for a virtual machine template.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Conversion+Resource#ConversionResource-ListConversions"
-    *      > http://community.abiquo.com/display/ABI20/Conversion+Resource#
-    *      ConversionResource- ListConversions</a>
-    * @param hypervisor
-    *           , Optionally filter conversions compatible with the provided
-    *           hypervisor
-    * @param state
-    *           , Optionally filter conversions with the desired state
-    * @return all the conversions of the virtual machine template applying the
-    *         constrains
-    */
-   public Iterable<Conversion> listConversions(final HypervisorType hypervisor, final ConversionState state) {
-      ConversionsDto convs = context
-            .getApi()
-            .getVirtualMachineTemplateApi()
-            .listConversions(target,
-                  ConversionOptions.builder().hypervisorType(hypervisor).conversionState(state).build());
-      return wrap(context, Conversion.class, convs.getCollection());
-   }
-
-   /**
-    * Starts a new conversion for a virtual machine template.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Conversion+Resource#ConversionResource-RequestConversion"
-    *      > http://community.abiquo.com/display/ABI20/Conversion+Resource#
-    *      ConversionResource- RequestConversion</a>
-    * @param diskFormat
-    *           , desired target format for the request template
-    * @return The task reference to track its progress
-    */
-   public ConversionTask requestConversion(final DiskFormatType diskFormat) {
-      ConversionDto request = new ConversionDto();
-      request.setTargetFormat(diskFormat);
-
-      AcceptedRequestDto<String> taskRef = context.getApi().getVirtualMachineTemplateApi()
-            .requestConversion(target, diskFormat, request);
-
-      return taskRef == null ? null : getTask(taskRef).asConversionTask();
-   }
-
-   // Delegate methods
-
-   public Integer getCpuRequired() {
-      return target.getCpuRequired();
-   }
-
-   public Date getCreationDate() {
-      return target.getCreationDate();
-   }
-
-   public String getCreationUser() {
-      return target.getCreationUser();
-   }
-
-   public String getDescription() {
-      return target.getDescription();
-   }
-
-   public Long getDiskFileSize() {
-      return target.getDiskFileSize();
-   }
-
-   public DiskFormatType getDiskFormatType() {
-      return DiskFormatType.valueOf(target.getDiskFormatType());
-   }
-
-   public Long getHdRequired() {
-      return target.getHdRequired();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public String getPath() {
-      return target.getPath();
-   }
-
-   public Integer getRamRequired() {
-      return target.getRamRequired();
-   }
-
-   public boolean isChefEnabled() {
-      return target.isChefEnabled();
-   }
-
-   public void setChefEnabled(final boolean chefEnabled) {
-      target.setChefEnabled(chefEnabled);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getIconUrl() {
-      return target.getIconUrl();
-   }
-
-   @Override
-   public String toString() {
-      return "VirtualMachineTemplate [id=" + getId() + ", cpuRequired=" + getCpuRequired() + ", creationDate="
-            + getCreationDate() + ", creationUser=" + getCreationUser() + ", description=" + getDescription()
-            + ", diskFileSize=" + getDiskFileSize() + ", diskFormatType=" + getDiskFormatType() + ", hdRequired="
-            + getHdRequired() + ", name=" + getName() + ", path=" + getPath() + ", ramRequired=" + getRamRequired()
-            + ", chefEnabled=" + isChefEnabled() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateInVirtualDatacenter.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateInVirtualDatacenter.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateInVirtualDatacenter.java
deleted file mode 100644
index 3540593..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/VirtualMachineTemplateInVirtualDatacenter.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-/**
- * Wrapper to hold the information of a virtual machine template scoped to a
- * concrete hypervisor type.
- */
-public class VirtualMachineTemplateInVirtualDatacenter {
-   private VirtualMachineTemplate template;
-
-   private VirtualDatacenter zone;
-
-   public VirtualMachineTemplateInVirtualDatacenter(final VirtualMachineTemplate template, final VirtualDatacenter zone) {
-      super();
-      this.template = checkNotNull(template, "template");
-      this.zone = checkNotNull(zone, "zone");
-   }
-
-   public VirtualMachineTemplate getTemplate() {
-      return template;
-   }
-
-   public VirtualDatacenter getZone() {
-      return zone;
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/Volume.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/Volume.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/Volume.java
deleted file mode 100644
index 9c33d1a..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/Volume.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud;
-
-import static com.abiquo.model.enumerator.VolumeState.ATTACHED;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.abiquo.domain.infrastructure.Tier;
-import org.jclouds.abiquo.domain.task.VirtualMachineTask;
-import org.jclouds.abiquo.reference.ValidationErrors;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.VolumeState;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.infrastructure.storage.TierDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-import com.google.inject.Key;
-import com.google.inject.TypeLiteral;
-
-/**
- * Adds high level functionality to {@link VolumeManagementDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/Volume+Resource">
- *      http://community.abiquo.com/display/ABI20/Volume+Resource</a>
- */
-public class Volume extends DomainWrapper<VolumeManagementDto> {
-   /** The default state for volumes. */
-   public static final VolumeState DEFAULT_STATE = VolumeState.DETACHED;
-
-   /** The virtual datacenter where the volume belongs. */
-   private VirtualDatacenter virtualDatacenter;
-
-   /** The tier where the volume belongs. */
-   private Tier tier;
-
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected Volume(final ApiContext<AbiquoApi> context, final VolumeManagementDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   public void delete() {
-      context.getApi().getCloudApi().deleteVolume(target);
-      target = null;
-   }
-
-   public void save() {
-      target = context.getApi().getCloudApi().createVolume(virtualDatacenter.unwrap(), target);
-   }
-
-   public VirtualMachineTask update() {
-      AcceptedRequestDto<String> taskRef = context.getApi().getCloudApi().updateVolume(target);
-      return taskRef == null ? null : getTask(taskRef).asVirtualMachineTask();
-   }
-
-   // Parent access
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Virtual+Datacenter+Resource#VirtualDatacenterResource-RetrieveaVirtualDatacenter"
-    *      > http://community.abiquo.com/display/ABI20/Virtual+Datacenter+
-    *      Resource# VirtualDatacenterResource-RetrieveaVirtualDatacenter</a>
-    */
-   public VirtualDatacenter getVirtualDatacenter() {
-      Integer virtualDatacenterId = target.getIdFromLink(ParentLinkName.VIRTUAL_DATACENTER);
-      VirtualDatacenterDto dto = context.getApi().getCloudApi().getVirtualDatacenter(virtualDatacenterId);
-      virtualDatacenter = wrap(context, VirtualDatacenter.class, dto);
-      return virtualDatacenter;
-   }
-
-   /**
-    * 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>>(){}));
-      return wrap(context, VirtualMachine.class, parser.apply(response));
-   }
-
-   public Tier getTier() {
-      Integer tierId = target.getIdFromLink(ParentLinkName.TIER);
-      TierDto dto = context.getApi().getCloudApi().getStorageTier(virtualDatacenter.unwrap(), tierId);
-      tier = wrap(context, Tier.class, dto);
-      return tier;
-   }
-
-   // Actions
-
-   /**
-    * Move the volume to the given virtual datacenter.
-    * 
-    * @param newVirtualDatacenter
-    *           The destination virtual datacenter.
-    */
-   public void moveTo(final VirtualDatacenter newVirtualDatacenter) {
-      target = context.getApi().getCloudApi().moveVolume(unwrap(), newVirtualDatacenter.unwrap());
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final VirtualDatacenter virtualDatacenter,
-         final Tier tier) {
-      return new Builder(context, virtualDatacenter, tier);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private String name;
-
-      private String description;
-
-      private Long sizeInMb;
-
-      private VirtualDatacenter virtualDatacenter;
-
-      private Tier tier;
-
-      public Builder(final ApiContext<AbiquoApi> context, final VirtualDatacenter virtualDatacenter, final Tier tier) {
-         super();
-         checkNotNull(virtualDatacenter, ValidationErrors.NULL_RESOURCE + VirtualDatacenter.class);
-         checkNotNull(tier, ValidationErrors.NULL_RESOURCE + Tier.class);
-         this.context = context;
-         this.virtualDatacenter = virtualDatacenter;
-         this.tier = tier;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder description(final String description) {
-         this.description = description;
-         return this;
-      }
-
-      public Builder sizeInMb(final long sizeInMb) {
-         this.sizeInMb = sizeInMb;
-         return this;
-      }
-
-      public Volume build() {
-         VolumeManagementDto dto = new VolumeManagementDto();
-         dto.setName(name);
-         dto.setDescription(description);
-         dto.setSizeInMB(sizeInMb);
-         dto.setState(DEFAULT_STATE.name());
-
-         RESTLink link = tier.unwrap().searchLink("self");
-         checkNotNull(link, ValidationErrors.MISSING_REQUIRED_LINK);
-         dto.addLink(new RESTLink("tier", link.getHref()));
-
-         Volume volume = new Volume(context, dto);
-         volume.virtualDatacenter = virtualDatacenter;
-         volume.tier = tier;
-
-         return volume;
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getState() {
-      return target.getState();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-
-   public long getSizeInMB() {
-      return target.getSizeInMB();
-   }
-
-   public void setSizeInMB(final long sizeInMB) {
-      target.setSizeInMB(sizeInMB);
-   }
-
-   public String getDescription() {
-      return target.getDescription();
-   }
-
-   public void setDescription(final String description) {
-      target.setDescription(description);
-   }
-
-   @Override
-   public String toString() {
-      return "Volume [id=" + getId() + ", state=" + getState() + ", name=" + getName() + ", sizeInMB=" + getSizeInMB()
-            + ", description=" + getDescription() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/ConversionOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/ConversionOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/ConversionOptions.java
deleted file mode 100644
index 1652fef..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/ConversionOptions.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-import com.abiquo.model.enumerator.ConversionState;
-import com.abiquo.model.enumerator.HypervisorType;
-
-/**
- * Available options to filter virtual machine template conversions
- */
-public class ConversionOptions extends BaseHttpRequestOptions {
-
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      ConversionOptions options = new ConversionOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-      private HypervisorType hypervisorType;
-
-      private ConversionState conversionState;
-
-      /** Only conversions compatible with this hypervisor */
-      public Builder hypervisorType(final HypervisorType hypervisorType) {
-         this.hypervisorType = hypervisorType;
-         return this;
-      }
-
-      /** Only conversions with the provided state */
-      public Builder conversionState(final ConversionState conversionState) {
-         this.conversionState = conversionState;
-         return this;
-      }
-
-      public ConversionOptions build() {
-         ConversionOptions options = new ConversionOptions();
-
-         if (hypervisorType != null) {
-            options.queryParameters.put("hypervisor", hypervisorType.name());
-         }
-         if (conversionState != null) {
-            options.queryParameters.put("state", conversionState.name());
-         }
-
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualApplianceOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualApplianceOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualApplianceOptions.java
deleted file mode 100644
index 2cf0a82..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualApplianceOptions.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query virtual appliances.
- */
-public class VirtualApplianceOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      VirtualApplianceOptions options = new VirtualApplianceOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-
-      private Boolean available;
-
-      public Builder available(final boolean available) {
-         this.available = available;
-         return this;
-      }
-
-      public VirtualApplianceOptions build() {
-         VirtualApplianceOptions options = new VirtualApplianceOptions();
-
-         if (available != null) {
-            options.queryParameters.put("available", String.valueOf(available));
-         }
-
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualDatacenterOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualDatacenterOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualDatacenterOptions.java
deleted file mode 100644
index 8d960d4..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualDatacenterOptions.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud.options;
-
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query virtual datacenters.
- */
-public class VirtualDatacenterOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      VirtualDatacenterOptions options = new VirtualDatacenterOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder {
-      private Integer datacenterId;
-
-      private Integer enterpriseId;
-
-      /**
-       * Set the optional datacenter.
-       */
-      public Builder datacenterId(final int datacenterId) {
-         this.datacenterId = datacenterId;
-         return this;
-      }
-
-      /**
-       * Set the optional enterprise.
-       */
-      public Builder enterpriseId(final int enterpriseId) {
-         this.enterpriseId = enterpriseId;
-         return this;
-      }
-
-      public VirtualDatacenterOptions build() {
-         VirtualDatacenterOptions options = new VirtualDatacenterOptions();
-
-         if (datacenterId != null) {
-            options.queryParameters.put("datacenter", datacenterId.toString());
-         }
-
-         if (enterpriseId != null) {
-            options.queryParameters.put("enterprise", enterpriseId.toString());
-         }
-         return options;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualMachineOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualMachineOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualMachineOptions.java
deleted file mode 100644
index 5e1d4b6..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualMachineOptions.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud.options;
-
-import org.jclouds.abiquo.domain.options.FilterOptions.BaseFilterOptionsBuilder;
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query virtual machine.
- */
-public class VirtualMachineOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      VirtualMachineOptions options = new VirtualMachineOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder extends BaseFilterOptionsBuilder<Builder> {
-      private Boolean force;
-
-      public Builder force(final Boolean force) {
-         this.force = force;
-         return this;
-      }
-
-      public VirtualMachineOptions build() {
-         VirtualMachineOptions options = new VirtualMachineOptions();
-
-         if (force != null) {
-            options.queryParameters.put("force", String.valueOf(force));
-         }
-
-         return addFilterOptions(options);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualMachineTemplateOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualMachineTemplateOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualMachineTemplateOptions.java
deleted file mode 100644
index 6743e2c..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VirtualMachineTemplateOptions.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud.options;
-
-import org.jclouds.abiquo.domain.config.Category;
-import org.jclouds.abiquo.domain.options.FilterOptions.BaseFilterOptionsBuilder;
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.enumerator.StatefulInclusion;
-
-/**
- * Available options to query virtual machine templates.
- */
-public class VirtualMachineTemplateOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      VirtualMachineTemplateOptions options = new VirtualMachineTemplateOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder extends BaseFilterOptionsBuilder<Builder> {
-      private StatefulInclusion persistent;
-
-      private HypervisorType hypervisorType;
-
-      private Category category;
-
-      private String categoryName;
-
-      private Integer idTemplate;
-
-      public Builder persistent(final StatefulInclusion persistent) {
-         this.persistent = persistent;
-         return this;
-      }
-
-      public Builder hypervisorType(final HypervisorType hypervisorType) {
-         this.hypervisorType = hypervisorType;
-         return this;
-      }
-
-      public Builder category(final Category category) {
-         this.category = category;
-         return this;
-      }
-
-      public Builder categoryName(final String categoryName) {
-         this.categoryName = categoryName;
-         return this;
-      }
-
-      public Builder idTemplate(final Integer idTemplate) {
-         this.idTemplate = idTemplate;
-         return this;
-      }
-
-      public VirtualMachineTemplateOptions build() {
-         VirtualMachineTemplateOptions options = new VirtualMachineTemplateOptions();
-
-         if (persistent != null) {
-            options.queryParameters.put("stateful", persistent.name());
-         }
-         if (hypervisorType != null) {
-            options.queryParameters.put("hypervisorTypeName", hypervisorType.name());
-         }
-         if (category != null) {
-            options.queryParameters.put("categoryName", category.getName());
-         }
-
-         if (category == null && categoryName != null) {
-            options.queryParameters.put("categoryName", categoryName);
-         }
-
-         if (idTemplate != null) {
-            options.queryParameters.put("idTemplate", String.valueOf(idTemplate));
-         }
-
-         return addFilterOptions(options);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VolumeOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VolumeOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VolumeOptions.java
deleted file mode 100644
index 9740969..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/cloud/options/VolumeOptions.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.cloud.options;
-
-import org.jclouds.abiquo.domain.options.FilterOptions.BaseFilterOptionsBuilder;
-import org.jclouds.http.options.BaseHttpRequestOptions;
-
-/**
- * Available options to query volumes.
- */
-public class VolumeOptions extends BaseHttpRequestOptions {
-   public static Builder builder() {
-      return new Builder();
-   }
-
-   @Override
-   protected Object clone() throws CloneNotSupportedException {
-      VolumeOptions options = new VolumeOptions();
-      options.queryParameters.putAll(queryParameters);
-      return options;
-   }
-
-   public static class Builder extends BaseFilterOptionsBuilder<Builder> {
-      private Boolean onlyAvailable;
-
-      public Builder onlyAvailable(final boolean onlyAvailable) {
-         this.onlyAvailable = onlyAvailable;
-         return this;
-      }
-
-      public VolumeOptions build() {
-         VolumeOptions options = new VolumeOptions();
-
-         if (onlyAvailable != null) {
-            options.queryParameters.put("available", String.valueOf(onlyAvailable));
-         }
-
-         return addFilterOptions(options);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/config/Category.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/Category.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/config/Category.java
deleted file mode 100644
index 2fbf7e3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/Category.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.config;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.appslibrary.CategoryDto;
-
-/**
- * Adds high level functionality to {@link CategoryDto}.
- * 
- * @see API: <a
- *      href="http://community.abiquo.com/display/ABI20/Category+Resource">
- *      http://community.abiquo.com/display/ABI20/Category+Resource</a>
- */
-
-public class Category extends DomainWrapper<CategoryDto> {
-   /** The default value for the default category flag. */
-   private static final boolean DEFAULT_DEFAULT_CATEGORY = false;
-
-   /** The default value for the erasable flag. */
-   private static final boolean DEFAULT_ERASABLE = true;
-
-   /**
-    * Constructor to be used only by the builder. This resource cannot be
-    * created.
-    */
-   private Category(final ApiContext<AbiquoApi> context, final CategoryDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Category+Resource#CategoryResource-Deleteacategory"
-    *      > http://community.abiquo.com/display/ABI20/Category+Resource#
-    *      CategoryResource-Deleteacategory</a>
-    */
-   public void delete() {
-      context.getApi().getConfigApi().deleteCategory(target);
-      target = null;
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Category+Resource#CategoryResource-Createacategory"
-    *      > http://community.abiquo.com/display/ABI20/Category+Resource#
-    *      CategoryResource-Createacategory</a>
-    */
-   public void save() {
-      target = context.getApi().getConfigApi().createCategory(target);
-   }
-
-   /**
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/Category+Resource#CategoryResource-Updateanexistingcategory"
-    *      > http://community.abiquo.com/display/ABI20/Category+Resource#
-    *      CategoryResource-Updateanexistingcategory</a>
-    */
-   public void update() {
-      target = context.getApi().getConfigApi().updateCategory(target);
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context) {
-      return new Builder(context);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private String name;
-
-      private Boolean erasable = DEFAULT_ERASABLE;
-
-      private Boolean defaultCategory = DEFAULT_DEFAULT_CATEGORY;
-
-      public Builder(final ApiContext<AbiquoApi> context) {
-         super();
-         this.context = context;
-      }
-
-      public Builder name(final String name) {
-         this.name = name;
-         return this;
-      }
-
-      public Builder defaultCategory(final boolean defaultCategory) {
-         this.defaultCategory = defaultCategory;
-         return this;
-      }
-
-      public Builder erasable(final boolean erasable) {
-         this.erasable = erasable;
-         return this;
-      }
-
-      public Category build() {
-         CategoryDto dto = new CategoryDto();
-         dto.setErasable(erasable);
-         dto.setDefaultCategory(defaultCategory);
-         dto.setName(name);
-         Category category = new Category(context, dto);
-
-         return category;
-      }
-
-      public static Builder fromCategory(final Category in) {
-         Builder builder = Category.builder(in.context).name(in.getName()).erasable(in.isErasable())
-               .defaultCategory(in.isDefaultCategory());
-
-         return builder;
-      }
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   public boolean isDefaultCategory() {
-      return target.isDefaultCategory();
-   }
-
-   public boolean isErasable() {
-      return target.isErasable();
-   }
-
-   public void setDefaultCategory(final boolean defaultCategory) {
-      target.setDefaultCategory(defaultCategory);
-   }
-
-   public void setErasable(final boolean erasable) {
-      target.setErasable(erasable);
-   }
-
-   public void setName(final String name) {
-      target.setName(name);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/config/License.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/License.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/config/License.java
deleted file mode 100644
index e926a78..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/License.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.config;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.config.LicenseDto;
-
-/**
- * Adds high level functionality to {@link LicenseDto}.
- */
-public class License extends DomainWrapper<LicenseDto> {
-   /**
-    * Constructor to be used only by the builder.
-    */
-   protected License(final ApiContext<AbiquoApi> context, final LicenseDto target) {
-      super(context, target);
-   }
-
-   // Domain operations
-
-   public void remove() {
-      context.getApi().getConfigApi().removeLicense(target);
-      target = null;
-   }
-
-   public void add() {
-      target = context.getApi().getConfigApi().addLicense(target);
-   }
-
-   // Builder
-
-   public static Builder builder(final ApiContext<AbiquoApi> context, final String code) {
-      return new Builder(context, code);
-   }
-
-   public static class Builder {
-      private ApiContext<AbiquoApi> context;
-
-      private String code;
-
-      public Builder(final ApiContext<AbiquoApi> context, final String code) {
-         super();
-         this.context = context;
-         this.code = code;
-      }
-
-      public Builder code(final String code) {
-         this.code = code;
-         return this;
-      }
-
-      public License build() {
-         LicenseDto dto = new LicenseDto();
-         dto.setCode(code);
-
-         License license = new License(context, dto);
-         return license;
-      }
-
-      public static Builder fromLicense(final License in) {
-         return License.builder(in.context, in.getCode());
-      }
-   }
-
-   // Delegate methods
-
-   public String getCode() {
-      return target.getCode();
-   }
-
-   public String getExpiration() {
-      return target.getExpiration();
-   }
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public Integer getNumCores() {
-      return target.getNumcores();
-   }
-
-   @Override
-   public String toString() {
-      return "License [id=" + getId() + ", code=" + getCode() + ", expiration=" + getExpiration()
-          + ", numCores=" + getNumCores() + "]";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/config/Privilege.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/Privilege.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/config/Privilege.java
deleted file mode 100644
index 852dbe3..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/config/Privilege.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain.config;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.DomainWrapper;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.enterprise.PrivilegeDto;
-
-/**
- * Adds high level functionality to {@link PrivilegeDto}.
- */
-public class Privilege extends DomainWrapper<PrivilegeDto> {
-   /**
-    * Constructor to be used only by the builder. This resource cannot be
-    * created.
-    */
-   private Privilege(final ApiContext<AbiquoApi> context, final PrivilegeDto target) {
-      super(context, target);
-   }
-
-   // Delegate methods
-
-   public Integer getId() {
-      return target.getId();
-   }
-
-   public String getName() {
-      return target.getName();
-   }
-
-   @Override
-   public String toString() {
-      return "Privilege [id=" + getId() + ", name=" + getName() + "]";
-   }
-
-}


[10/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/CloudResources.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/CloudResources.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/CloudResources.java
deleted file mode 100644
index bd69351..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/CloudResources.java
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import static org.jclouds.abiquo.domain.DomainUtils.link;
-
-import com.abiquo.model.enumerator.DiskFormatType;
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.enumerator.VolumeState;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.cloud.VirtualApplianceDto;
-import com.abiquo.server.core.cloud.VirtualDatacenterDto;
-import com.abiquo.server.core.cloud.VirtualMachineDto;
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.abiquo.server.core.cloud.VirtualMachineStateDto;
-import com.abiquo.server.core.cloud.VirtualMachineTaskDto;
-import com.abiquo.server.core.infrastructure.storage.DiskManagementDto;
-import com.abiquo.server.core.infrastructure.storage.TierDto;
-import com.abiquo.server.core.infrastructure.storage.VolumeManagementDto;
-
-/**
- * Cloud domain utilities.
- */
-public class CloudResources {
-   public static VirtualDatacenterDto virtualDatacenterPost() {
-      VirtualDatacenterDto virtualDatacenter = new VirtualDatacenterDto();
-      virtualDatacenter.setName("VDC");
-      virtualDatacenter.setHypervisorType(HypervisorType.KVM);
-      virtualDatacenter.setVlan(NetworkResources.vlanPost());
-      return virtualDatacenter;
-   }
-
-   public static VirtualApplianceDto virtualAppliancePost() {
-      VirtualApplianceDto virtualAppliance = new VirtualApplianceDto();
-      virtualAppliance.setName("VA");
-      return virtualAppliance;
-   }
-
-   public static VirtualMachineDto virtualMachinePost() {
-      VirtualMachineDto virtualMachine = new VirtualMachineDto();
-      virtualMachine.setName("VM");
-      virtualMachine.setCpu(1);
-      virtualMachine.setRam(1);
-      virtualMachine.setHdInBytes(20l);
-      return virtualMachine;
-   }
-
-   public static VirtualDatacenterDto virtualDatacenterPut() {
-      VirtualDatacenterDto virtualDatacenter = virtualDatacenterPost();
-      virtualDatacenter.setId(1);
-      virtualDatacenter.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
-      virtualDatacenter.addLink(new RESTLink("disks", "http://localhost/api/cloud/virtualdatacenters/1/disks"));
-      virtualDatacenter.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
-      virtualDatacenter.addLink(new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1"));
-      virtualDatacenter.addLink(new RESTLink("tiers", "http://localhost/api/cloud/virtualdatacenters/1/tiers"));
-      virtualDatacenter.addLink(new RESTLink("virtualappliances",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances"));
-      virtualDatacenter.addLink(new RESTLink("volumes", "http://localhost/api/cloud/virtualdatacenters/1/volumes"));
-      virtualDatacenter.addLink(new RESTLink("privatenetworks",
-            "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks"));
-      virtualDatacenter.addLink(new RESTLink("defaultnetwork",
-            "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1"));
-      virtualDatacenter.addLink(new RESTLink("defaultvlan",
-            "http://localhost/api/cloud/virtualdatacenters/1/action/defaultvlan"));
-      virtualDatacenter.addLink(new RESTLink("topurchase",
-            "http://localhost/api/cloud/virtualdatacenters/1/publicips/topurchase"));
-      virtualDatacenter.addLink(new RESTLink("purchased",
-            "http://localhost/api/cloud/virtualdatacenters/1/publicips/purchased"));
-      virtualDatacenter.addLink(new RESTLink("templates",
-            "http://localhost/api/cloud/virtualdatacenters/1/action/templates"));
-      return virtualDatacenter;
-
-   }
-
-   public static VirtualApplianceDto virtualAppliancePut() {
-      VirtualApplianceDto virtualAppliance = virtualAppliancePost();
-      virtualAppliance.setId(1);
-      virtualAppliance.addLink(new RESTLink("virtualdatacenter", "http://localhost/api/cloud/virtualdatacenters/1"));
-      virtualAppliance.addLink(new RESTLink("deploy",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/action/deploy"));
-      virtualAppliance.addLink(new RESTLink("edit",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1"));
-      virtualAppliance.addLink(new RESTLink("state",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/state"));
-      virtualAppliance.addLink(new RESTLink("undeploy",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/action/undeploy"));
-      virtualAppliance.addLink(new RESTLink("virtualmachines",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines"));
-      virtualAppliance.addLink(new RESTLink("price",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/action/price"));
-      return virtualAppliance;
-   }
-
-   public static VirtualMachineDto virtualMachinePut() {
-      VirtualMachineDto virtualMachine = virtualMachinePost();
-      virtualMachine.setId(1);
-      virtualMachine.addLink(new RESTLink("deploy",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/deploy"));
-      virtualMachine.addLink(new RESTLink("disks",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/disks"));
-      virtualMachine.addLink(new RESTLink("edit",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1"));
-      virtualMachine.addLink(new RESTLink("state",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/state"));
-      virtualMachine.addLink(new RESTLink("reset",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/reset"));
-      virtualMachine.addLink(new RESTLink("tasks",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/tasks"));
-      virtualMachine.addLink(new RESTLink("undeploy",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/undeploy"));
-      virtualMachine.addLink(new RESTLink("persistent",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/persistent"));
-      virtualMachine.addLink(new RESTLink("virtualappliance",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1"));
-      virtualMachine.addLink(new RESTLink("virtualmachinetemplate",
-            "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1"));
-      virtualMachine.addLink(new RESTLink("nics",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/nics"));
-      virtualMachine.addLink(new RESTLink("volumes",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/volumes"));
-      virtualMachine
-            .addLink(new RESTLink("configurations",
-                  "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/configurations"));
-      virtualMachine.setCpu(1);
-      virtualMachine.setRam(1);
-      virtualMachine.setHdInBytes(20l);
-      return virtualMachine;
-   }
-
-   public static VirtualMachineStateDto virtualMachineState() {
-      VirtualMachineStateDto state = new VirtualMachineStateDto();
-      state.setState(VirtualMachineState.ON);
-      return state;
-   }
-
-   public static String virtualMachineStatePayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualmachinestate>");
-      buffer.append("<state>ON</state>");
-      buffer.append("</virtualmachinestate>");
-      return buffer.toString();
-   }
-
-   public static VolumeManagementDto volumePost() {
-      VolumeManagementDto volume = new VolumeManagementDto();
-      volume.setName("Volume");
-      volume.setSizeInMB(1024);
-      volume.addLink(new RESTLink("tier", "http://localhost/api/cloud/virtualdatacenters/1/tiers/1"));
-      return volume;
-   }
-
-   public static VolumeManagementDto volumePut() {
-      VolumeManagementDto volume = volumePost();
-      volume.setId(1);
-      volume.setState(VolumeState.DETACHED.name());
-
-      volume.getLinks().clear();
-
-      RESTLink mappings = new RESTLink("action",
-            "http://localhost/api/cloud/virtualdatacenters/1/volumes/1/action/initiatormappings");
-      mappings.setTitle("initiator mappings");
-      volume.addLink(mappings);
-      volume.addLink(new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1/volumes/1"));
-      volume.addLink(new RESTLink("tier", "http://localhost/api/cloud/virtualdatacenters/1/tiers/1"));
-      volume.addLink(new RESTLink("virtualdatacenter", "http://localhost/api/cloud/virtualdatacenters/1"));
-      return volume;
-   }
-
-   public static VirtualMachineTemplateDto virtualMachineTemplatePut() {
-      VirtualMachineTemplateDto template = new VirtualMachineTemplateDto();
-      template.setId(10);
-      template.setName("m0n0wall");
-      template.setDiskFormatType(DiskFormatType.VMDK_FLAT.toString());
-      template.setPath("1/abiquo-repository.abiquo.com/m0n0wall/m0n0wall-1.3b18-i386-flat.vmdk");
-      template.setDiskFileSize(27262976l);
-      template.setCpuRequired(1);
-      template.setRamRequired(128);
-      template.setCpuRequired(27262976);
-      template.setCreationUser("SYSTEM");
-      template.setIconUrl("http://ww1.prweb.com/prfiles/2010/08/02/2823234/gI_0_HakunaLogoMedium.jpg");
-      template.addLink(new RESTLink("icon", "http://localhost/api/config/icons/1"));
-      template.addLink(new RESTLink("category", "http://localhost/api/config/categories/1"));
-
-      return template;
-
-   }
-
-   public static TierDto cloudTierPut() {
-      TierDto tier = new TierDto();
-      tier.setId(1);
-      tier.setEnabled(true);
-      tier.setName("Tier");
-      tier.addLink(new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1/tiers/1"));
-      return tier;
-   }
-
-   public static VirtualMachineTaskDto deployOptions() {
-      VirtualMachineTaskDto deploy = new VirtualMachineTaskDto();
-      deploy.setForceEnterpriseSoftLimits(false);
-      return deploy;
-
-   }
-
-   public static VirtualMachineTaskDto undeployOptions() {
-      VirtualMachineTaskDto deploy = new VirtualMachineTaskDto();
-      deploy.setForceUndeploy(true);
-      return deploy;
-   }
-
-   public static String virtualDatacenterPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualDatacenter>");
-      buffer.append("<cpuHard>0</cpuHard>");
-      buffer.append("<cpuSoft>0</cpuSoft>");
-      buffer.append("<hdHard>0</hdHard>");
-      buffer.append("<hdSoft>0</hdSoft>");
-      buffer.append("<publicIpsHard>0</publicIpsHard>");
-      buffer.append("<publicIpsSoft>0</publicIpsSoft>");
-      buffer.append("<ramHard>0</ramHard>");
-      buffer.append("<ramSoft>0</ramSoft>");
-      buffer.append("<storageHard>0</storageHard>");
-      buffer.append("<storageSoft>0</storageSoft>");
-      buffer.append("<vlansHard>0</vlansHard>");
-      buffer.append("<vlansSoft>0</vlansSoft>");
-      buffer.append("<hypervisorType>KVM</hypervisorType>");
-      buffer.append("<name>VDC</name>");
-      buffer.append(NetworkResources.vlanNetworkPostPayload());
-      buffer.append("</virtualDatacenter>");
-      return buffer.toString();
-   }
-
-   public static String virtualAppliancePostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualAppliance>");
-      buffer.append("<error>0</error>");
-      buffer.append("<highDisponibility>0</highDisponibility>");
-      buffer.append("<name>VA</name>");
-      buffer.append("<publicApp>0</publicApp>");
-      buffer.append("</virtualAppliance>");
-      return buffer.toString();
-   }
-
-   public static String virtualMachinePostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualMachine>");
-      buffer.append("<cpu>1</cpu>");
-      buffer.append("<hdInBytes>20</hdInBytes>");
-      buffer.append("<highDisponibility>0</highDisponibility>");
-      buffer.append("<idState>0</idState>");
-      buffer.append("<idType>0</idType>");
-      buffer.append("<name>VM</name>");
-      buffer.append("<ram>1</ram>");
-      buffer.append("<vdrpPort>0</vdrpPort>");
-      buffer.append("</virtualMachine>");
-      return buffer.toString();
-   }
-
-   public static String virtualDatacenterPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualDatacenter>");
-      buffer.append(link("/admin/datacenters/1", "datacenter"));
-      buffer.append(link("/cloud/virtualdatacenters/1/disks", "disks"));
-      buffer.append(link("/admin/enterprises/1", "enterprise"));
-      buffer.append(link("/cloud/virtualdatacenters/1", "edit"));
-      buffer.append(link("/cloud/virtualdatacenters/1/tiers", "tiers"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances", "virtualappliances"));
-      buffer.append(link("/cloud/virtualdatacenters/1/volumes", "volumes"));
-      buffer.append(link("/cloud/virtualdatacenters/1/privatenetworks", "privatenetworks"));
-      buffer.append(link("/cloud/virtualdatacenters/1/privatenetworks/1", "defaultnetwork"));
-      buffer.append(link("/cloud/virtualdatacenters/1/action/defaultvlan", "defaultvlan"));
-      buffer.append(link("/cloud/virtualdatacenters/1/publicips/topurchase", "topurchase"));
-      buffer.append(link("/cloud/virtualdatacenters/1/publicips/purchased", "purchased"));
-      buffer.append(link("/cloud/virtualdatacenters/1/action/templates", "templates"));
-      buffer.append("<cpuHard>0</cpuHard>");
-      buffer.append("<cpuSoft>0</cpuSoft>");
-      buffer.append("<hdHard>0</hdHard>");
-      buffer.append("<hdSoft>0</hdSoft>");
-      buffer.append("<publicIpsHard>0</publicIpsHard>");
-      buffer.append("<publicIpsSoft>0</publicIpsSoft>");
-      buffer.append("<ramHard>0</ramHard>");
-      buffer.append("<ramSoft>0</ramSoft>");
-      buffer.append("<storageHard>0</storageHard>");
-      buffer.append("<storageSoft>0</storageSoft>");
-      buffer.append("<vlansHard>0</vlansHard>");
-      buffer.append("<vlansSoft>0</vlansSoft>");
-      buffer.append("<hypervisorType>KVM</hypervisorType>");
-      buffer.append("<id>1</id>");
-      buffer.append("<name>VDC</name>");
-      buffer.append(NetworkResources.vlanNetworkPostPayload());
-      buffer.append("</virtualDatacenter>");
-      return buffer.toString();
-   }
-
-   public static String virtualDatacenterRefPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<links>");
-      buffer.append(link("/cloud/virtualdatacenters/1", "virtualdatacenter"));
-      buffer.append("</links>");
-      return buffer.toString();
-   }
-
-   public static String virtualAppliancePutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualAppliance>");
-      buffer.append(link("/cloud/virtualdatacenters/1", "virtualdatacenter"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/action/deploy", "deploy"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1", "edit"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/state", "state"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/action/undeploy", "undeploy"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines", "virtualmachines"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/action/price", "price"));
-      buffer.append("<error>0</error>");
-      buffer.append("<highDisponibility>0</highDisponibility>");
-      buffer.append("<id>1</id>");
-      buffer.append("<name>VA</name>");
-      buffer.append("<publicApp>0</publicApp>");
-      buffer.append("</virtualAppliance>");
-      return buffer.toString();
-   }
-
-   public static String virtualMachinePutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualMachine>");
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/deploy", "deploy"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/disks", "disks"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1", "edit"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/state", "state"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/reset", "reset"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/tasks", "tasks"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/undeploy",
-            "undeploy"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/action/persistent",
-            "persistent"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1", "virtualappliance"));
-      buffer.append(link("/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1",
-            "virtualmachinetemplate"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/nics", "nics"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/storage/volumes", "volumes"));
-      buffer.append(link("/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/configurations",
-            "configurations"));
-
-      buffer.append("<cpu>1</cpu>");
-      buffer.append("<hdInBytes>20</hdInBytes>");
-      buffer.append("<highDisponibility>0</highDisponibility>");
-      buffer.append("<id>1</id>");
-      buffer.append("<idState>0</idState>");
-      buffer.append("<idType>0</idType>");
-      buffer.append("<name>VM</name>");
-      buffer.append("<ram>1</ram>");
-      buffer.append("<vdrpPort>0</vdrpPort>");
-      buffer.append("</virtualMachine>");
-      return buffer.toString();
-   }
-
-   public static String volumePostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<volume>");
-      buffer.append(link("/cloud/virtualdatacenters/1/tiers/1", "tier"));
-      buffer.append("<name>Volume</name>");
-      buffer.append("<sizeInMB>1024</sizeInMB>");
-      buffer.append("</volume>");
-      return buffer.toString();
-   }
-
-   public static String volumePutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<volume>");
-      buffer.append(link("/cloud/virtualdatacenters/1/volumes/1/action/initiatormappings", "action",
-            "initiator mappings"));
-      buffer.append(link("/cloud/virtualdatacenters/1/volumes/1", "edit"));
-      buffer.append(link("/cloud/virtualdatacenters/1/tiers/1", "tier"));
-      buffer.append(link("/cloud/virtualdatacenters/1", "virtualdatacenter"));
-      buffer.append("<id>1</id>");
-      buffer.append("<name>Volume</name>");
-      buffer.append("<state>DETACHED</state>");
-      buffer.append("<sizeInMB>1024</sizeInMB>");
-      buffer.append("</volume>");
-      return buffer.toString();
-   }
-
-   public static String cloudTierPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<tier>");
-      buffer.append(link("/cloud/virtualdatacenters/1/tiers/1", "edit"));
-      buffer.append("<enabled>true</enabled>");
-      buffer.append("<id>1</id>");
-      buffer.append("<name>Tier</name>");
-      buffer.append("</tier>");
-      return buffer.toString();
-   }
-
-   public static String deployPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualmachinetask>");
-      buffer.append("<forceEnterpriseSoftLimits>false</forceEnterpriseSoftLimits>");
-      buffer.append("</virtualmachinetask>");
-      return buffer.toString();
-   }
-
-   public static String undeployPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualmachinetask>");
-      buffer.append("<forceEnterpriseSoftLimits>false</forceEnterpriseSoftLimits>");
-      buffer.append("<forceUndeploy>true</forceUndeploy>");
-      buffer.append("</virtualmachinetask>");
-      return buffer.toString();
-   }
-
-   public static DiskManagementDto hardDiskPost() {
-      DiskManagementDto disk = new DiskManagementDto();
-      disk.setSizeInMb(1024L);
-      return disk;
-   }
-
-   public static DiskManagementDto hardDiskPut() {
-      DiskManagementDto disk = hardDiskPost();
-      disk.addLink(new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1/disks/1"));
-      disk.addLink(new RESTLink("virtualdatacenter", "http://localhost/api/cloud/virtualdatacenters/1"));
-      return disk;
-   }
-
-   public static String hardDiskPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<disk>");
-      buffer.append("<sizeInMb>1024</sizeInMb>");
-      buffer.append("</disk>");
-      return buffer.toString();
-   }
-
-   public static String hardDiskPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<disk>");
-      buffer.append(link("/cloud/virtualdatacenters/1", "virtualdatacenter"));
-      buffer.append(link("/cloud/virtualdatacenters/1/disks/1", "edit"));
-      buffer.append("<sequence>0</sequence>");
-      buffer.append("<sizeInMb>1024</sizeInMb>");
-      buffer.append("</disk>");
-      return buffer.toString();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/ConfigResources.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/ConfigResources.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/ConfigResources.java
deleted file mode 100644
index 5182db6..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/ConfigResources.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import static org.jclouds.abiquo.domain.DomainUtils.link;
-
-import java.io.IOException;
-import java.net.URL;
-import java.nio.charset.Charset;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.appslibrary.CategoryDto;
-import com.abiquo.server.core.config.LicenseDto;
-import com.abiquo.server.core.config.SystemPropertyDto;
-import com.google.common.io.Resources;
-
-/**
- * Enterprise domain utilities.
- */
-public class ConfigResources {
-   public static LicenseDto licensePost() {
-      LicenseDto license = new LicenseDto();
-      license.setCode(readLicense("license/expired"));
-      return license;
-   }
-
-   public static CategoryDto categoryPost() {
-      CategoryDto category = new CategoryDto();
-      category.setName("category");
-      category.setErasable(false);
-      category.setDefaultCategory(false);
-      return category;
-   }
-
-   public static CategoryDto categoryPut() {
-      CategoryDto category = categoryPost();
-      category.setId(1);
-      category.addLink(new RESTLink("edit", "http://localhost/api/config/categories/1"));
-      return category;
-   }
-
-   public static LicenseDto licensePut() {
-      LicenseDto license = licensePost();
-      license.setId(1);
-      license.addLink(new RESTLink("edit", "http://localhost/api/config/licenses/1"));
-
-      return license;
-   }
-
-   public static SystemPropertyDto propertyPut() {
-      SystemPropertyDto property = new SystemPropertyDto();
-      property.setId(1);
-      property.setDescription("Time interval in seconds");
-      property.setValue("10");
-      property.setName("api.applibrary.ovfpackagesDownloadingProgressUpdateInterval");
-      property.addLink(new RESTLink("edit", "http://localhost/api/config/properties/1"));
-
-      return property;
-   }
-
-   public static String licensePutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<license>");
-      buffer.append(link("/admin/enterprises/config/licenses/1", "edit"));
-      buffer.append("<code>" + readLicense("license/expired") + "</code>");
-      buffer.append("<id>1</id>");
-      buffer.append("</license>");
-      return buffer.toString();
-   }
-
-   public static String licensePostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<license>");
-      buffer.append("<code>" + readLicense("license/expired") + "</code>");
-      buffer.append("</license>");
-      return buffer.toString();
-   }
-
-   public static String categoryPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<category>");
-      buffer.append("<defaultCategory>false</defaultCategory>");
-      buffer.append("<erasable>false</erasable>");
-      buffer.append("<name>category</name>");
-      buffer.append("</category>");
-      return buffer.toString();
-   }
-
-   public static String categoryPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<category>");
-      buffer.append(link("/config/categories/1", "edit"));
-      buffer.append("<defaultCategory>false</defaultCategory>");
-      buffer.append("<erasable>false</erasable>");
-      buffer.append("<id>1</id>");
-      buffer.append("<name>category</name>");
-      buffer.append("</category>");
-      return buffer.toString();
-   }
-
-   public static String iconPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<icon>");
-      buffer.append(link("/config/icons/1", "edit"));
-      buffer.append("<id>1</id>");
-      buffer.append("<name>icon</name>");
-      buffer.append("<path>http://www.pixeljoint.com/files/icons/mipreview1.gif</path>");
-      buffer.append("</icon>");
-      return buffer.toString();
-   }
-
-   public static String iconPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<icon>");
-      buffer.append("<name>icon</name>");
-      buffer.append("<path>http://www.pixeljoint.com/files/icons/mipreview1.gif</path>");
-      buffer.append("</icon>");
-      return buffer.toString();
-   }
-
-   public static String propertyPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<property>");
-      buffer.append(link("/config/properties/1", "edit"));
-      buffer.append("<description>Time interval in seconds</description>");
-      buffer.append("<id>1</id>");
-      buffer.append("<name>api.applibrary.ovfpackagesDownloadingProgressUpdateInterval</name>");
-      buffer.append("<value>10</value>");
-      buffer.append("</property>");
-      return buffer.toString();
-   }
-
-   private static String readLicense(final String filename) {
-      URL url = ConfigResources.class.getResource("/" + filename);
-      try {
-         return Resources.toString(url, Charset.defaultCharset());
-      } catch (IOException e) {
-         throw new RuntimeException("Could not read file " + filename);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/DomainUtils.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/DomainUtils.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/DomainUtils.java
deleted file mode 100644
index 79da2d1..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/DomainUtils.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.rest.RESTLink;
-
-/**
- * Utility class to build domain objects used in tests.
- */
-public class DomainUtils {
-   /**
-    * Adds the XML header to the given XML.
-    */
-   public static String withHeader(final String xml) {
-      return XMLParser.DEFAULT_XML_HEADER + xml;
-   }
-
-   /**
-    * Builds a link in xml format
-    */
-   public static String link(final String href, final String rel) {
-      return "<link href=\"http://localhost/api" + href + "\" rel=\"" + rel + "\"/>";
-   }
-
-   /**
-    * Builds a link in xml format
-    */
-   public static String link(final String href, final String rel, final String title) {
-      return "<link href=\"http://localhost/api" + href + "\" rel=\"" + rel + "\" title=\"" + title + "\"/>";
-   }
-
-   /**
-    * Builds a link in xml format
-    */
-   public static String link(final RESTLink link) {
-      return "<link href=\"" + link.getHref() + "\" rel=\"" + link.getRel() + "\""
-            + (link.getTitle() == null ? "" : " title=\"" + link.getTitle() + "\"") + "/>";
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/EnterpriseResources.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/EnterpriseResources.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/EnterpriseResources.java
deleted file mode 100644
index 40fe679..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/EnterpriseResources.java
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import static org.jclouds.abiquo.domain.DomainUtils.link;
-
-import java.util.Map;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.appslibrary.TemplateDefinitionListDto;
-import com.abiquo.server.core.enterprise.DatacenterLimitsDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.enterprise.EnterprisePropertiesDto;
-import com.abiquo.server.core.enterprise.UserDto;
-import com.google.common.collect.Maps;
-
-/**
- * Enterprise domain utilities.
- */
-public class EnterpriseResources {
-   public static EnterpriseDto enterprisePost() {
-      EnterpriseDto enterprise = new EnterpriseDto();
-      enterprise.setName("Kalakaua");
-      return enterprise;
-   }
-
-   public static EnterpriseDto enterprisePut() {
-      EnterpriseDto enterprise = enterprisePost();
-      enterprise.setId(1);
-      enterprise.addLink(new RESTLink("edit", "http://localhost/api/admin/enterprises/1"));
-      enterprise.addLink(new RESTLink("limits", "http://localhost/api/admin/enterprises/1/limits"));
-      enterprise.addLink(new RESTLink("users", "http://localhost/api/admin/enterprises/1/users"));
-      enterprise.addLink(new RESTLink("properties", "http://localhost/api/admin/enterprises/1/properties"));
-      enterprise.addLink(new RESTLink("reservedmachines", "http://localhost/api/admin/enterprises/1/reservedmachines"));
-      enterprise.addLink(new RESTLink("datacenterrepositories",
-            "http://localhost/api/admin/enterprises/1/datacenterrepositories"));
-      enterprise.addLink(new RESTLink("externalnetworks",
-            "http://localhost/api/admin/enterprises/1/action/externalnetworks"));
-      enterprise.addLink(new RESTLink("virtualmachines",
-            "http://localhost/api/admin/enterprises/1/action/virtualmachines"));
-      enterprise.addLink(new RESTLink("cloud/virtualdatacenters",
-            "http://localhost/api/admin/enterprises/1/action/virtualdatacenters"));
-      enterprise.addLink(new RESTLink("virtualappliances",
-            "http://localhost/api/admin/enterprises/1/action/virtualappliances"));
-      enterprise.addLink(new RESTLink("appslib/templateDefinitionLists",
-            "http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists"));
-
-      return enterprise;
-   }
-
-   public static EnterprisePropertiesDto enterprisePropertiesPut() {
-      EnterprisePropertiesDto enterpriseProp = new EnterprisePropertiesDto();
-      enterpriseProp.setId(1);
-      Map<String, String> props = Maps.newHashMap();
-      props.put("key", "value");
-      enterpriseProp.setProperties(props);
-      enterpriseProp.addLink(new RESTLink("edit", "http://localhost/api/admin/enterprises/1/properties"));
-      enterpriseProp.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
-
-      return enterpriseProp;
-   }
-
-   public static String enterprisePostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<enterprise>");
-      buffer.append("<cpuHard>0</cpuHard>");
-      buffer.append("<cpuSoft>0</cpuSoft>");
-      buffer.append("<hdHard>0</hdHard>");
-      buffer.append("<hdSoft>0</hdSoft>");
-      buffer.append("<publicIpsHard>0</publicIpsHard>");
-      buffer.append("<publicIpsSoft>0</publicIpsSoft>");
-      buffer.append("<ramHard>0</ramHard>");
-      buffer.append("<ramSoft>0</ramSoft>");
-      buffer.append("<storageHard>0</storageHard>");
-      buffer.append("<storageSoft>0</storageSoft>");
-      buffer.append("<vlansHard>0</vlansHard>");
-      buffer.append("<vlansSoft>0</vlansSoft>");
-      buffer.append("<isReservationRestricted>false</isReservationRestricted>");
-      buffer.append("<name>Kalakaua</name>");
-      buffer.append("<repositoryHard>0</repositoryHard>");
-      buffer.append("<repositorySoft>0</repositorySoft>");
-      buffer.append("</enterprise>");
-      return buffer.toString();
-   }
-
-   public static String enterprisePutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<enterprise>");
-      buffer.append(link("/admin/enterprises/1", "edit"));
-      buffer.append(link("/admin/enterprises/1/limits", "limits"));
-      buffer.append(link("/admin/enterprises/1/users", "users"));
-      buffer.append(link("/admin/enterprises/1/properties", "properties"));
-      buffer.append(link("/admin/enterprises/1/reservedmachines", "reservedmachines"));
-      buffer.append(link("/admin/enterprises/1/datacenterrepositories", "datacenterrepositories"));
-      buffer.append(link("/admin/enterprises/1/action/externalnetworks", "externalnetworks"));
-      buffer.append(link("/admin/enterprises/1/action/virtualmachines", "virtualmachines"));
-      buffer.append(link("/admin/enterprises/1/action/virtualdatacenters", "cloud/virtualdatacenters"));
-      buffer.append(link("/admin/enterprises/1/action/virtualappliances", "virtualappliances"));
-      buffer.append(link("/admin/enterprises/1/appslib/templateDefinitionLists", "appslib/templateDefinitionLists"));
-      buffer.append("<cpuHard>0</cpuHard>");
-      buffer.append("<cpuSoft>0</cpuSoft>");
-      buffer.append("<hdHard>0</hdHard>");
-      buffer.append("<hdSoft>0</hdSoft>");
-      buffer.append("<publicIpsHard>0</publicIpsHard>");
-      buffer.append("<publicIpsSoft>0</publicIpsSoft>");
-      buffer.append("<ramHard>0</ramHard>");
-      buffer.append("<ramSoft>0</ramSoft>");
-      buffer.append("<storageHard>0</storageHard>");
-      buffer.append("<storageSoft>0</storageSoft>");
-      buffer.append("<vlansHard>0</vlansHard>");
-      buffer.append("<vlansSoft>0</vlansSoft>");
-      buffer.append("<id>1</id>");
-      buffer.append("<isReservationRestricted>false</isReservationRestricted>");
-      buffer.append("<name>Kalakaua</name>");
-      buffer.append("<repositoryHard>0</repositoryHard>");
-      buffer.append("<repositorySoft>0</repositorySoft>");
-      buffer.append("</enterprise>");
-      return buffer.toString();
-   }
-
-   public static String enterprisePropertiesPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<enterpriseProperties>");
-      buffer.append(link("/admin/enterprises/1/properties", "edit"));
-      buffer.append(link("/admin/enterprises/1", "enterprise"));
-      buffer.append("<id>1</id>");
-      buffer.append("<properties>");
-      buffer.append("<entry>");
-      buffer.append("<key>key</key>");
-      buffer.append("<value>value</value>");
-      buffer.append("</entry>");
-      buffer.append("</properties>");
-      buffer.append("</enterpriseProperties>");
-      return buffer.toString();
-   }
-
-   public static DatacenterLimitsDto datacenterLimitsPost() {
-      DatacenterLimitsDto limits = new DatacenterLimitsDto();
-      limits.setCpuCountLimits(0, 0);
-      limits.setHdLimitsInMb(0, 0);
-      limits.setPublicIPLimits(0, 0);
-      limits.setRamLimitsInMb(0, 0);
-      limits.setStorageLimits(0, 0);
-      limits.setVlansLimits(0, 0);
-      limits.setRepositoryHardLimitsInMb(0);
-      limits.setRepositorySoftLimitsInMb(0);
-      return limits;
-   }
-
-   public static DatacenterLimitsDto datacenterLimitsPut(final EnterpriseDto enterprise) {
-      DatacenterLimitsDto limits = datacenterLimitsPost();
-      limits.setId(1);
-      limits.addLink(new RESTLink("edit", "http://localhost/api/admin/enterprises/" + enterprise.getId() + "/limits/1"));
-      return limits;
-   }
-
-   public static TemplateDefinitionListDto templateListPost() {
-      TemplateDefinitionListDto templateList = new TemplateDefinitionListDto();
-      templateList.setName("myList");
-      templateList.setUrl("http://virtualapp-repository.com/vapp1.ovf");
-      return templateList;
-   }
-
-   public static TemplateDefinitionListDto templateListPut() {
-      TemplateDefinitionListDto templateList = templateListPost();
-      templateList.setId(1);
-      templateList.addLink(new RESTLink("edit",
-            "http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists/1"));
-      templateList.addLink(new RESTLink("repositoryStatus",
-            "http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists/1/actions/repositoryStatus"));
-      return templateList;
-   }
-
-   public static String datacenterLimitsPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<limit>");
-      buffer.append("<cpuHard>0</cpuHard>");
-      buffer.append("<cpuSoft>0</cpuSoft>");
-      buffer.append("<hdHard>0</hdHard>");
-      buffer.append("<hdSoft>0</hdSoft>");
-      buffer.append("<publicIpsHard>0</publicIpsHard>");
-      buffer.append("<publicIpsSoft>0</publicIpsSoft>");
-      buffer.append("<ramHard>0</ramHard>");
-      buffer.append("<ramSoft>0</ramSoft>");
-      buffer.append("<storageHard>0</storageHard>");
-      buffer.append("<storageSoft>0</storageSoft>");
-      buffer.append("<vlansHard>0</vlansHard>");
-      buffer.append("<vlansSoft>0</vlansSoft>");
-      buffer.append("<repositoryHard>0</repositoryHard>");
-      buffer.append("<repositorySoft>0</repositorySoft>");
-      buffer.append("</limit>");
-      return buffer.toString();
-   }
-
-   public static String templateListPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<templateDefinitionList>");
-      buffer.append("<name>myList</name>");
-      buffer.append("<url>http://virtualapp-repository.com/vapp1.ovf</url>");
-      buffer.append("</templateDefinitionList>");
-      return buffer.toString();
-   }
-
-   public static String templateListPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<templateDefinitionList>");
-      buffer.append(link("/admin/enterprises/1/appslib/templateDefinitionLists/1", "edit"));
-      buffer.append(link("/admin/enterprises/1/appslib/templateDefinitionLists/1/actions/repositoryStatus",
-            "repositoryStatus"));
-      buffer.append("<id>1</id>");
-      buffer.append("<name>myList</name>");
-      buffer.append("<url>http://virtualapp-repository.com/vapp1.ovf</url>");
-      buffer.append("</templateDefinitionList>");
-      return buffer.toString();
-   }
-
-   public static String datacenterLimitsPutPayload(final EnterpriseDto enterprise) {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<limit>");
-      buffer.append(link("/admin/enterprises/" + enterprise.getId() + "/limits/1", "edit"));
-      buffer.append("<cpuHard>0</cpuHard>");
-      buffer.append("<cpuSoft>0</cpuSoft>");
-      buffer.append("<hdHard>0</hdHard>");
-      buffer.append("<hdSoft>0</hdSoft>");
-      buffer.append("<publicIpsHard>0</publicIpsHard>");
-      buffer.append("<publicIpsSoft>0</publicIpsSoft>");
-      buffer.append("<ramHard>0</ramHard>");
-      buffer.append("<ramSoft>0</ramSoft>");
-      buffer.append("<storageHard>0</storageHard>");
-      buffer.append("<storageSoft>0</storageSoft>");
-      buffer.append("<vlansHard>0</vlansHard>");
-      buffer.append("<vlansSoft>0</vlansSoft>");
-      buffer.append("<id>1</id>");
-      buffer.append("<repositoryHard>0</repositoryHard>");
-      buffer.append("<repositorySoft>0</repositorySoft>");
-      buffer.append("</limit>");
-      return buffer.toString();
-   }
-
-   public static String userPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<user>");
-      buffer.append(link("/admin/roles/1", "role"));
-      buffer.append("<active>true</active>");
-      buffer.append("<authType>ABIQUO</authType>");
-      buffer.append("<description>A hawaian user</description>");
-      buffer.append("<email>abe.joha@aloha.com</email>");
-      buffer.append("<locale>en_US</locale>");
-      buffer.append("<name>Aberahama</name>");
-      buffer.append("<nick>abejo</nick>");
-      buffer.append("<password>c69a39bd64ffb77ea7ee3369dce742f3</password>");
-      buffer.append("<surname>Johanson</surname>");
-      buffer.append("</user>");
-      return buffer.toString();
-   }
-
-   public static UserDto userPost() {
-      UserDto user = new UserDto();
-      user.setName("Aberahama");
-      user.setSurname("Johanson");
-      user.setDescription("A hawaian user");
-      user.setEmail("abe.joha@aloha.com");
-      user.setNick("abejo");
-      user.setAuthType("ABIQUO");
-      user.setLocale("en_US");
-      user.setActive(true);
-      user.setPassword("c69a39bd64ffb77ea7ee3369dce742f3");
-      user.addLink(new RESTLink("role", "http://localhost/api/admin/roles/1"));
-      return user;
-   }
-
-   public static String userPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<user>");
-      buffer.append(link("/admin/roles/1", "role"));
-      buffer.append(link("/admin/enterprises/1/users/1", "edit"));
-      buffer.append(link("/admin/enterprises/1", "enterprise"));
-      buffer.append(link("/admin/enterprises/1/users/1/action/virtualmachines", "virtualmachines"));
-      buffer.append("<active>true</active>");
-      buffer.append("<authType>ABIQUO</authType>");
-      buffer.append("<description>A hawaian user</description>");
-      buffer.append("<email>abe.joha@aloha.com</email>");
-      buffer.append("<id>1</id>");
-      buffer.append("<locale>en_US</locale>");
-      buffer.append("<name>Aberahama</name>");
-      buffer.append("<nick>abejo</nick>");
-      buffer.append("<password>c69a39bd64ffb77ea7ee3369dce742f3</password>");
-      buffer.append("<surname>Johanson</surname>");
-      buffer.append("</user>");
-      return buffer.toString();
-   }
-
-   public static UserDto userPut() {
-      UserDto user = userPost();
-      user.setId(1);
-      user.addLink(new RESTLink("edit", "http://localhost/api/admin/enterprises/1/users/1"));
-      user.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
-      user.addLink(new RESTLink("virtualmachines",
-            "http://localhost/api/admin/enterprises/1/users/1/action/virtualmachines"));
-      return user;
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/InfrastructureResources.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/InfrastructureResources.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/InfrastructureResources.java
deleted file mode 100644
index 2c33897..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/InfrastructureResources.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import static org.jclouds.abiquo.domain.DomainUtils.link;
-
-import com.abiquo.model.enumerator.RemoteServiceType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.MachineDto;
-import com.abiquo.server.core.infrastructure.RackDto;
-import com.abiquo.server.core.infrastructure.RemoteServiceDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDeviceDto;
-import com.abiquo.server.core.infrastructure.storage.StoragePoolDto;
-import com.abiquo.server.core.infrastructure.storage.TierDto;
-
-/**
- * Infrastructure domain utilities.
- */
-public class InfrastructureResources {
-   public static DatacenterDto datacenterPost() {
-      DatacenterDto datacenter = new DatacenterDto();
-      datacenter.setName("DC");
-      datacenter.setLocation("Honolulu");
-      return datacenter;
-   }
-
-   public static RackDto rackPost() {
-      RackDto rack = new RackDto();
-      rack.setName("Aloha");
-      rack.setShortDescription("A hawaian rack");
-      rack.setHaEnabled(false);
-      rack.setVlanIdMin(6);
-      rack.setVlanIdMax(3024);
-      rack.setVlanPerVdcReserved(6);
-      rack.setNrsq(80);
-      return rack;
-   }
-
-   public static MachineDto machinePost() {
-      MachineDto machine = new MachineDto();
-      machine.setName("Kamehameha");
-      machine.setVirtualCpuCores(3);
-      machine.setDescription("A hawaian machine");
-      machine.setVirtualRamInMb(512);
-      return machine;
-   }
-
-   public static RemoteServiceDto remoteServicePost() {
-      RemoteServiceDto remoteService = new RemoteServiceDto();
-      remoteService.setType(RemoteServiceType.NODE_COLLECTOR);
-      remoteService.setUri("http://localhost:80/nodecollector");
-      remoteService.setStatus(0);
-      return remoteService;
-   }
-
-   public static StorageDeviceDto storageDevicePost() {
-      StorageDeviceDto storage = new StorageDeviceDto();
-      storage.setName("Aloha aloha");
-      storage.setIscsiIp("10.10.10.10");
-      storage.setIscsiPort(99);
-      storage.setManagementPort(90);
-
-      return storage;
-   }
-
-   public static StoragePoolDto storagePoolPost() {
-      StoragePoolDto storagePool = new StoragePoolDto();
-      storagePool.setName("Hawaian Storage Pool");
-      return storagePool;
-   }
-
-   public static DatacenterDto datacenterPut() {
-      DatacenterDto datacenter = datacenterPost();
-      datacenter.setId(1);
-      datacenter.addLink(new RESTLink("checkmachinestate",
-            "http://localhost/api/admin/datacenters/1/action/checkmachinestate"));
-      datacenter.addLink(new RESTLink("checkmachineipmistate",
-            "http://localhost/api/admin/datacenters/1/action/checkmachineipmistate"));
-      datacenter.addLink(new RESTLink("checkremoteservice",
-            "http://localhost/api/admin/datacenters/1/action/checkremoteservice"));
-      datacenter.addLink(new RESTLink("devices", "http://localhost/api/admin/datacenters/1/storage/devices"));
-      datacenter.addLink(new RESTLink("discovermultiple",
-            "http://localhost/api/admin/datacenters/1/action/discovermultiple"));
-      datacenter.addLink(new RESTLink("discoversingle",
-            "http://localhost/api/admin/datacenters/1/action/discoversingle"));
-      datacenter.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1"));
-      datacenter.addLink(new RESTLink("getLimits", "http://localhost/api/admin/datacenters/1/action/getLimits"));
-      datacenter.addLink(new RESTLink("racks", "http://localhost/api/admin/datacenters/1/racks"));
-      datacenter.addLink(new RESTLink("remoteservices", "http://localhost/api/admin/datacenters/1/remoteservices"));
-      datacenter.addLink(new RESTLink("tiers", "http://localhost/api/admin/datacenters/1/storage/tiers"));
-      datacenter.addLink(new RESTLink("network", "http://localhost/api/admin/datacenters/1/network"));
-      datacenter.addLink(new RESTLink("enterprises", "http://localhost/api/admin/datacenters/1/action/enterprises"));
-      datacenter.addLink(new RESTLink("hypervisor", "http://localhost/api/admin/datacenters/1/action/hypervisor"));
-      datacenter.addLink(new RESTLink("hypervisors", "http://localhost/api/admin/datacenters/1/hypervisors"));
-      return datacenter;
-   }
-
-   public static RackDto rackPut() {
-      RackDto rack = rackPost();
-      rack.setId(1);
-      rack.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
-      rack.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/racks/1"));
-      rack.addLink(new RESTLink("machines", "http://localhost/api/admin/datacenters/1/racks/1/machines"));
-      return rack;
-   }
-
-   public static TierDto tierPut() {
-      TierDto tier = new TierDto();
-      tier.setId(1);
-      tier.setEnabled(true);
-      tier.setName("Tier");
-      tier.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/storage/tiers/1"));
-      tier.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
-      tier.addLink(new RESTLink("pools", "http://localhost/api/admin/datacenters/1/storage/tiers/1/pools"));
-
-      return tier;
-   }
-
-   public static StorageDeviceDto storageDevicePut() {
-      StorageDeviceDto storageDevice = storageDevicePost();
-      storageDevice.setId(1);
-      storageDevice.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
-      storageDevice.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/storage/devices/1"));
-      storageDevice.addLink(new RESTLink("pools", "http://localhost/api/admin/datacenters/1/storage/devices/1/pools"));
-
-      return storageDevice;
-   }
-
-   public static StoragePoolDto storagePoolPut() {
-      StoragePoolDto storagePool = storagePoolPost();
-      storagePool.setIdStorage("tururututu");
-      storagePool.addLink(new RESTLink("device", "http://localhost/api/admin/datacenters/1/storage/devices/1"));
-      storagePool.addLink(new RESTLink("edit",
-            "http://localhost/api/admin/datacenters/1/storage/devices/1/pools/tururututu"));
-
-      return storagePool;
-   }
-
-   public static RemoteServiceDto remoteServicePut() {
-      RemoteServiceDto remoteService = remoteServicePost();
-      remoteService.setId(1);
-      remoteService.addLink(new RESTLink("check",
-            "http://localhost/api/admin/datacenters/1/remoteservices/nodecollector/action/check"));
-      remoteService.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
-      remoteService.addLink(new RESTLink("edit",
-            "http://localhost/api/admin/datacenters/1/remoteservices/nodecollector"));
-      return remoteService;
-   }
-
-   public static MachineDto machinePut() {
-      MachineDto machine = machinePost();
-      machine.setId(1);
-      machine.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/racks/1/machines/1"));
-      machine.addLink(new RESTLink("rack", "http://localhost/api/admin/datacenters/1/racks/1"));
-      machine.addLink(new RESTLink("checkstate",
-            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/checkstate"));
-      machine.addLink(new RESTLink("checkipmistate",
-            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/checkipmistate"));
-      machine.addLink(new RESTLink("led", "http://localhost/api/admin/datacenters/1/racks/1/machines/1/led"));
-      machine.addLink(new RESTLink("ledoff",
-            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/ledoff"));
-      machine
-            .addLink(new RESTLink("ledon", "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/ledon"));
-      machine.addLink(new RESTLink("logicserver",
-            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/logicserver"));
-      machine.addLink(new RESTLink("poweroff",
-            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/poweroff"));
-      machine.addLink(new RESTLink("poweron",
-            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/action/poweron"));
-      machine.addLink(new RESTLink("virtualmachines",
-            "http://localhost/api/admin/datacenters/1/racks/1/machines/1/virtualmachines"));
-      machine.setVirtualCpuCores(5);
-
-      return machine;
-   }
-
-   public static String datacenterPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<datacenter>");
-      buffer.append("<location>Honolulu</location>");
-      buffer.append("<name>DC</name>");
-      buffer.append("</datacenter>");
-      return buffer.toString();
-   }
-
-   public static String rackPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<rack>");
-      buffer.append("<haEnabled>false</haEnabled>");
-      buffer.append("<name>Aloha</name>");
-      buffer.append("<nrsq>80</nrsq>");
-      buffer.append("<shortDescription>A hawaian rack</shortDescription>");
-      buffer.append("<vlanIdMax>3024</vlanIdMax>");
-      buffer.append("<vlanIdMin>6</vlanIdMin>");
-      buffer.append("<vlanPerVdcReserved>6</vlanPerVdcReserved>");
-      buffer.append("</rack>");
-      return buffer.toString();
-   }
-
-   public static String storagePoolPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<storagePool>");
-      buffer.append("<availableSizeInMb>0</availableSizeInMb>");
-      buffer.append("<enabled>false</enabled>");
-      buffer.append("<name>Hawaian Storage Pool</name>");
-      buffer.append("<totalSizeInMb>0</totalSizeInMb>");
-      buffer.append("<usedSizeInMb>0</usedSizeInMb>");
-      buffer.append("</storagePool>");
-      return buffer.toString();
-   }
-
-   public static String storageDevicePostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<device>");
-      buffer.append("<iscsiIp>10.10.10.10</iscsiIp>");
-      buffer.append("<iscsiPort>99</iscsiPort>");
-      buffer.append("<managementPort>90</managementPort>");
-      buffer.append("<name>Aloha aloha</name>");
-      buffer.append("</device>");
-      return buffer.toString();
-   }
-
-   public static String machinePostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<machine>");
-      buffer.append("<datastores/>");
-      buffer.append("<description>A hawaian machine</description>");
-      buffer.append("<name>Kamehameha</name>");
-      buffer.append("<cpu>3</cpu>");
-      buffer.append("<cpuUsed>1</cpuUsed>");
-      buffer.append("<ram>512</ram>");
-      buffer.append("<ramUsed>1</ramUsed>");
-      buffer.append("<virtualSwitch>192.168.1.10</virtualSwitch>");
-      buffer.append("</machine>");
-      return buffer.toString();
-   }
-
-   public static String remoteServicePostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<remoteService>");
-      buffer.append("<status>0</status>");
-      buffer.append("<type>NODE_COLLECTOR</type>");
-      buffer.append("<uri>http://localhost:80/nodecollector</uri>");
-      buffer.append("</remoteService>");
-      return buffer.toString();
-   }
-
-   public static String datacenterPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<datacenter>");
-      buffer.append(link("/admin/datacenters/1/action/checkmachinestate", "checkmachinestate"));
-      buffer.append(link("/admin/datacenters/1/action/checkmachineipmistate", "checkmachineipmistate"));
-      buffer.append(link("/admin/datacenters/1/action/checkremoteservice", "checkremoteservice"));
-      buffer.append(link("/admin/datacenters/1/storage/devices", "devices"));
-      buffer.append(link("/admin/datacenters/1/action/discovermultiple", "discovermultiple"));
-      buffer.append(link("/admin/datacenters/1/action/discoversingle", "discoversingle"));
-      buffer.append(link("/admin/datacenters/1", "edit"));
-      buffer.append(link("/admin/datacenters/1/action/getLimits", "getLimits"));
-      buffer.append(link("/admin/datacenters/1/racks", "racks"));
-      buffer.append(link("/admin/datacenters/1/remoteservices", "remoteservices"));
-      buffer.append(link("/admin/datacenters/1/storage/tiers", "tiers"));
-      buffer.append(link("/admin/datacenters/1/network", "network"));
-      buffer.append(link("/admin/datacenters/1/action/enterprises", "enterprises"));
-      buffer.append(link("/admin/datacenters/1/action/hypervisor", "hypervisor"));
-      buffer.append(link("/admin/datacenters/1/hypervisors", "hypervisors"));
-      buffer.append("<id>1</id>");
-      buffer.append("<location>Honolulu</location>");
-      buffer.append("<name>DC</name>");
-      buffer.append("</datacenter>");
-      return buffer.toString();
-   }
-
-   public static String storagePoolPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<storagePool>");
-      buffer.append(link("/admin/datacenters/1/storage/devices/1", "device"));
-      buffer.append(link("/admin/datacenters/1/storage/devices/1/pools/tururututu", "edit"));
-      buffer.append("<availableSizeInMb>0</availableSizeInMb>");
-      buffer.append("<enabled>false</enabled>");
-      buffer.append("<idStorage>tururututu</idStorage>");
-      buffer.append("<name>Hawaian Storage Pool</name>");
-      buffer.append("<totalSizeInMb>0</totalSizeInMb>");
-      buffer.append("<usedSizeInMb>0</usedSizeInMb>");
-      buffer.append("</storagePool>");
-      return buffer.toString();
-   }
-
-   public static String tierPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<tier>");
-      buffer.append(link("/admin/datacenters/1/storage/tiers/1", "edit"));
-      buffer.append(link("/admin/datacenters/1", "datacenter"));
-      buffer.append(link("/admin/datacenters/1/storage/tiers/1/pools", "pools"));
-      buffer.append("<enabled>true</enabled>");
-      buffer.append("<id>1</id>");
-      buffer.append("<name>Tier</name>");
-      buffer.append("</tier>");
-      return buffer.toString();
-   }
-
-   public static String rackPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<rack>");
-      buffer.append(link("/admin/datacenters/1", "datacenter"));
-      buffer.append(link("/admin/datacenters/1/racks/1", "edit"));
-      buffer.append(link("/admin/datacenters/1/racks/1/machines", "machines"));
-      buffer.append("<haEnabled>false</haEnabled>");
-      buffer.append("<id>1</id>");
-      buffer.append("<name>Aloha</name>");
-      buffer.append("<nrsq>80</nrsq>");
-      buffer.append("<shortDescription>A hawaian rack</shortDescription>");
-      buffer.append("<vlanIdMax>3024</vlanIdMax>");
-      buffer.append("<vlanIdMin>6</vlanIdMin>");
-      buffer.append("<vlanPerVdcReserved>6</vlanPerVdcReserved>");
-      buffer.append("</rack>");
-      return buffer.toString();
-   }
-
-   public static String storageDevicePutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<device>");
-      buffer.append(link("/admin/datacenters/1", "datacenter"));
-      buffer.append(link("/admin/datacenters/1/storage/devices/1", "edit"));
-      buffer.append(link("/admin/datacenters/1/storage/devices/1/pools", "pools"));
-      buffer.append("<id>1</id>");
-      buffer.append("<iscsiIp>10.10.10.10</iscsiIp>");
-      buffer.append("<iscsiPort>99</iscsiPort>");
-      buffer.append("<managementPort>90</managementPort>");
-      buffer.append("<name>Aloha aloha</name>");
-      buffer.append("</device>");
-      return buffer.toString();
-   }
-
-   public static String remoteServicePutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<remoteService>");
-      buffer.append(link("/admin/datacenters/1/remoteservices/nodecollector/action/check", "check"));
-      buffer.append(link("/admin/datacenters/1", "datacenter"));
-      buffer.append(link("/admin/datacenters/1/remoteservices/nodecollector", "edit"));
-      buffer.append("<id>1</id>");
-      buffer.append("<status>0</status>");
-      buffer.append("<type>NODE_COLLECTOR</type>");
-      buffer.append("<uri>http://localhost:80/nodecollector</uri>");
-      buffer.append("</remoteService>");
-      return buffer.toString();
-   }
-
-   public static String machinePutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<machine>");
-      buffer.append(link("/admin/datacenters/1/racks/1/machines/1", "edit"));
-      buffer.append(link("/admin/datacenters/1/racks/1", "rack"));
-      buffer.append(link("/admin/datacenters/1/racks/1/machines/1/action/checkstate", "checkstate"));
-      buffer.append(link("/admin/datacenters/1/racks/1/machines/1/action/checkipmistate", "checkipmistate"));
-      buffer.append(link("/admin/datacenters/1/racks/1/machines/1/led", "led"));
-      buffer.append(link("/admin/datacenters/1/racks/1/machines/1/action/ledoff", "ledoff"));
-      buffer.append(link("/admin/datacenters/1/racks/1/machines/1/action/ledon", "ledon"));
-      buffer.append(link("/admin/datacenters/1/racks/1/machines/1/logicserver", "logicserver"));
-      buffer.append(link("/admin/datacenters/1/racks/1/machines/1/action/poweroff", "poweroff"));
-      buffer.append(link("/admin/datacenters/1/racks/1/machines/1/action/poweron", "poweron"));
-      buffer.append(link("/admin/datacenters/1/racks/1/machines/1/virtualmachines", "virtualmachines"));
-      buffer.append("<datastores/>");
-      buffer.append("<description>A hawaian machine</description>");
-      buffer.append("<id>1</id>");
-      buffer.append("<name>Kamehameha</name>");
-      buffer.append("<cpu>5</cpu>");
-      buffer.append("<cpuUsed>1</cpuUsed>");
-      buffer.append("<ram>512</ram>");
-      buffer.append("<ramUsed>1</ramUsed>");
-      buffer.append("<virtualSwitch>192.168.1.10</virtualSwitch>");
-      buffer.append("</machine>");
-      return buffer.toString();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/NetworkResources.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/NetworkResources.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/NetworkResources.java
deleted file mode 100644
index ad564ee..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/NetworkResources.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import static org.jclouds.abiquo.domain.DomainUtils.link;
-
-import com.abiquo.model.enumerator.NetworkType;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.LinksDto;
-import com.abiquo.server.core.infrastructure.network.NicDto;
-import com.abiquo.server.core.infrastructure.network.PrivateIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-
-/**
- * Network domain utilities.
- */
-public class NetworkResources {
-   public static VLANNetworkDto vlanPost() {
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.setAddress("192.168.1.0");
-      vlan.setDefaultNetwork(true);
-      vlan.setName("DefaultNetwork");
-      vlan.setGateway("192.168.1.1");
-      vlan.setMask(24);
-
-      return vlan;
-   }
-
-   public static PrivateIpDto privateIpPut() {
-      PrivateIpDto ip = new PrivateIpDto();
-      ip.setId(1);
-      ip.setName("private ip");
-      ip.setMac("00:58:5A:c0:C3:01");
-      RESTLink self = new RESTLink("self", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips/1");
-      self.setTitle("privateip");
-      ip.addLink(self);
-      return ip;
-   }
-
-   public static PublicIpDto publicIpToPurchase() {
-      PublicIpDto ip = new PublicIpDto();
-      RESTLink self = new RESTLink("purchase", "http://localhost/api/cloud/virtualdatacenters/5/publicips/purchased/1");
-      ip.addLink(self);
-      return ip;
-   }
-
-   public static PublicIpDto publicIpToRelease() {
-      PublicIpDto ip = new PublicIpDto();
-      RESTLink self = new RESTLink("release", "http://localhost/api/cloud/virtualdatacenters/5/publicips/topurchase/1");
-      ip.addLink(self);
-      return ip;
-   }
-
-   public static NicDto nicPut() {
-      NicDto nic = new NicDto();
-      nic.setId(1);
-      nic.setIp("123.123.123.123");
-      nic.setMac("00:58:5A:c0:C3:01");
-      nic.addLink(new RESTLink("edit",
-            "http://localhost/api/cloud/virtualdatacenters/1/virtualappliances/1/virtualmachines/1/network/nics/1"));
-
-      return nic;
-   }
-
-   public static VLANNetworkDto privateNetworkPut() {
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.setId(1);
-      vlan.setAddress("192.168.1.0");
-      vlan.setDefaultNetwork(true);
-      vlan.setName("DefaultNetwork");
-      vlan.setGateway("192.168.1.1");
-      vlan.setMask(24);
-      vlan.setType(NetworkType.INTERNAL);
-      vlan.addLink(new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1"));
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips"));
-
-      return vlan;
-   }
-
-   public static VLANNetworkDto publicNetworkPut() {
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.setId(1);
-      vlan.setAddress("192.168.1.0");
-      vlan.setDefaultNetwork(true);
-      vlan.setName("PublicNetwork");
-      vlan.setGateway("192.168.1.1");
-      vlan.setMask(24);
-      vlan.setType(NetworkType.PUBLIC);
-      vlan.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/network/1"));
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/datacenters/1/network/1/ips"));
-
-      return vlan;
-   }
-
-   public static VLANNetworkDto externalNetworkPut() {
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.setId(1);
-      vlan.setAddress("192.168.1.0");
-      vlan.setDefaultNetwork(true);
-      vlan.setName("ExternalNetwork");
-      vlan.setGateway("192.168.1.1");
-      vlan.setMask(24);
-      vlan.setType(NetworkType.EXTERNAL);
-      vlan.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/network/1"));
-      vlan.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/1/limits/1/externalnetworks/1/ips"));
-
-      return vlan;
-   }
-
-   public static VLANNetworkDto unmanagedNetworkPut() {
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.setId(1);
-      vlan.setAddress("192.168.1.0");
-      vlan.setDefaultNetwork(true);
-      vlan.setName("UnmanagedNetwork");
-      vlan.setGateway("192.168.1.1");
-      vlan.setMask(24);
-      vlan.setType(NetworkType.UNMANAGED);
-      vlan.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/network/1"));
-      vlan.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/1/limits/1/externalnetworks/1/ips"));
-
-      return vlan;
-   }
-
-   public static String vlanNetworkPostPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<network>");
-      buffer.append("<address>192.168.1.0</address>");
-      buffer.append("<defaultNetwork>true</defaultNetwork>");
-      buffer.append("<gateway>192.168.1.1</gateway>");
-      buffer.append("<mask>24</mask>");
-      buffer.append("<name>DefaultNetwork</name>");
-      buffer.append("</network>");
-      return buffer.toString();
-   }
-
-   public static String privateNetworkPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<network>");
-      buffer.append(link("/cloud/virtualdatacenters/1/privatenetworks/1", "edit"));
-      buffer.append(link("/cloud/virtualdatacenters/1/privatenetworks/1/ips", "ips"));
-      buffer.append("<address>192.168.1.0</address>");
-      buffer.append("<defaultNetwork>true</defaultNetwork>");
-      buffer.append("<gateway>192.168.1.1</gateway>");
-      buffer.append("<id>1</id>");
-      buffer.append("<mask>24</mask>");
-      buffer.append("<name>DefaultNetwork</name>");
-      buffer.append("<type>INTERNAL</type>");
-      buffer.append("</network>");
-      return buffer.toString();
-   }
-
-   public static String publicNetworkPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<network>");
-      buffer.append(link("/admin/datacenters/1/network/1", "edit"));
-      buffer.append(link("/admin/datacenters/1/network/1/ips", "ips"));
-      buffer.append("<address>192.168.1.0</address>");
-      buffer.append("<defaultNetwork>true</defaultNetwork>");
-      buffer.append("<gateway>192.168.1.1</gateway>");
-      buffer.append("<id>1</id>");
-      buffer.append("<mask>24</mask>");
-      buffer.append("<name>PublicNetwork</name>");
-      buffer.append("<type>PUBLIC</type>");
-      buffer.append("</network>");
-      return buffer.toString();
-   }
-
-   public static String externalNetworkPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<network>");
-      buffer.append(link("/admin/datacenters/1/network/1", "edit"));
-      buffer.append(link("/admin/enterprises/1", "enterprise"));
-      buffer.append(link("/admin/enterprises/1/limits/1/externalnetworks/1/ips", "ips"));
-      buffer.append("<address>192.168.1.0</address>");
-      buffer.append("<defaultNetwork>true</defaultNetwork>");
-      buffer.append("<gateway>192.168.1.1</gateway>");
-      buffer.append("<id>1</id>");
-      buffer.append("<mask>24</mask>");
-      buffer.append("<name>ExternalNetwork</name>");
-      buffer.append("<type>EXTERNAL</type>");
-      buffer.append("</network>");
-      return buffer.toString();
-   }
-
-   public static String unmanagedNetworkPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<network>");
-      buffer.append(link("/admin/datacenters/1/network/1", "edit"));
-      buffer.append(link("/admin/enterprises/1", "enterprise"));
-      buffer.append(link("/admin/enterprises/1/limits/1/externalnetworks/1/ips", "ips"));
-      buffer.append("<address>192.168.1.0</address>");
-      buffer.append("<defaultNetwork>true</defaultNetwork>");
-      buffer.append("<gateway>192.168.1.1</gateway>");
-      buffer.append("<id>1</id>");
-      buffer.append("<mask>24</mask>");
-      buffer.append("<name>UnmanagedNetwork</name>");
-      buffer.append("<type>UNMANAGED</type>");
-      buffer.append("</network>");
-      return buffer.toString();
-   }
-
-   public static String privateIpPutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<ipPoolManagement>");
-      buffer.append(link("/cloud/virtualdatacenters/1/privatenetworks/1/ips/1", "self", "privateip"));
-      buffer.append("<available>false</available>");
-      buffer.append("<id>1</id>");
-      buffer.append("<mac>00:58:5A:c0:C3:01</mac>");
-      buffer.append("<name>private ip</name>");
-      buffer.append("<quarantine>false</quarantine>");
-      buffer.append("</ipPoolManagement>");
-      return buffer.toString();
-   }
-
-   public static String linksDtoPayload(final LinksDto dto) {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<links>");
-      for (RESTLink link : dto.getLinks()) {
-         buffer.append(link(link));
-      }
-      buffer.append("</links>");
-      return buffer.toString();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/domain/TemplateResources.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/domain/TemplateResources.java b/abiquo/src/test/java/org/jclouds/abiquo/domain/TemplateResources.java
deleted file mode 100644
index 36a51f3..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/domain/TemplateResources.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import static org.jclouds.abiquo.domain.DomainUtils.link;
-
-import com.abiquo.model.enumerator.ConversionState;
-import com.abiquo.model.enumerator.DiskFormatType;
-import com.abiquo.model.enumerator.OSType;
-import com.abiquo.model.enumerator.VMTemplateState;
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.appslibrary.ConversionDto;
-import com.abiquo.server.core.appslibrary.DatacenterRepositoryDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplatePersistentDto;
-
-/**
- * VM template domain utilities.
- */
-public class TemplateResources {
-   public static DatacenterRepositoryDto datacenterRepositoryPut() {
-      DatacenterRepositoryDto dcRepository = new DatacenterRepositoryDto();
-      dcRepository.setName("Datacenter Repo");
-      dcRepository.setRepositoryCapacityMb(0);
-      dcRepository.setRepositoryLocation("10.60.1.104:/volume1/nfs-devel");
-      dcRepository.setRepositoryRemainingMb(0);
-      dcRepository.addLink(new RESTLink("applianceManagerRepositoryUri", "http://localhost/am/erepos/1"));
-      dcRepository.addLink(new RESTLink("datacenter", "http://localhost/api/admin/datacenters/1"));
-      dcRepository.addLink(new RESTLink("edit", "http://localhost/api/admin/enterprises/1/datacenterrepositories/1"));
-      dcRepository.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
-      dcRepository.addLink(new RESTLink("refresh",
-            "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/actions/refresh"));
-      dcRepository.addLink(new RESTLink("virtualmachinetemplates",
-            "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates"));
-
-      return dcRepository;
-   }
-
-   public static VirtualMachineTemplateDto virtualMachineTemplatePut() {
-      VirtualMachineTemplateDto template = new VirtualMachineTemplateDto();
-      template.setName("Template");
-      template.setId(1);
-      template.setDescription("Description");
-      template.addLink(new RESTLink("edit",
-            "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1"));
-      template.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
-      template.addLink(new RESTLink("conversions", "http://localhost/api/admin/enterprises/1"
-            + "/datacenterrepositories/1/virtualmachinetemplates/1/conversions"));
-      template.addLink(new RESTLink("tasks", "http://localhost/api/admin/enterprises/1"
-            + "/datacenterrepositories/1/virtualmachinetemplates/1/tasks"));
-      template.addLink(new RESTLink("diskfile", "http://somewhere.com/file.vmdk"));
-      template.setDiskFormatType("RAW");
-      template.setOsType(OSType.MACOS);
-      template.setLoginUser("myuser");
-      template.setLoginPassword("mypass");
-      template.setState(VMTemplateState.DONE);
-      template.setCpuRequired(1);
-      template.setRamRequired(1);
-      template.setHdRequired(20l);
-      template.setDiskFileSize(30l);
-
-      template.setCostCode(0);
-      return template;
-   }
-
-   public static String virtualMachineTemplatePutPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualMachineTemplate>");
-      buffer.append(link("/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1", "edit"));
-      buffer.append(link("/admin/enterprises/1", "enterprise"));
-      buffer.append(link("/admin/enterprises/1" + "/datacenterrepositories/1/virtualmachinetemplates/1/conversions",
-            "conversions"));
-
-      buffer.append(link("/admin/enterprises/1" + "/datacenterrepositories/1/virtualmachinetemplates/1/tasks", "tasks"));
-      buffer.append(link(new RESTLink("diskfile", "http://somewhere.com/file.vmdk")));
-      buffer.append("<id>1</id>");
-      buffer.append("<name>Template</name>");
-      buffer.append("<description>Description</description>");
-      buffer.append("<diskFormatType>RAW</diskFormatType>");
-      buffer.append("<osType>MACOS</osType>");
-      buffer.append("<loginUser>myuser</loginUser>");
-      buffer.append("<loginPassword>mypass</loginPassword>");
-      buffer.append("<state>DONE</state>");
-
-      buffer.append("<diskFileSize>30</diskFileSize>");
-      buffer.append("<cpuRequired>1</cpuRequired>");
-      buffer.append("<ramRequired>1</ramRequired>");
-      buffer.append("<hdRequired>20</hdRequired>");
-      buffer.append("<shared>false</shared>");
-      buffer.append("<costCode>0</costCode>");
-      buffer.append("<chefEnabled>false</chefEnabled>");
-      buffer.append("</virtualMachineTemplate>");
-      return buffer.toString();
-   }
-
-   public static VirtualMachineTemplatePersistentDto persistentData() {
-      VirtualMachineTemplatePersistentDto dto = new VirtualMachineTemplatePersistentDto();
-      dto.setPersistentTemplateName("New persistent template name");
-      dto.setPersistentVolumeName("New persistent volume name");
-      dto.addLink(new RESTLink("tier", "http://localhost/api/cloud/virtualdatacenters/1/tiers/1"));
-      dto.addLink(new RESTLink("virtualdatacenter", "http://localhost/api/cloud/virtualdatacenters/1"));
-      dto.addLink(new RESTLink("virtualmachinetemplate",
-            "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1"));
-      return dto;
-   }
-
-   public static String persistentPayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<virtualmachinetemplatepersistent>");
-      buffer.append(link("/cloud/virtualdatacenters/1/tiers/1", "tier"));
-      buffer.append(link("/cloud/virtualdatacenters/1", "virtualdatacenter"));
-      buffer.append(link("/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1",
-            "virtualmachinetemplate"));
-      buffer.append("<persistentTemplateName>New persistent template name</persistentTemplateName>");
-      buffer.append("<persistentVolumeName>New persistent volume name</persistentVolumeName>");
-      buffer.append("</virtualmachinetemplatepersistent>");
-      return buffer.toString();
-   }
-
-   public static ConversionDto conversionPut() {
-      ConversionDto conversion = new ConversionDto();
-      conversion.setState(ConversionState.ENQUEUED);
-      conversion.setSourceFormat(DiskFormatType.VMDK_STREAM_OPTIMIZED);
-      conversion.setSourcePath("source/path.vmkd");
-      conversion.setTargetFormat(DiskFormatType.RAW);
-      conversion.setTargetPath("target/path.raw");
-      conversion.setTargetSizeInBytes(1000000l);
-      conversion
-            .addLink(new RESTLink("edit",
-                  "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1/conversions/RAW"));
-      conversion
-            .addLink(new RESTLink("tasks",
-                  "http://localhost/api/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1/conversions/RAW/tasks"));
-
-      return conversion;
-   }
-
-   public static String conversionPutPlayload() {
-      StringBuilder buffer = new StringBuilder();
-      buffer.append("<conversion>");
-      buffer.append(link("/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1/conversions/RAW",
-            "edit"));
-      buffer.append(link(
-            "/admin/enterprises/1/datacenterrepositories/1/virtualmachinetemplates/1/conversions/RAW/tasks", "tasks"));
-
-      buffer.append("<state>ENQUEUED</state>");
-      buffer.append("<sourceFormat>VMDK_STREAM_OPTIMIZED</sourceFormat>");
-      buffer.append("<sourcePath>source/path.vmkd</sourcePath>");
-      buffer.append("<targetFormat>RAW</targetFormat>");
-      buffer.append("<targetPath>target/path.raw</targetPath>");
-      buffer.append("<targetSizeInBytes>1000000</targetSizeInBytes>");
-      buffer.append("</conversion>");
-      return buffer.toString();
-   }
-}


[23/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/AppendMachineIdToPath.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/AppendMachineIdToPath.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/AppendMachineIdToPath.java
deleted file mode 100644
index 3d4a41e..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/AppendMachineIdToPath.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.infrastructure;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.binders.AppendToPath;
-import org.jclouds.abiquo.functions.infrastructure.ParseMachineId;
-import org.jclouds.http.HttpRequest;
-
-/**
- * Append the {@link Machine} id to the request URI.
- */
-@Singleton
-public class AppendMachineIdToPath extends AppendToPath {
-   private ParseMachineId parser;
-
-   @Inject
-   public AppendMachineIdToPath(final ParseMachineId parser) {
-      super();
-      this.parser = parser;
-   }
-
-   @Override
-   protected <R extends HttpRequest> String getValue(final R request, final Object input) {
-      return parser.apply(input);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/AppendRemoteServiceTypeToPath.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/AppendRemoteServiceTypeToPath.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/AppendRemoteServiceTypeToPath.java
deleted file mode 100644
index 29d0943..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/AppendRemoteServiceTypeToPath.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.infrastructure;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.binders.AppendToPath;
-import org.jclouds.abiquo.functions.infrastructure.ParseRemoteServiceType;
-import org.jclouds.http.HttpRequest;
-
-/**
- * Append the {@link RemoteServiceType} service to the request URI.
- * <p>
- * This method assumes that the input object is a {@link RemoteServiceType}
- * enumeration.
- */
-@Singleton
-public class AppendRemoteServiceTypeToPath extends AppendToPath {
-   private ParseRemoteServiceType parser;
-
-   @Inject
-   public AppendRemoteServiceTypeToPath(final ParseRemoteServiceType parser) {
-      super();
-      this.parser = parser;
-   }
-
-   @Override
-   protected <R extends HttpRequest> String getValue(final R request, final Object input) {
-      return parser.apply(input);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPath.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPath.java b/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPath.java
deleted file mode 100644
index 2de3f33..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/binders/infrastructure/BindSupportedDevicesLinkToPath.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.binders.infrastructure;
-
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.binders.BindToPath;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-
-/**
- * Binds the given link to the uri appends the supported devices action path.
- */
-@Singleton
-public class BindSupportedDevicesLinkToPath extends BindToPath {
-
-   @Override
-   protected String getNewEndpoint(final GeneratedHttpRequest gRequest, final Object input) {
-      return super.getNewEndpoint(gRequest, input) + "/action/supported";
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/config/AbiquoComputeServiceContextModule.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/config/AbiquoComputeServiceContextModule.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/config/AbiquoComputeServiceContextModule.java
deleted file mode 100644
index 7e7282d..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/config/AbiquoComputeServiceContextModule.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.config;
-
-import org.jclouds.abiquo.compute.functions.DatacenterToLocation;
-import org.jclouds.abiquo.compute.functions.VirtualDatacenterToLocation;
-import org.jclouds.abiquo.compute.functions.VirtualMachineTemplateInVirtualDatacenterToHardware;
-import org.jclouds.abiquo.compute.functions.VirtualMachineTemplateToImage;
-import org.jclouds.abiquo.compute.functions.VirtualMachineToNodeMetadata;
-import org.jclouds.abiquo.compute.options.AbiquoTemplateOptions;
-import org.jclouds.abiquo.compute.strategy.AbiquoComputeServiceAdapter;
-import org.jclouds.abiquo.compute.strategy.CreateGroupBeforeCreatingNodes;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplateInVirtualDatacenter;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.compute.ComputeServiceAdapter;
-import org.jclouds.compute.config.ComputeServiceAdapterContextModule;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.compute.strategy.CreateNodesInGroupThenAddToSet;
-import org.jclouds.domain.Location;
-import org.jclouds.location.suppliers.ImplicitLocationSupplier;
-import org.jclouds.location.suppliers.implicit.OnlyLocationOrFirstZone;
-
-import com.google.common.base.Function;
-import com.google.inject.Scopes;
-import com.google.inject.TypeLiteral;
-
-/**
- * Abiquo Compute service configuration module.
- */
-public class AbiquoComputeServiceContextModule
-      extends
-      ComputeServiceAdapterContextModule<VirtualMachine, VirtualMachineTemplateInVirtualDatacenter, VirtualMachineTemplate, VirtualDatacenter> {
-
-   @Override
-   protected void configure() {
-      super.configure();
-      bind(
-            new TypeLiteral<ComputeServiceAdapter<VirtualMachine, VirtualMachineTemplateInVirtualDatacenter, VirtualMachineTemplate, VirtualDatacenter>>() {
-            }).to(AbiquoComputeServiceAdapter.class);
-      bind(new TypeLiteral<Function<VirtualMachine, NodeMetadata>>() {
-      }).to(VirtualMachineToNodeMetadata.class);
-      bind(new TypeLiteral<Function<VirtualMachineTemplate, Image>>() {
-      }).to(VirtualMachineTemplateToImage.class);
-      bind(new TypeLiteral<Function<VirtualMachineTemplateInVirtualDatacenter, Hardware>>() {
-      }).to(VirtualMachineTemplateInVirtualDatacenterToHardware.class);
-      bind(new TypeLiteral<Function<Datacenter, Location>>() {
-      }).to(DatacenterToLocation.class);
-      bind(new TypeLiteral<Function<VirtualDatacenter, Location>>() {
-      }).to(VirtualDatacenterToLocation.class);
-      bind(ImplicitLocationSupplier.class).to(OnlyLocationOrFirstZone.class).in(Scopes.SINGLETON);
-      bind(TemplateOptions.class).to(AbiquoTemplateOptions.class);
-      bind(CreateNodesInGroupThenAddToSet.class).to(CreateGroupBeforeCreatingNodes.class);
-      install(new LocationsFromComputeServiceAdapterModule<VirtualMachine, VirtualMachineTemplateInVirtualDatacenter, VirtualMachineTemplate, VirtualDatacenter>() {
-      });
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/DatacenterToLocation.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/DatacenterToLocation.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/DatacenterToLocation.java
deleted file mode 100644
index eba7a9c..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/DatacenterToLocation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LocationBuilder;
-import org.jclouds.domain.LocationScope;
-
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Converts a {@link Datacenter} to a {@link Location} one.
- * <p>
- * Physical datacenters will be considered regions.
- */
-@Singleton
-public class DatacenterToLocation implements Function<Datacenter, Location> {
-
-   @Override
-   public Location apply(final Datacenter datacenter) {
-      LocationBuilder builder = new LocationBuilder();
-      builder.id(datacenter.getId().toString());
-      builder.description(datacenter.getName() + " [" + datacenter.getLocation() + "]");
-      builder.metadata(ImmutableMap.<String, Object> of());
-      builder.scope(LocationScope.REGION);
-      builder.iso3166Codes(ImmutableSet.<String> of());
-
-      builder.parent(new LocationBuilder().scope(LocationScope.PROVIDER).id("abiquo").description("abiquo").build());
-
-      return builder.build();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualDatacenterToLocation.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualDatacenterToLocation.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualDatacenterToLocation.java
deleted file mode 100644
index 0681844..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualDatacenterToLocation.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.collect.Memoized;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LocationBuilder;
-import org.jclouds.domain.LocationScope;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Converts a {@link VirtualDatacenter} to a {@link Location} one.
- * <p>
- * Virtual datacenters will be considered zones, since images will be deployed
- * in a virtual datacenter. Each zone will be scoped into a physical datacenter
- * (region).
- */
-@Singleton
-public class VirtualDatacenterToLocation implements Function<VirtualDatacenter, Location> {
-   private final Function<Datacenter, Location> datacenterToLocation;
-
-   private final Supplier<Map<Integer, Datacenter>> regionMap;
-
-   @Inject
-   public VirtualDatacenterToLocation(final Function<Datacenter, Location> datacenterToLocation,
-         @Memoized final Supplier<Map<Integer, Datacenter>> regionMap) {
-      this.datacenterToLocation = checkNotNull(datacenterToLocation, "datacenterToLocation");
-      this.regionMap = checkNotNull(regionMap, "regionMap");
-   }
-
-   @Override
-   public Location apply(final VirtualDatacenter vdc) {
-      LocationBuilder builder = new LocationBuilder();
-      builder.id(vdc.getId().toString());
-      builder.description(vdc.getName());
-      builder.metadata(ImmutableMap.<String, Object> of());
-      builder.scope(LocationScope.ZONE);
-      builder.iso3166Codes(ImmutableSet.<String> of());
-
-      Datacenter parent = regionMap.get().get(vdc.unwrap().getIdFromLink(ParentLinkName.DATACENTER));
-      builder.parent(datacenterToLocation.apply(parent));
-
-      return builder.build();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineStateToNodeState.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineStateToNodeState.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineStateToNodeState.java
deleted file mode 100644
index 311bad2..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineStateToNodeState.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import javax.inject.Singleton;
-
-import org.jclouds.compute.domain.NodeMetadata.Status;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.common.base.Function;
-
-/**
- * Converts a {@link VirtualMachineState} object to a {@link Status} one.
- */
-@Singleton
-public class VirtualMachineStateToNodeState implements Function<VirtualMachineState, Status> {
-
-   @Override
-   public Status apply(final VirtualMachineState state) {
-      switch (state) {
-         case ALLOCATED:
-         case LOCKED:
-         case CONFIGURED:
-         case NOT_ALLOCATED:
-            return Status.PENDING;
-         case ON:
-            return Status.RUNNING;
-         case OFF:
-         case PAUSED:
-            return Status.SUSPENDED;
-         case UNKNOWN:
-         default:
-            return Status.UNRECOGNIZED;
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateInVirtualDatacenterToHardware.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateInVirtualDatacenterToHardware.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateInVirtualDatacenterToHardware.java
deleted file mode 100644
index bd2631a..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateInVirtualDatacenterToHardware.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplateInVirtualDatacenter;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.HardwareBuilder;
-import org.jclouds.compute.domain.Processor;
-import org.jclouds.compute.domain.Volume;
-import org.jclouds.compute.domain.VolumeBuilder;
-import org.jclouds.compute.predicates.ImagePredicates;
-import org.jclouds.domain.Location;
-
-import com.google.common.base.Function;
-
-/**
- * Transforms a {@link VirtualMachineTemplate} into an {@link Hardware}.
- * <p>
- * Each {@link Image} ({@link VirtualMachineTemplate}) will have one
- * {@link Hardware} entity for each zone (scoped to a virtualization technology)
- * supported by the image.
- */
-@Singleton
-public class VirtualMachineTemplateInVirtualDatacenterToHardware implements
-      Function<VirtualMachineTemplateInVirtualDatacenter, Hardware> {
-   /** The default core speed, 2.0Ghz. */
-   public static final double DEFAULT_CORE_SPEED = 2.0;
-
-   private final Function<VirtualDatacenter, Location> virtualDatacenterToLocation;
-
-   @Inject
-   public VirtualMachineTemplateInVirtualDatacenterToHardware(
-         final Function<VirtualDatacenter, Location> virtualDatacenterToLocation) {
-      this.virtualDatacenterToLocation = checkNotNull(virtualDatacenterToLocation, "virtualDatacenterToLocation");
-   }
-
-   @Override
-   public Hardware apply(final VirtualMachineTemplateInVirtualDatacenter templateInVirtualDatacenter) {
-      VirtualMachineTemplate template = templateInVirtualDatacenter.getTemplate();
-      VirtualDatacenter virtualDatacenter = templateInVirtualDatacenter.getZone();
-
-      HardwareBuilder builder = new HardwareBuilder();
-      builder.providerId(template.getId().toString());
-      builder.id(template.getId().toString() + "/" + virtualDatacenter.getId());
-      builder.uri(template.getURI());
-
-      builder.name(template.getName());
-      builder.processor(new Processor(template.getCpuRequired(), DEFAULT_CORE_SPEED));
-      builder.ram(template.getRamRequired());
-
-      // Location information
-      builder.location(virtualDatacenterToLocation.apply(virtualDatacenter));
-      builder.hypervisor(virtualDatacenter.getHypervisorType().name());
-      builder.supportsImage(ImagePredicates.idEquals(template.getId().toString()));
-
-      VolumeBuilder volumeBuilder = new VolumeBuilder();
-      volumeBuilder.bootDevice(true);
-      volumeBuilder.size(toGb(template.getHdRequired()));
-      volumeBuilder.type(Volume.Type.LOCAL);
-      volumeBuilder.durable(false);
-      builder.volume(volumeBuilder.build());
-
-      return builder.build();
-   }
-
-   private static float toGb(final long bytes) {
-      return bytes / (float) (1024 * 1024 * 1024);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateToImage.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateToImage.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateToImage.java
deleted file mode 100644
index 0bf5125..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineTemplateToImage.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.Image.Status;
-import org.jclouds.compute.domain.ImageBuilder;
-import org.jclouds.compute.domain.OperatingSystem;
-import org.jclouds.domain.Location;
-
-import com.abiquo.model.rest.RESTLink;
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-
-/**
- * Transforms a {@link VirtualMachineTemplate} into an {@link Image}.
- * <p>
- * Images are scoped to a region (physical datacenter).
- */
-@Singleton
-public class VirtualMachineTemplateToImage implements Function<VirtualMachineTemplate, Image> {
-   private final Function<Datacenter, Location> datacenterToLocation;
-
-   private final Supplier<Map<Integer, Datacenter>> regionMap;
-
-   @Inject
-   public VirtualMachineTemplateToImage(final Function<Datacenter, Location> datacenterToLocation,
-         @Memoized final Supplier<Map<Integer, Datacenter>> regionMap) {
-      this.datacenterToLocation = checkNotNull(datacenterToLocation, "datacenterToLocation");
-      this.regionMap = checkNotNull(regionMap, "regionMap");
-   }
-
-   @Override
-   public Image apply(final VirtualMachineTemplate template) {
-      ImageBuilder builder = new ImageBuilder();
-      builder.ids(template.getId().toString());
-      builder.name(template.getName());
-      builder.description(template.getDescription());
-
-      // Location information
-      Datacenter region = regionMap.get().get(template.unwrap().getIdFromLink(ParentLinkName.DATACENTER));
-      builder.location(datacenterToLocation.apply(region));
-
-      // Only conversions have a status
-      builder.status(Status.AVAILABLE);
-      builder.backendStatus(Status.AVAILABLE.name()); // Abiquo images do not
-                                                      // have a status
-
-      RESTLink downloadLink = template.unwrap().searchLink("diskfile");
-      builder.uri(downloadLink == null ? null : URI.create(downloadLink.getHref()));
-
-      // TODO: Operating system not implemented in Abiquo Templates
-      // TODO: Image credentials still not present in Abiquo template metadata
-      // Will be added in Abiquo 2.4:
-      // http://jira.abiquo.com/browse/ABICLOUDPREMIUM-3647
-      builder.operatingSystem(OperatingSystem.builder().description(template.getName()).build());
-
-      return builder.build();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineToNodeMetadata.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineToNodeMetadata.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineToNodeMetadata.java
deleted file mode 100644
index 4b18546..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/functions/VirtualMachineToNodeMetadata.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.transform;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplateInVirtualDatacenter;
-import org.jclouds.abiquo.domain.network.Ip;
-import org.jclouds.abiquo.domain.network.PrivateIp;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.HardwareBuilder;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.NodeMetadataBuilder;
-import org.jclouds.compute.domain.Processor;
-import org.jclouds.domain.Location;
-import org.jclouds.logging.Logger;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.common.base.Function;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Lists;
-
-/**
- * Links a {@link VirtualMachine} object to a {@link NodeMetadata} one.
- */
-@Singleton
-public class VirtualMachineToNodeMetadata implements Function<VirtualMachine, NodeMetadata> {
-   @Resource
-   protected Logger logger = Logger.NULL;
-
-   private final VirtualMachineTemplateToImage virtualMachineTemplateToImage;
-
-   private final VirtualMachineTemplateInVirtualDatacenterToHardware virtualMachineTemplateToHardware;
-
-   private final VirtualMachineStateToNodeState virtualMachineStateToNodeState;
-
-   private final Function<VirtualDatacenter, Location> virtualDatacenterToLocation;
-
-   @Inject
-   public VirtualMachineToNodeMetadata(final VirtualMachineTemplateToImage virtualMachineTemplateToImage,
-         final VirtualMachineTemplateInVirtualDatacenterToHardware virtualMachineTemplateToHardware,
-         final VirtualMachineStateToNodeState virtualMachineStateToNodeState,
-         final Function<VirtualDatacenter, Location> virtualDatacenterToLocation) {
-      this.virtualMachineTemplateToImage = checkNotNull(virtualMachineTemplateToImage, "virtualMachineTemplateToImage");
-      this.virtualMachineTemplateToHardware = checkNotNull(virtualMachineTemplateToHardware,
-            "virtualMachineTemplateToHardware");
-      this.virtualMachineStateToNodeState = checkNotNull(virtualMachineStateToNodeState,
-            "virtualMachineStateToNodeState");
-      this.virtualDatacenterToLocation = checkNotNull(virtualDatacenterToLocation, "virtualDatacenterToLocation");
-   }
-
-   @Override
-   public NodeMetadata apply(final VirtualMachine vm) {
-      NodeMetadataBuilder builder = new NodeMetadataBuilder();
-      builder.ids(vm.getId().toString());
-      builder.uri(vm.getURI());
-      builder.name(vm.getNameLabel());
-      builder.group(vm.getVirtualAppliance().getName());
-
-      // TODO: Node credentials still not present in Abiquo template metadata
-      // Will be added in Abiquo 2.4:
-      // http://jira.abiquo.com/browse/ABICLOUDPREMIUM-3647
-
-      // Location details
-      VirtualDatacenter vdc = vm.getVirtualDatacenter();
-      builder.location(virtualDatacenterToLocation.apply(vdc));
-
-      // Image details
-      VirtualMachineTemplate template = vm.getTemplate();
-      Image image = virtualMachineTemplateToImage.apply(template);
-      builder.imageId(image.getId().toString());
-      builder.operatingSystem(image.getOperatingSystem());
-
-      // Hardware details
-      Hardware defaultHardware = virtualMachineTemplateToHardware.apply(new VirtualMachineTemplateInVirtualDatacenter(
-            template, vdc));
-
-      Hardware hardware = HardwareBuilder
-            .fromHardware(defaultHardware)
-            .ram(vm.getRam())
-            .processors(
-                  Lists.newArrayList(new Processor(vm.getCpu(),
-                        VirtualMachineTemplateInVirtualDatacenterToHardware.DEFAULT_CORE_SPEED))) //
-            .build();
-
-      builder.hardware(hardware);
-
-      // Networking configuration
-      Iterable<Ip<?, ?>> nics = vm.listAttachedNics();
-      builder.privateAddresses(ips(filter(nics, Predicates.instanceOf(PrivateIp.class))));
-      builder.publicAddresses(ips(filter(nics, Predicates.not(Predicates.instanceOf(PrivateIp.class)))));
-
-      // Node state
-      VirtualMachineState state = vm.getState();
-      builder.status(virtualMachineStateToNodeState.apply(state));
-      builder.backendStatus(state.name());
-
-      return builder.build();
-   }
-
-   private static Iterable<String> ips(final Iterable<Ip<?, ?>> nics) {
-      return transform(nics, new Function<Ip<?, ?>, String>() {
-         @Override
-         public String apply(final Ip<?, ?> nic) {
-            return nic.getIp();
-         }
-      });
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/options/AbiquoTemplateOptions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/options/AbiquoTemplateOptions.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/options/AbiquoTemplateOptions.java
deleted file mode 100644
index 805d8ce..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/options/AbiquoTemplateOptions.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.options;
-
-import org.jclouds.compute.options.TemplateOptions;
-
-/**
- * Contains options supported by the ComputeService on the <em>Abiquo</em>
- * provider.
- */
-public class AbiquoTemplateOptions extends TemplateOptions implements Cloneable {
-   public static final AbiquoTemplateOptions NONE = new AbiquoTemplateOptions();
-
-   private Integer overrideCores;
-
-   private Integer overrideRam;
-
-   private String vncPassword;
-
-   @Override
-   public TemplateOptions clone() {
-      AbiquoTemplateOptions options = new AbiquoTemplateOptions();
-      copyTo(options);
-      return options;
-   }
-
-   @Override
-   public void copyTo(final TemplateOptions to) {
-      super.copyTo(to);
-      if (to instanceof AbiquoTemplateOptions) {
-         AbiquoTemplateOptions options = AbiquoTemplateOptions.class.cast(to);
-         options.overrideCores(overrideCores);
-         options.overrideRam(overrideRam);
-         options.vncPassword(vncPassword);
-      }
-   }
-
-   /**
-    * Override the number of cores set by the hardware profile.
-    * 
-    * @return The template options with the number of cores.
-    */
-   public AbiquoTemplateOptions overrideCores(final Integer overrideCores) {
-      this.overrideCores = overrideCores;
-      return this;
-   }
-
-   public Integer getOverrideCores() {
-      return overrideCores;
-   }
-
-   /**
-    * Override the amount of ram set by the hardware profile.
-    * 
-    * @return The template options with the amount of ram.
-    */
-   public AbiquoTemplateOptions overrideRam(final Integer overrideRam) {
-      this.overrideRam = overrideRam;
-      return this;
-   }
-
-   public Integer getOverrideRam() {
-      return overrideRam;
-   }
-
-   /**
-    * Set the VNC password to access the virtual machine.
-    * <p>
-    * By default virtual machines does not have VNC access password protected.
-    * 
-    * @return The template options with the VNC password.
-    */
-   public AbiquoTemplateOptions vncPassword(final String vncPassword) {
-      this.vncPassword = vncPassword;
-      return this;
-   }
-
-   public String getVncPassword() {
-      return vncPassword;
-   }
-
-   public static class Builder {
-      /**
-       * @see AbiquoTemplateOptions#overrideCores(int)
-       */
-      public static AbiquoTemplateOptions overrideCores(final Integer overrideCores) {
-         AbiquoTemplateOptions options = new AbiquoTemplateOptions();
-         return options.overrideCores(overrideCores);
-      }
-
-      /**
-       * @see AbiquoTemplateOptions#overrideRam(int)
-       */
-      public static AbiquoTemplateOptions overrideRam(final Integer overrideRam) {
-         AbiquoTemplateOptions options = new AbiquoTemplateOptions();
-         return options.overrideRam(overrideRam);
-      }
-
-      /**
-       * @see AbiquoTemplateOptions#vncPassword(String)
-       */
-      public static AbiquoTemplateOptions vncPassword(final String vncPassword) {
-         AbiquoTemplateOptions options = new AbiquoTemplateOptions();
-         return options.vncPassword(vncPassword);
-      }
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/AbiquoComputeServiceAdapter.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/AbiquoComputeServiceAdapter.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/AbiquoComputeServiceAdapter.java
deleted file mode 100644
index 616eaee..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/AbiquoComputeServiceAdapter.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.strategy;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.concat;
-import static com.google.common.collect.Iterables.contains;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Iterables.get;
-import static com.google.common.collect.Iterables.isEmpty;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.collect.Iterables.tryFind;
-
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import javax.annotation.Resource;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.compute.options.AbiquoTemplateOptions;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplateInVirtualDatacenter;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.network.ExternalNetwork;
-import org.jclouds.abiquo.domain.network.Ip;
-import org.jclouds.abiquo.domain.network.Network;
-import org.jclouds.abiquo.domain.network.PublicIp;
-import org.jclouds.abiquo.features.services.AdministrationService;
-import org.jclouds.abiquo.features.services.CloudService;
-import org.jclouds.abiquo.features.services.MonitoringService;
-import org.jclouds.abiquo.monitor.VirtualMachineMonitor;
-import org.jclouds.abiquo.predicates.IpPredicates;
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.ComputeServiceAdapter;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Processor;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.compute.reference.ComputeServiceConstants;
-import org.jclouds.compute.reference.ComputeServiceConstants.Timeouts;
-import org.jclouds.logging.Logger;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.cloud.VirtualMachineState;
-import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.common.collect.ImmutableList;
-import com.google.common.primitives.Ints;
-import com.google.inject.Inject;
-
-/**
- * Defines the connection between the {@link AbiquoApi} implementation and the
- * jclouds {@link ComputeService}.
- * 
- * 
- * @see CreateGroupBeforeCreatingNodes
- */
-@Singleton
-public class AbiquoComputeServiceAdapter
-      implements
-      ComputeServiceAdapter<VirtualMachine, VirtualMachineTemplateInVirtualDatacenter, VirtualMachineTemplate, VirtualDatacenter> {
-   @Resource
-   @Named(ComputeServiceConstants.COMPUTE_LOGGER)
-   protected Logger logger = Logger.NULL;
-
-   private final ApiContext<AbiquoApi> context;
-
-   private final AdministrationService adminService;
-
-   private final CloudService cloudService;
-
-   private final MonitoringService monitoringService;
-
-   private final FindCompatibleVirtualDatacenters compatibleVirtualDatacenters;
-
-   private final Supplier<Map<Integer, Datacenter>> regionMap;
-
-   private final Timeouts timeouts;
-
-   @Inject
-   public AbiquoComputeServiceAdapter(final ApiContext<AbiquoApi> context, final AdministrationService adminService,
-         final CloudService cloudService, final MonitoringService monitoringService,
-         final FindCompatibleVirtualDatacenters compatibleVirtualDatacenters,
-         @Memoized final Supplier<Map<Integer, Datacenter>> regionMap, Timeouts timeouts) {
-      this.context = checkNotNull(context, "context");
-      this.adminService = checkNotNull(adminService, "adminService");
-      this.cloudService = checkNotNull(cloudService, "cloudService");
-      this.monitoringService = checkNotNull(monitoringService, "monitoringService");
-      this.compatibleVirtualDatacenters = checkNotNull(compatibleVirtualDatacenters, "compatibleVirtualDatacenters");
-      this.regionMap = checkNotNull(regionMap, "regionMap");
-      this.timeouts = checkNotNull(timeouts, "timeouts");
-   }
-
-   @Override
-   public NodeAndInitialCredentials<VirtualMachine> createNodeWithGroupEncodedIntoName(final String group,
-         final String name, final Template template) {
-      checkArgument(template instanceof VirtualApplianceCachingTemplate,
-            "A VirtualApplianceCachingTemplate is required");
-      return createNodeWithGroupEncodedIntoName(name, VirtualApplianceCachingTemplate.class.cast(template));
-   }
-
-   protected NodeAndInitialCredentials<VirtualMachine> createNodeWithGroupEncodedIntoName(final String name,
-         final VirtualApplianceCachingTemplate template) {
-      AbiquoTemplateOptions options = template.getOptions().as(AbiquoTemplateOptions.class);
-      Enterprise enterprise = adminService.getCurrentEnterprise();
-
-      // Get the region where the template is available
-      Datacenter datacenter = regionMap.get().get(Integer.valueOf(template.getImage().getLocation().getId()));
-
-      // Load the template
-      VirtualMachineTemplate virtualMachineTemplate = enterprise.getTemplateInRepository(datacenter,
-            Integer.valueOf(template.getImage().getId()));
-
-      Integer overrideCores = options.getOverrideCores();
-      Integer overrideRam = options.getOverrideRam();
-
-      VirtualMachine vm = VirtualMachine.builder(context, template.getVirtualAppliance(), virtualMachineTemplate) //
-            .nameLabel(name) //
-            .cpu(overrideCores != null ? overrideCores : totalCores(template.getHardware())) //
-            .ram(overrideRam != null ? overrideRam : template.getHardware().getRam()) //
-            .password(options.getVncPassword()) // Can be null
-            .build();
-
-      vm.save();
-
-      configureNetworking(vm, template, datacenter, options);
-
-      // This is an async operation, but jclouds already waits until the node is
-      // RUNNING, so there is no need to block here
-      vm.deploy();
-
-      return new NodeAndInitialCredentials<VirtualMachine>(vm, vm.getId().toString(), null);
-   }
-
-   @Override
-   public Iterable<VirtualMachineTemplateInVirtualDatacenter> listHardwareProfiles() {
-      // In Abiquo, images are scoped to a region (physical datacenter), and
-      // hardware profiles are scoped to a zone (a virtual datacenter in the
-      // region, with a concrete virtualization technology)
-
-      return concat(transform(listImages(),
-            new Function<VirtualMachineTemplate, Iterable<VirtualMachineTemplateInVirtualDatacenter>>() {
-               @Override
-               public Iterable<VirtualMachineTemplateInVirtualDatacenter> apply(final VirtualMachineTemplate template) {
-                  Iterable<VirtualDatacenter> compatibleZones = compatibleVirtualDatacenters.execute(template);
-
-                  return transform(compatibleZones,
-                        new Function<VirtualDatacenter, VirtualMachineTemplateInVirtualDatacenter>() {
-                           @Override
-                           public VirtualMachineTemplateInVirtualDatacenter apply(final VirtualDatacenter vdc) {
-                              return new VirtualMachineTemplateInVirtualDatacenter(template, vdc);
-                           }
-                        });
-               }
-            }));
-   }
-
-   @Override
-   public Iterable<VirtualMachineTemplate> listImages() {
-      Enterprise enterprise = adminService.getCurrentEnterprise();
-      return enterprise.listTemplates();
-   }
-
-   @Override
-   public VirtualMachineTemplate getImage(final String id) {
-      return find(listImages(), new Predicate<VirtualMachineTemplate>() {
-         @Override
-         public boolean apply(VirtualMachineTemplate input) {
-            return input.getId().toString().equals(id);
-         }
-      }, null);
-   }
-
-   @Override
-   public Iterable<VirtualDatacenter> listLocations() {
-      return cloudService.listVirtualDatacenters();
-   }
-
-   @Override
-   public VirtualMachine getNode(final String id) {
-      return find(cloudService.listVirtualMachines(), vmId(id), null);
-   }
-
-   @Override
-   public void destroyNode(final String id) {
-      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
-      VirtualMachine vm = getNode(id);
-      vm.undeploy(true);
-      monitor.awaitCompletionUndeploy(timeouts.nodeTerminated, TimeUnit.MILLISECONDS, vm);
-      vm.delete();
-   }
-
-   @Override
-   public void rebootNode(final String id) {
-      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
-      VirtualMachine vm = getNode(id);
-      vm.reboot();
-      monitor.awaitState(timeouts.nodeRunning, TimeUnit.MILLISECONDS, VirtualMachineState.ON, vm);
-   }
-
-   @Override
-   public void resumeNode(final String id) {
-      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
-      VirtualMachine vm = getNode(id);
-      vm.changeState(VirtualMachineState.ON);
-      monitor.awaitState(timeouts.nodeRunning, TimeUnit.MILLISECONDS, VirtualMachineState.ON, vm);
-   }
-
-   @Override
-   public void suspendNode(final String id) {
-      VirtualMachineMonitor monitor = monitoringService.getVirtualMachineMonitor();
-      VirtualMachine vm = getNode(id);
-      vm.changeState(VirtualMachineState.PAUSED);
-      monitor.awaitState(timeouts.nodeSuspended, TimeUnit.MILLISECONDS, VirtualMachineState.PAUSED, vm);
-   }
-
-   @Override
-   public Iterable<VirtualMachine> listNodes() {
-      return cloudService.listVirtualMachines();
-   }
-
-   @Override
-   public Iterable<VirtualMachine> listNodesByIds(final Iterable<String> ids) {
-      return filter(listNodes(), new Predicate<VirtualMachine>() {
-
-         @Override
-         public boolean apply(VirtualMachine machine) {
-            return contains(ids, Integer.toString(machine.getId()));
-         }
-      });
-   }
-
-   /**
-    * Configures the networking for the created virtual machine.
-    * <ul>
-    * <li>If the template options have been configured with a set of network
-    * identifiers, jclouds will assign the virtual machine one IP address of
-    * each network.</li>
-    * <li>If no network ids have been defined, jclouds will try to assign a
-    * public IP address.</li>
-    * <li>If no public IP addresses are available in the user account, then an
-    * IP address in the virtual datacenter's default network will be assigned.</li>
-    * </ul>
-    */
-   private void configureNetworking(VirtualMachine vm, VirtualApplianceCachingTemplate template, Datacenter datacenter,
-         TemplateOptions options) {
-
-      if (!options.getNetworks().isEmpty()) {
-         ImmutableList.Builder<Ip<?, ?>> ips = ImmutableList.<Ip<?, ?>> builder();
-
-         Enterprise enterprise = adminService.getCurrentEnterprise();
-         Iterable<ExternalNetwork> externalNetworks = enterprise.listExternalNetworks(datacenter);
-
-         for (String networkId : options.getNetworks()) {
-            Network<? extends Ip<?, ?>> network = template.getVirtualDatacenter().getPrivateNetwork(
-                  Ints.tryParse(networkId));
-
-            if (network == null) {
-               // If the given network is not a private network, it should be an
-               // external one
-               final Integer id = Ints.tryParse(networkId);
-               network = find(externalNetworks, new Predicate<Network<?>>() {
-                  @Override
-                  public boolean apply(final Network<?> input) {
-                     return id.equals(input.getId());
-                  }
-               }, null);
-            }
-
-            checkArgument(network != null, "No network was found with id: %s", networkId);
-
-            Iterable<? extends Ip<?, ?>> unusedIps = network.listUnusedIps();
-            checkArgument(!isEmpty(unusedIps), "There are no available ips in network: %s", networkId);
-
-            // Get the first available ip
-            Ip<?, ?> availableIp = get(unusedIps, 0);
-            logger.debug(">> Found available ip: %s", availableIp);
-            ips.add(availableIp);
-         }
-
-         // Assign all ips to the virtual machine
-         vm.setNics(ips.build());
-      } else {
-         Optional<PublicIp> publicIp = tryFind(template.getVirtualDatacenter().listPurchasedPublicIps(),
-               IpPredicates.<PublicIp> notUsed());
-         if (publicIp.isPresent()) {
-            logger.debug(">> Found available public ip %s", publicIp.get().getIp());
-            vm.setNics(ImmutableList.<Ip<?, ?>> of(publicIp.get()));
-         } else {
-            logger.debug(">> No available public ip found. Using a private ip");
-         }
-      }
-   }
-
-   private static Predicate<VirtualMachine> vmId(final String id) {
-      return new Predicate<VirtualMachine>() {
-         @Override
-         public boolean apply(final VirtualMachine input) {
-            return Integer.valueOf(id).equals(input.getId());
-         }
-      };
-   }
-
-   private static int totalCores(final Hardware hardware) {
-      double cores = 0;
-      for (Processor processor : hardware.getProcessors()) {
-         cores += processor.getCores();
-      }
-      return Double.valueOf(cores).intValue();
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/CreateGroupBeforeCreatingNodes.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/CreateGroupBeforeCreatingNodes.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/CreateGroupBeforeCreatingNodes.java
deleted file mode 100644
index d77b021..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/CreateGroupBeforeCreatingNodes.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.strategy;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.tryFind;
-
-import java.util.Map;
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.Constants;
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.features.services.CloudService;
-import org.jclouds.compute.config.CustomizationResponse;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.functions.GroupNamingConvention;
-import org.jclouds.compute.strategy.CreateNodeWithGroupEncodedIntoName;
-import org.jclouds.compute.strategy.CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap;
-import org.jclouds.compute.strategy.ListNodesStrategy;
-import org.jclouds.compute.strategy.impl.CreateNodesWithGroupEncodedIntoNameThenAddToSet;
-import org.jclouds.rest.ApiContext;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.ListeningExecutorService;
-
-/**
- * Creates the group before concurrently creating the nodes, to avoid creating
- * more than one group with the same name.
- */
-@Singleton
-public class CreateGroupBeforeCreatingNodes extends CreateNodesWithGroupEncodedIntoNameThenAddToSet {
-
-   protected final ApiContext<AbiquoApi> context;
-
-   protected final CloudService cloudService;
-
-   @Inject
-   protected CreateGroupBeforeCreatingNodes(
-         CreateNodeWithGroupEncodedIntoName addNodeWithGroupStrategy,
-         ListNodesStrategy listNodesStrategy,
-         GroupNamingConvention.Factory namingConvention,
-         @Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor,
-         CustomizeNodeAndAddToGoodMapOrPutExceptionIntoBadMap.Factory customizeNodeAndAddToGoodMapOrPutExceptionIntoBadMapFactory,
-         ApiContext<AbiquoApi> context, CloudService cloudService) {
-      super(addNodeWithGroupStrategy, listNodesStrategy, namingConvention, userExecutor,
-            customizeNodeAndAddToGoodMapOrPutExceptionIntoBadMapFactory);
-      this.context = checkNotNull(context, "context must not be null");
-      this.cloudService = checkNotNull(cloudService, "cloudService must not be null");
-   }
-
-   @Override
-   public Map<?, ListenableFuture<Void>> execute(final String group, int count, Template template,
-         Set<NodeMetadata> goodNodes, Map<NodeMetadata, Exception> badNodes,
-         Multimap<NodeMetadata, CustomizationResponse> customizationResponses) {
-      // Get the zone where the template will be deployed
-      Integer locationId = Integer.valueOf(template.getHardware().getLocation().getId());
-      VirtualDatacenter vdc = cloudService.getVirtualDatacenter(locationId);
-
-      // Check if it already exists a group with the given name
-      Iterable<VirtualAppliance> existingGroups = vdc.listVirtualAppliances();
-      Optional<VirtualAppliance> vapp = tryFind(existingGroups, new Predicate<VirtualAppliance>() {
-         @Override
-         public boolean apply(VirtualAppliance input) {
-            return input.getName().equals(group);
-         }
-      });
-
-      // Create the group if still does not exist
-      VirtualAppliance newVapp = null;
-      if (!vapp.isPresent()) {
-         logger.debug(">> Creating group %s", group);
-         newVapp = VirtualAppliance.builder(context, vdc).name(group).build();
-         newVapp.save();
-         logger.debug("<< group(%s) created", newVapp.getId());
-      } else {
-         logger.debug(">> Using existing group(%s)", vapp.get().getId());
-      }
-
-      VirtualApplianceCachingTemplate abiquoTemplate = VirtualApplianceCachingTemplate //
-            .from(template) //
-            .withVirtualDatacenter(vdc) //
-            .withVirtualAppliance(vapp.or(newVapp)) //
-            .build();
-
-      return super.execute(group, count, abiquoTemplate, goodNodes, badNodes, customizationResponses);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/FindCompatibleVirtualDatacenters.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/FindCompatibleVirtualDatacenters.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/FindCompatibleVirtualDatacenters.java
deleted file mode 100644
index 10896b9..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/FindCompatibleVirtualDatacenters.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.strategy;
-
-import org.jclouds.abiquo.compute.strategy.internal.FindCompatibleVirtualDatacentersForImageAndConversions;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-
-import com.google.inject.ImplementedBy;
-
-/**
- * Finds all virtual datacenters where the given {@link VirtualMachineTemplate}
- * can be deployed.
- */
-@ImplementedBy(FindCompatibleVirtualDatacentersForImageAndConversions.class)
-public interface FindCompatibleVirtualDatacenters {
-   Iterable<VirtualDatacenter> execute(VirtualMachineTemplate template);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/VirtualApplianceCachingTemplate.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/VirtualApplianceCachingTemplate.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/VirtualApplianceCachingTemplate.java
deleted file mode 100644
index 1d05756..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/VirtualApplianceCachingTemplate.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.strategy;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.domain.Location;
-
-import com.google.common.base.Objects;
-
-/**
- * A {@link Template} implementation that caches the {@link VirtualAppliance}
- * and the {@link VirtualDatacenter} where the nodes will be deployed.
- * <p>
- * When deploying multiple nodes at the same time, all go to the same virtual
- * appliance and virtual datacenter. Having both cached in the template saves a
- * couple extra api calls for each deployed node.
- * <p>
- * This class is not public as it is intended to be used internally.
- * 
- * 
- * @see CreateGroupBeforeCreatingNodes
- * @see AbiquoComputeServiceAdapter
- */
-class VirtualApplianceCachingTemplate implements Template {
-
-   private final Template delegate;
-   private final VirtualDatacenter virtualDatacenter;
-   private final VirtualAppliance virtualAppliance;
-
-   private VirtualApplianceCachingTemplate(Template delegate, VirtualDatacenter virtualDatacenter,
-         VirtualAppliance virtualAppliance) {
-      this.delegate = checkNotNull(delegate, "delegate");
-      this.virtualDatacenter = checkNotNull(virtualDatacenter, "virtualDatacenter");
-      this.virtualAppliance = checkNotNull(virtualAppliance, "virtualAppliance");
-   }
-
-   public VirtualDatacenter getVirtualDatacenter() {
-      return virtualDatacenter;
-   }
-
-   public VirtualAppliance getVirtualAppliance() {
-      return virtualAppliance;
-   }
-
-   // Delegate methods
-
-   @Override
-   public Image getImage() {
-      return delegate.getImage();
-   }
-
-   @Override
-   public Hardware getHardware() {
-      return delegate.getHardware();
-   }
-
-   @Override
-   public Location getLocation() {
-      return delegate.getLocation();
-   }
-
-   @Override
-   public TemplateOptions getOptions() {
-      return delegate.getOptions();
-   }
-
-   @Override
-   public VirtualApplianceCachingTemplate clone() {
-      return new VirtualApplianceCachingTemplate(delegate.clone(), virtualDatacenter, virtualAppliance);
-   }
-
-   @Override
-   public String toString() {
-      return delegate.toString();
-   }
-
-   @Override
-   public boolean equals(Object o) {
-      if (this == o) {
-         return true;
-      }
-      if (o == null || getClass() != o.getClass()) {
-         return false;
-      }
-      VirtualApplianceCachingTemplate that = VirtualApplianceCachingTemplate.class.cast(o);
-      return delegate.equals(that) && virtualAppliance.getId().equals(that.virtualAppliance.getId())
-            && virtualDatacenter.getId().equals(that.virtualDatacenter.getId());
-   }
-
-   @Override
-   public int hashCode() {
-      return Objects.hashCode(getImage(), getHardware(), getLocation(), getOptions(), virtualDatacenter,
-            virtualAppliance);
-   }
-
-   static Builder from(Template template) {
-      return new Builder(template);
-   }
-
-   static class Builder {
-      private Template template;
-      private VirtualDatacenter virtualDatacenter;
-      private VirtualAppliance virtualAppliance;
-
-      public Builder(Template template) {
-         this.template = template;
-      }
-
-      public Builder withVirtualDatacenter(VirtualDatacenter virtualDatacenter) {
-         this.virtualDatacenter = virtualDatacenter;
-         return this;
-      }
-
-      public Builder withVirtualAppliance(VirtualAppliance virtualAppliance) {
-         this.virtualAppliance = virtualAppliance;
-         return this;
-      }
-
-      public VirtualApplianceCachingTemplate build() {
-         return new VirtualApplianceCachingTemplate(template, virtualDatacenter, virtualAppliance);
-      }
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/internal/FindCompatibleVirtualDatacentersForImageAndConversions.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/internal/FindCompatibleVirtualDatacentersForImageAndConversions.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/internal/FindCompatibleVirtualDatacentersForImageAndConversions.java
deleted file mode 100644
index 656b711..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/internal/FindCompatibleVirtualDatacentersForImageAndConversions.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.strategy.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.filter;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-import static org.jclouds.abiquo.predicates.VirtualDatacenterPredicates.compatibleWithTemplateOrConversions;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.compute.strategy.FindCompatibleVirtualDatacenters;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.features.services.CloudService;
-import org.jclouds.abiquo.predicates.VirtualDatacenterPredicates;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-
-/**
- * Default implementation for the {@link FindCompatibleVirtualDatacenters}
- * strategy.
- * <p>
- * This strategy assumes that the datacenter will have different hypervisor
- * technologies, and images will have conversions to each of them.
- */
-@Singleton
-public class FindCompatibleVirtualDatacentersForImageAndConversions implements FindCompatibleVirtualDatacenters {
-   private final ApiContext<AbiquoApi> context;
-
-   private final CloudService cloudService;
-
-   @Inject
-   public FindCompatibleVirtualDatacentersForImageAndConversions(final ApiContext<AbiquoApi> context,
-         final CloudService cloudService) {
-      this.context = checkNotNull(context, "context");
-      this.cloudService = checkNotNull(cloudService, "cloudService");
-   }
-
-   @Override
-   public Iterable<VirtualDatacenter> execute(final VirtualMachineTemplate template) {
-      // Build the transport object with the available information to avoid
-      // making an unnecessary call to the target API (we only need the id of
-      // the datacenter, and it is present in the link).
-      DatacenterDto datacenterDto = new DatacenterDto();
-      datacenterDto.setId(template.unwrap().getIdFromLink(ParentLinkName.DATACENTER_REPOSITORY));
-      Datacenter datacenter = wrap(context, Datacenter.class, datacenterDto);
-
-      Iterable<VirtualDatacenter> vdcs = filter(cloudService.listVirtualDatacenters(),
-            VirtualDatacenterPredicates.datacenter(datacenter));
-
-      return filter(vdcs, compatibleWithTemplateOrConversions(template));
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/internal/FindCompatibleVirtualDatacentersForImageBaseFormat.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/internal/FindCompatibleVirtualDatacentersForImageBaseFormat.java b/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/internal/FindCompatibleVirtualDatacentersForImageBaseFormat.java
deleted file mode 100644
index fa3e743..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/compute/strategy/internal/FindCompatibleVirtualDatacentersForImageBaseFormat.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.compute.strategy.internal;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.collect.Iterables.filter;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.compute.strategy.FindCompatibleVirtualDatacenters;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachineTemplate;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.features.services.CloudService;
-import org.jclouds.abiquo.predicates.VirtualDatacenterPredicates;
-import org.jclouds.abiquo.reference.rest.ParentLinkName;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.google.common.base.Predicate;
-
-/**
- * Implementation for the {@link FindCompatibleVirtualDatacenters} strategy to
- * be used in homogeneous datacenters.
- * <p>
- * For providers that only have one hypervisor technology in the physical
- * datacenter and use compatible images, there is no need to check if the images
- * have conversions to other formats.
- * <p>
- * This strategy will only consider the base disk format of the image.
- */
-@Singleton
-public class FindCompatibleVirtualDatacentersForImageBaseFormat implements FindCompatibleVirtualDatacenters {
-   private final ApiContext<AbiquoApi> context;
-
-   private final CloudService cloudService;
-
-   @Inject
-   public FindCompatibleVirtualDatacentersForImageBaseFormat(final ApiContext<AbiquoApi> context,
-         final CloudService cloudService) {
-      this.context = checkNotNull(context, "context");
-      this.cloudService = checkNotNull(cloudService, "cloudService");
-   }
-
-   @Override
-   public Iterable<VirtualDatacenter> execute(final VirtualMachineTemplate template) {
-      // Build the transport object with the available information to avoid
-      // making an unnecessary call to the target API (we only need the id of
-      // the datacenter, and it is present in the link).
-      DatacenterDto datacenterDto = new DatacenterDto();
-      datacenterDto.setId(template.unwrap().getIdFromLink(ParentLinkName.DATACENTER_REPOSITORY));
-      Datacenter datacenter = wrap(context, Datacenter.class, datacenterDto);
-
-      Iterable<VirtualDatacenter> vdcs = filter(cloudService.listVirtualDatacenters(),
-            VirtualDatacenterPredicates.datacenter(datacenter));
-
-      return filter(vdcs, new Predicate<VirtualDatacenter>() {
-         @Override
-         public boolean apply(final VirtualDatacenter vdc) {
-            HypervisorType type = vdc.getHypervisorType();
-            return type.isCompatible(template.getDiskFormatType());
-         }
-      });
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoHttpApiModule.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoHttpApiModule.java b/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoHttpApiModule.java
index f64f09b..583e0db 100644
--- a/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoHttpApiModule.java
+++ b/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoHttpApiModule.java
@@ -16,37 +16,14 @@
  */
 package org.jclouds.abiquo.config;
 
-import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
-import static org.jclouds.abiquo.domain.DomainWrapper.wrap;
-
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.inject.Named;
-
 import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.enterprise.User;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
 import org.jclouds.abiquo.handlers.AbiquoErrorHandler;
-import org.jclouds.collect.Memoized;
 import org.jclouds.http.HttpErrorHandler;
 import org.jclouds.http.annotation.ClientError;
 import org.jclouds.http.annotation.Redirection;
 import org.jclouds.http.annotation.ServerError;
-import org.jclouds.rest.ApiContext;
-import org.jclouds.rest.AuthorizationException;
 import org.jclouds.rest.ConfiguresHttpApi;
 import org.jclouds.rest.config.HttpApiModule;
-import org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
-import com.google.common.collect.Maps;
-import com.google.inject.Provides;
-import com.google.inject.Singleton;
 
 /**
  * Configures the Abiquo connection.
@@ -60,61 +37,4 @@ public class AbiquoHttpApiModule extends HttpApiModule<AbiquoApi> {
       bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(AbiquoErrorHandler.class);
       bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(AbiquoErrorHandler.class);
    }
-
-   @Provides
-   @Singleton
-   @Memoized
-   public Supplier<User> getCurrentUser(final AtomicReference<AuthorizationException> authException,
-         @Named(PROPERTY_SESSION_INTERVAL) final long seconds, final ApiContext<AbiquoApi> context) {
-      return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException, new Supplier<User>() {
-         @Override
-         public User get() {
-            return wrap(context, User.class, context.getApi().getAdminApi().getCurrentUser());
-         }
-      }, seconds, TimeUnit.SECONDS);
-   }
-
-   @Provides
-   @Singleton
-   @Memoized
-   public Supplier<Enterprise> getCurrentEnterprise(final AtomicReference<AuthorizationException> authException,
-         @Named(PROPERTY_SESSION_INTERVAL) final long seconds, @Memoized final Supplier<User> currentUser) {
-      return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException,
-            new Supplier<Enterprise>() {
-               @Override
-               public Enterprise get() {
-                  return currentUser.get().getEnterprise();
-               }
-            }, seconds, TimeUnit.SECONDS);
-   }
-
-   @Provides
-   @Singleton
-   @Memoized
-   public Supplier<Map<Integer, Datacenter>> getAvailableRegionsIndexedById(
-         final AtomicReference<AuthorizationException> authException,
-         @Named(PROPERTY_SESSION_INTERVAL) final long seconds, @Memoized final Supplier<Enterprise> currentEnterprise) {
-      Supplier<Map<Integer, Datacenter>> availableRegionsMapSupplier = Suppliers.compose(
-            new Function<Iterable<Datacenter>, Map<Integer, Datacenter>>() {
-               @Override
-               public Map<Integer, Datacenter> apply(final Iterable<Datacenter> datacenters) {
-                  // Index available regions by id
-                  return Maps.uniqueIndex(datacenters, new Function<Datacenter, Integer>() {
-                     @Override
-                     public Integer apply(final Datacenter input) {
-                        return input.getId();
-                     }
-                  });
-               }
-            }, new Supplier<Iterable<Datacenter>>() {
-               @Override
-               public Iterable<Datacenter> get() {
-                  // Get the list of regions available for the user's tenant
-                  return currentEnterprise.get().listAllowedDatacenters();
-               }
-            });
-
-      return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException,
-            availableRegionsMapSupplier, seconds, TimeUnit.SECONDS);
-   }
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoProperties.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoProperties.java b/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoProperties.java
index 35b39c1..44dff3d 100644
--- a/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoProperties.java
+++ b/abiquo/src/main/java/org/jclouds/abiquo/config/AbiquoProperties.java
@@ -28,15 +28,6 @@ public final class AbiquoProperties {
    public static final String CREDENTIAL_TYPE = "abiquo.credential-type";
 
    /**
-    * The delay (in ms) used between requests by the
-    * <code>MonitoringService<code>
-    * when monitoring asynchronous task state.
-    * <p>
-    * Default value: 5000 ms
-    */
-   public static final String ASYNC_TASK_MONITOR_DELAY = "abiquo.monitor-delay";
-
-   /**
     * The name of the Abiquo logger.
     */
    public static final String ABIQUO_LOGGER = "jclouds.abiquo";

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWithLimitsWrapper.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWithLimitsWrapper.java b/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWithLimitsWrapper.java
deleted file mode 100644
index b0172ed..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/domain/DomainWithLimitsWrapper.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.domain;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.rest.ApiContext;
-
-import com.abiquo.model.transport.SingleResourceWithLimitsDto;
-
-/**
- * This class is used to decorate transport objects that have limits with high
- * level functionality.
- */
-public abstract class DomainWithLimitsWrapper<T extends SingleResourceWithLimitsDto> extends DomainWrapper<T> {
-
-   protected DomainWithLimitsWrapper(final ApiContext<AbiquoApi> context, final T target) {
-      super(context, target);
-   }
-
-   // Delegate methods
-
-   public int getCpuCountHardLimit() {
-      return target.getCpuCountHardLimit();
-   }
-
-   public int getCpuCountSoftLimit() {
-      return target.getCpuCountSoftLimit();
-   }
-
-   public long getHdHardLimitInBytes() {
-      // Due to a bug in Abiquo, the hard drive limits are interpreted as bytes,
-      // though the name of the method makes reference to Mb      
-      return target.getHdHardLimitInMb();
-   }
-
-   public long getHdSoftLimitInBytes() {
-      // Due to a bug in Abiquo, the hard drive limits are interpreted as bytes,
-      // though the name of the method makes reference to Mb
-      return target.getHdSoftLimitInMb();
-   }
-
-   public long getPublicIpsHard() {
-      return target.getPublicIpsHard();
-   }
-
-   public long getPublicIpsSoft() {
-      return target.getPublicIpsSoft();
-   }
-
-   public int getRamHardLimitInMb() {
-      return target.getRamHardLimitInMb();
-   }
-
-   public int getRamSoftLimitInMb() {
-      return target.getRamSoftLimitInMb();
-   }
-
-   public long getStorageHard() {
-      return target.getStorageHard();
-   }
-
-   public long getStorageSoft() {
-      return target.getStorageSoft();
-   }
-
-   public long getVlansHard() {
-      return target.getVlansHard();
-   }
-
-   public long getVlansSoft() {
-      return target.getVlansSoft();
-   }
-
-   public void setCpuCountHardLimit(final int cpuCountHardLimit) {
-      target.setCpuCountHardLimit(cpuCountHardLimit);
-   }
-
-   public void setCpuCountLimits(final int softLimit, final int hardLimit) {
-      target.setCpuCountLimits(softLimit, hardLimit);
-   }
-
-   public void setCpuCountSoftLimit(final int cpuCountSoftLimit) {
-      target.setCpuCountSoftLimit(cpuCountSoftLimit);
-   }
-
-   public void setHdHardLimitInBytes(final long hdHardLimit) {
-      // Due to a bug in Abiquo, the hard drive limits are interpreted as bytes,
-      // though the name of the method makes reference to Mb      
-      target.setHdHardLimitInMb(hdHardLimit);
-   }
-
-   public void setHdLimitsInBytes(final long softLimit, final long hardLimit) {
-      // Due to a bug in Abiquo, the hard drive limits are interpreted as bytes,
-      // though the name of the method makes reference to Mb      
-      target.setHdLimitsInMb(softLimit, hardLimit);
-   }
-
-   public void setHdSoftLimitInBytes(final long hdSoftLimit) {
-      // Due to a bug in Abiquo, the hard drive limits are interpreted as bytes,
-      // though the name of the method makes reference to Mb
-      target.setHdSoftLimitInMb(hdSoftLimit);
-   }
-
-   public void setPublicIPLimits(final long softLimit, final long hardLimit) {
-      target.setPublicIPLimits(softLimit, hardLimit);
-   }
-
-   public void setPublicIpsHard(final long publicIpsHard) {
-      target.setPublicIpsHard(publicIpsHard);
-   }
-
-   public void setPublicIpsSoft(final long publicIpsSoft) {
-      target.setPublicIpsSoft(publicIpsSoft);
-   }
-
-   public void setRamHardLimitInMb(final int ramHardLimitInMb) {
-      target.setRamHardLimitInMb(ramHardLimitInMb);
-   }
-
-   public void setRamLimitsInMb(final int softLimit, final int hardLimit) {
-      target.setRamLimitsInMb(softLimit, hardLimit);
-   }
-
-   public void setRamSoftLimitInMb(final int ramSoftLimitInMb) {
-      target.setRamSoftLimitInMb(ramSoftLimitInMb);
-   }
-
-   public void setStorageHard(final long storageHard) {
-      target.setStorageHard(storageHard);
-   }
-
-   public void setStorageLimits(final long softLimit, final long hardLimit) {
-      target.setStorageLimits(softLimit, hardLimit);
-   }
-
-   public void setStorageSoft(final long storageSoft) {
-      target.setStorageSoft(storageSoft);
-   }
-
-   public void setVlansHard(final long vlansHard) {
-      target.setVlansHard(vlansHard);
-   }
-
-   public void setVlansLimits(final long softLimit, final long hardLimit) {
-      target.setVlansLimits(softLimit, hardLimit);
-   }
-
-   public void setVlansSoft(final long vlansSoft) {
-      target.setVlansSoft(vlansSoft);
-   }
-}


[05/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseApiTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseApiTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseApiTest.java
deleted file mode 100644
index dd65b4d..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/EnterpriseApiTest.java
+++ /dev/null
@@ -1,603 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.jclouds.abiquo.domain.DomainUtils.withHeader;
-import static org.jclouds.reflect.Reflection2.method;
-
-import java.io.IOException;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.domain.EnterpriseResources;
-import org.jclouds.abiquo.domain.InfrastructureResources;
-import org.jclouds.fallbacks.MapHttp4xxCodesToExceptions;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.http.functions.ReleasePayloadAndReturn;
-import org.jclouds.reflect.Invocation;
-import org.jclouds.rest.internal.GeneratedHttpRequest;
-import org.testng.annotations.Test;
-
-import com.abiquo.am.model.TemplatesStateDto;
-import com.abiquo.server.core.appslibrary.DatacenterRepositoryDto;
-import com.abiquo.server.core.appslibrary.TemplateDefinitionListDto;
-import com.abiquo.server.core.appslibrary.TemplateDefinitionListsDto;
-import com.abiquo.server.core.cloud.VirtualAppliancesDto;
-import com.abiquo.server.core.cloud.VirtualDatacentersDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.DatacenterLimitsDto;
-import com.abiquo.server.core.enterprise.DatacentersLimitsDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.enterprise.EnterprisePropertiesDto;
-import com.abiquo.server.core.enterprise.UserDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.DatacentersDto;
-import com.abiquo.server.core.infrastructure.MachinesDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworksDto;
-import com.google.common.collect.ImmutableList;
-import com.google.common.reflect.Invokable;
-
-/**
- * Tests annotation parsing of {@code ConfigApi}
- */
-@Test(groups = "unit", testName = "EnterpriseApiTest")
-public class EnterpriseApiTest extends BaseAbiquoApiTest<EnterpriseApi> {
-   /*********************** Enterprise ********************** */
-
-   public void testCreateEnterprise() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "createEnterprise", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePost())));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/enterprises HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + EnterpriseDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(EnterpriseResources.enterprisePostPayload()), EnterpriseDto.class,
-            EnterpriseDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetEnterprise() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "getEnterprise", Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + EnterpriseDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateEnterprise() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "updateEnterprise", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/enterprises/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + EnterpriseDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(EnterpriseResources.enterprisePutPayload()), EnterpriseDto.class,
-            EnterpriseDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteEnterprise() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "deleteEnterprise", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/enterprises/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListAllowedDatacenters() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "listAllowedDatacenters", Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/datacenters?idEnterprise=1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacentersDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListVirtualDatacentersFromEnterprise() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "listVirtualDatacenters", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/action/virtualdatacenters HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualDatacentersDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Enterprise Properties ********************** */
-
-   public void testGetEnterpriseProperties() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "getEnterpriseProperties", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1/properties HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + EnterprisePropertiesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, MapHttp4xxCodesToExceptions.class);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateEnterpriseProperties() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "updateEnterpriseProperties", EnterprisePropertiesDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePropertiesPut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/enterprises/1/properties HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + EnterprisePropertiesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(EnterpriseResources.enterprisePropertiesPutPayload()),
-            EnterprisePropertiesDto.class, EnterprisePropertiesDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Enterprise Limits ********************** */
-
-   public void testCreateLimits() throws SecurityException, NoSuchMethodException, IOException {
-      EnterpriseDto enterprise = EnterpriseResources.enterprisePut();
-      DatacenterDto datacenter = InfrastructureResources.datacenterPut();
-      DatacenterLimitsDto limits = EnterpriseResources.datacenterLimitsPost();
-
-      Invokable<?, ?> method = method(EnterpriseApi.class, "createLimits", EnterpriseDto.class, DatacenterDto.class,
-            DatacenterLimitsDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(enterprise, datacenter, limits)));
-
-      String limitsUri = enterprise.searchLink("limits").getHref();
-      String requestURI = String.format("POST %s?datacenter=%d HTTP/1.1", limitsUri, datacenter.getId());
-
-      assertRequestLineEquals(request, requestURI);
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacenterLimitsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(EnterpriseResources.datacenterLimitsPostPayload()),
-            DatacenterLimitsDto.class, DatacenterLimitsDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetLimits() throws SecurityException, NoSuchMethodException, IOException {
-      EnterpriseDto enterprise = EnterpriseResources.enterprisePut();
-      DatacenterDto datacenter = InfrastructureResources.datacenterPut();
-
-      Invokable<?, ?> method = method(EnterpriseApi.class, "getLimits", EnterpriseDto.class, DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(enterprise, datacenter)));
-
-      String limitsUri = enterprise.searchLink("limits").getHref();
-      String requestURI = String.format("GET %s?datacenter=%d HTTP/1.1", limitsUri, datacenter.getId());
-
-      assertRequestLineEquals(request, requestURI);
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacentersLimitsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateLimits() throws SecurityException, NoSuchMethodException, IOException {
-      EnterpriseDto enterprise = EnterpriseResources.enterprisePut();
-
-      Invokable<?, ?> method = method(EnterpriseApi.class, "updateLimits", DatacenterLimitsDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.datacenterLimitsPut(enterprise))));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/enterprises/1/limits/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacenterLimitsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(EnterpriseResources.datacenterLimitsPutPayload(enterprise)),
-            DatacenterLimitsDto.class, DatacenterLimitsDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteLimits() throws SecurityException, NoSuchMethodException {
-      EnterpriseDto enterprise = EnterpriseResources.enterprisePut();
-
-      Invokable<?, ?> method = method(EnterpriseApi.class, "deleteLimits", DatacenterLimitsDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.datacenterLimitsPut(enterprise))));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/enterprises/1/limits/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListLimitsEnterprise() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "listLimits", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1/limits HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacentersLimitsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** User ***********************/
-
-   public void testGetUser() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "getUser", EnterpriseDto.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut(), 1)));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1/users/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + UserDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testCreateUser() throws SecurityException, NoSuchMethodException, IOException {
-      EnterpriseDto enterprise = EnterpriseResources.enterprisePut();
-      UserDto user = EnterpriseResources.userPost();
-
-      Invokable<?, ?> method = method(EnterpriseApi.class, "createUser", EnterpriseDto.class, UserDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(enterprise, user)));
-
-      assertRequestLineEquals(request, "POST http://localhost/api/admin/enterprises/1/users HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + UserDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(EnterpriseResources.userPostPayload()), UserDto.class,
-            UserDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateUser() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "updateUser", UserDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.userPut())));
-
-      assertRequestLineEquals(request, "PUT http://localhost/api/admin/enterprises/1/users/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + UserDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(EnterpriseResources.userPutPayload()), UserDto.class,
-            UserDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteUser() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "deleteUser", UserDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.userPut())));
-
-      assertRequestLineEquals(request, "DELETE http://localhost/api/admin/enterprises/1/users/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListVirtualMachinesByUser() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "listVirtualMachines", UserDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.userPut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/users/1/action/virtualmachines HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualMachinesWithNodeExtendedDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Datacenter Repository ********************** */
-
-   public void testGetDatacenterRepository() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "getDatacenterRepository", EnterpriseDto.class,
-            Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            EnterpriseResources.enterprisePut(), InfrastructureResources.datacenterPut().getId())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1/datacenterrepositories/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + DatacenterRepositoryDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testRefreshTemplateRepository() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "refreshTemplateRepository", Integer.class, Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(
-            EnterpriseResources.enterprisePut().getId(), InfrastructureResources.datacenterPut().getId())));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/admin/enterprises/1/datacenterrepositories/1/actions/refresh HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** External Network ********************** */
-
-   public void testListExternalNetworks() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "listExternalNetworks", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1/action/externalnetworks HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VLANNetworksDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Cloud ********************** */
-
-   public void testListVirtualMachines() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "listVirtualMachines", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1/action/virtualmachines HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualMachinesWithNodeExtendedDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testListVirtualAppliances() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "listVirtualAppliances", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1/action/virtualappliances HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + VirtualAppliancesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Machine ********************** */
-
-   public void testListReservedMachines() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "listReservedMachines", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request, "GET http://localhost/api/admin/enterprises/1/reservedmachines HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + MachinesDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   /*********************** Template definition list ***********************/
-
-   public void testListTemplateDefinitionLists() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "listTemplateDefinitionLists", EnterpriseDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut())));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TemplateDefinitionListsDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testCreateTemplateDefinitionList() throws SecurityException, NoSuchMethodException, IOException {
-      EnterpriseDto enterprise = EnterpriseResources.enterprisePut();
-      TemplateDefinitionListDto template = EnterpriseResources.templateListPost();
-
-      Invokable<?, ?> method = method(EnterpriseApi.class, "createTemplateDefinitionList", EnterpriseDto.class,
-            TemplateDefinitionListDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(enterprise, template)));
-
-      assertRequestLineEquals(request,
-            "POST http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TemplateDefinitionListDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(EnterpriseResources.templateListPostPayload()),
-            TemplateDefinitionListDto.class, TemplateDefinitionListDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testUpdateTemplateDefinitionList() throws SecurityException, NoSuchMethodException, IOException {
-      TemplateDefinitionListDto template = EnterpriseResources.templateListPut();
-
-      Invokable<?, ?> method = method(EnterpriseApi.class, "updateTemplateDefinitionList",
-            TemplateDefinitionListDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method, ImmutableList.<Object> of(template)));
-
-      assertRequestLineEquals(request,
-            "PUT http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TemplateDefinitionListDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, withHeader(EnterpriseResources.templateListPutPayload()),
-            TemplateDefinitionListDto.class, TemplateDefinitionListDto.BASE_MEDIA_TYPE, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testDeleteTemplateDefinitionList() throws SecurityException, NoSuchMethodException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "deleteTemplateDefinitionList",
-            TemplateDefinitionListDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.templateListPut())));
-
-      assertRequestLineEquals(request,
-            "DELETE http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ReleasePayloadAndReturn.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-
-   public void testGetTemplateDefinitionList() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "getTemplateDefinitionList", EnterpriseDto.class,
-            Integer.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.enterprisePut(), 1)));
-
-      assertRequestLineEquals(request,
-            "GET http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists/1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TemplateDefinitionListDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, NullOnNotFoundOr404.class);
-
-      checkFilters(request);
-   }
-
-   public void testListTemplateListStatus() throws SecurityException, NoSuchMethodException, IOException {
-      Invokable<?, ?> method = method(EnterpriseApi.class, "listTemplateListStatus", TemplateDefinitionListDto.class,
-            DatacenterDto.class);
-      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
-            ImmutableList.<Object> of(EnterpriseResources.templateListPut(), InfrastructureResources.datacenterPut())));
-
-      assertRequestLineEquals(
-            request,
-            "GET http://localhost/api/admin/enterprises/1/appslib/templateDefinitionLists/1/actions/repositoryStatus?datacenterId=1 HTTP/1.1");
-      assertNonPayloadHeadersEqual(request, "Accept: " + TemplatesStateDto.BASE_MEDIA_TYPE + "\n");
-      assertPayloadEquals(request, null, null, false);
-
-      assertResponseParserClassEquals(method, request, ParseXMLWithJAXB.class);
-      assertSaxResponseParserClassEquals(method, null);
-      assertFallbackClassEquals(method, null);
-
-      checkFilters(request);
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/EventApiExpectTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/EventApiExpectTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/EventApiExpectTest.java
deleted file mode 100644
index dc66a50..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/EventApiExpectTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.event.options.EventOptions;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.abiquo.server.core.event.EventDto;
-import com.abiquo.server.core.event.EventsDto;
-
-/**
- * Expect tests for the {@link EventApi}.
- */
-@Test(groups = "unit", testName = "EventApiExpectTest")
-public class EventApiExpectTest extends BaseAbiquoApiExpectTest<EventApi> {
-
-   public void testListEventsWithPagination() {
-      EventApi api = requestSendsResponse(
-            HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost/api/events")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(EventsDto.MEDIA_TYPE)) //
-                  .addQueryParam("limit", "1") //
-                  .addQueryParam("has", "text") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/events-page.xml", normalize(EventsDto.MEDIA_TYPE))) //
-                  .build());
-
-      EventOptions options = EventOptions.builder().limit(1).has("text").build();
-      PaginatedCollection<EventDto, EventsDto> result = api.listEvents(options);
-
-      assertEquals(result.size(), 2);
-      assertEquals(result.getTotalSize().intValue(), 4);
-      assertEquals(result.get(0).getId().intValue(), 109);
-      assertNotNull(result.searchLink("first"));
-      assertNotNull(result.searchLink("last"));
-   }
-
-   public void testListEventsReturns2xx() {
-      EventApi api = requestsSendResponses(
-            HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost/api/events")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(EventsDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/events-page.xml", normalize(EventsDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost/api/events")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(EventsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "1") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/events-lastpage.xml",
-                              normalize(EventsDto.MEDIA_TYPE))) //
-                  .build());
-
-      PagedIterable<EventDto> result = api.listEvents();
-      List<EventDto> all = result.concat().toList();
-
-      assertEquals(all.size(), 4);
-      assertEquals(all.get(0).getId().intValue(), 109);
-      assertEquals(all.get(1).getId().intValue(), 108);
-      assertEquals(all.get(2).getId().intValue(), 110);
-      assertEquals(all.get(3).getId().intValue(), 111);
-   }
-
-   @Override
-   protected EventApi clientFrom(AbiquoApi api) {
-      return api.getEventApi();
-   }
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureApiExpectTest.java
----------------------------------------------------------------------
diff --git a/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureApiExpectTest.java b/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureApiExpectTest.java
deleted file mode 100644
index ab8e7ee..0000000
--- a/abiquo/src/test/java/org/jclouds/abiquo/features/InfrastructureApiExpectTest.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertNull;
-
-import java.net.URI;
-import java.util.List;
-
-import org.jclouds.abiquo.AbiquoApi;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.HttpRequest;
-import org.jclouds.http.HttpResponse;
-import org.testng.annotations.Test;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.network.ExternalIpDto;
-import com.abiquo.server.core.infrastructure.network.ExternalIpsDto;
-import com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto;
-import com.abiquo.server.core.infrastructure.network.NetworkServiceTypesDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpsDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpsDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-
-/**
- * Expect tests for the {@link InfrastructureApi} class.
- */
-@Test(groups = "unit", testName = "InfrastructureApiExpectTest")
-public class InfrastructureApiExpectTest extends BaseAbiquoApiExpectTest<InfrastructureApi> {
-
-   public void testListNetworkServiceTypesReturns2xx() {
-      InfrastructureApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/datacenters/1/networkservicetypes")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(NetworkServiceTypesDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/nst-list.xml",
-                              normalize(NetworkServiceTypesDto.MEDIA_TYPE))) //
-                  .build());
-
-      DatacenterDto datacenter = new DatacenterDto();
-      datacenter.addLink(new RESTLink("networkservicetypes",
-            "http://localhost/api/admin/datacenters/1/networkservicetypes"));
-
-      NetworkServiceTypesDto nsts = api.listNetworkServiceTypes(datacenter);
-      assertEquals(nsts.getCollection().size(), 2);
-      assertEquals(nsts.getCollection().get(0).getName(), "Service Network");
-      assertEquals(nsts.getCollection().get(1).getName(), "Storage Network");
-   }
-
-   public void testGetNetworkServiceTypeReturns2xx() {
-      InfrastructureApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/datacenters/1/networkservicetypes/1")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(NetworkServiceTypeDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/nst-edit.xml",
-                              normalize(NetworkServiceTypeDto.MEDIA_TYPE))) //
-                  .build());
-
-      DatacenterDto datacenter = new DatacenterDto();
-      datacenter.addLink(new RESTLink("networkservicetypes",
-            "http://localhost/api/admin/datacenters/1/networkservicetypes"));
-
-      NetworkServiceTypeDto created = api.getNetworkServiceType(datacenter, 1);
-      assertNotNull(created.getId());
-      assertEquals(created.getName(), "Service Network");
-      assertEquals(created.isDefaultNST(), true);
-   }
-
-   public void testGetNetworkServiceTypeReturns4xx() {
-      InfrastructureApi api = requestSendsResponse(HttpRequest.builder() //
-            .method("GET") //
-            .endpoint(URI.create("http://localhost/api/admin/datacenters/1/networkservicetypes/1")) //
-            .addHeader("Cookie", tokenAuth) //
-            .addHeader("Accept", normalize(NetworkServiceTypeDto.MEDIA_TYPE)) //
-            .build(), //
-            HttpResponse.builder().statusCode(404).build());
-
-      DatacenterDto datacenter = new DatacenterDto();
-      datacenter.addLink(new RESTLink("networkservicetypes",
-            "http://localhost/api/admin/datacenters/1/networkservicetypes"));
-
-      assertNull(api.getNetworkServiceType(datacenter, 1));
-   }
-
-   public void testCreateNetworkServiceTypeReturns2xx() {
-      InfrastructureApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("POST") //
-                  .endpoint(URI.create("http://localhost/api/admin/datacenters/1/networkservicetypes")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(NetworkServiceTypeDto.MEDIA_TYPE))
-                  //
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/nst-create.xml",
-                              normalize(NetworkServiceTypeDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(201)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/nst-edit.xml",
-                              normalize(NetworkServiceTypeDto.MEDIA_TYPE))) //
-                  .build());
-
-      DatacenterDto datacenter = new DatacenterDto();
-      datacenter.addLink(new RESTLink("networkservicetypes",
-            "http://localhost/api/admin/datacenters/1/networkservicetypes"));
-
-      NetworkServiceTypeDto nst = new NetworkServiceTypeDto();
-      nst.setName("Service Network");
-      nst.setDefaultNST(true);
-
-      NetworkServiceTypeDto created = api.createNetworkServiceType(datacenter, nst);
-      assertNotNull(created.getId());
-      assertEquals(created.getName(), "Service Network");
-      assertEquals(created.isDefaultNST(), true);
-   }
-
-   public void testUpdateNetworkServiceTypeReturns2xx() {
-      InfrastructureApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("PUT") //
-                  .endpoint(URI.create("http://localhost/api/admin/datacenters/1/networkservicetypes/1")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(NetworkServiceTypeDto.MEDIA_TYPE))
-                  //
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/nst-edit.xml",
-                              normalize(NetworkServiceTypeDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/nst-edit.xml",
-                              normalize(NetworkServiceTypeDto.MEDIA_TYPE))) //
-                  .build());
-
-      NetworkServiceTypeDto nst = new NetworkServiceTypeDto();
-      RESTLink editLink = new RESTLink("edit", "http://localhost/api/admin/datacenters/1/networkservicetypes/1");
-      editLink.setType(NetworkServiceTypeDto.BASE_MEDIA_TYPE);
-      nst.addLink(editLink);
-      nst.setId(1);
-      nst.setDefaultNST(true);
-      nst.setName("Service Network");
-
-      NetworkServiceTypeDto created = api.updateNetworkServiceType(nst);
-      assertNotNull(created.getId());
-      assertEquals(created.getName(), "Service Network");
-   }
-
-   public void testDeleteNetworkServiceTypeReturns2xx() {
-      InfrastructureApi api = requestSendsResponse(HttpRequest.builder() //
-            .method("DELETE") //
-            .endpoint(URI.create("http://localhost/api/admin/datacenters/1/networkservicetypes/1")) //
-            .addHeader("Cookie", tokenAuth) //
-            .build(), //
-            HttpResponse.builder().statusCode(204).build());
-
-      NetworkServiceTypeDto nst = new NetworkServiceTypeDto();
-      RESTLink editLink = new RESTLink("edit", "http://localhost/api/admin/datacenters/1/networkservicetypes/1");
-      editLink.setType(NetworkServiceTypeDto.BASE_MEDIA_TYPE);
-      nst.addLink(editLink);
-
-      api.deleteNetworkServiceType(nst);
-   }
-
-   public void testListPublicIps() {
-      InfrastructureApi api = requestsSendResponses(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/datacenters/1/network/1/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PublicIpsDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/publicips-page.xml",
-                              normalize(PublicIpsDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/datacenters/1/network/1/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PublicIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "3") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/publicips-lastpage.xml",
-                              normalize(PublicIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/datacenters/1/network/1/ips"));
-
-      PagedIterable<PublicIpDto> publicIps = api.listPublicIps(vlan);
-      List<PublicIpDto> ips = publicIps.concat().toList();
-
-      assertEquals(ips.size(), 4);
-      assertEquals(ips.get(0).getId().intValue(), 1);
-      assertEquals(ips.get(1).getId().intValue(), 2);
-      assertEquals(ips.get(2).getId().intValue(), 3);
-      assertEquals(ips.get(3).getId().intValue(), 4);
-   }
-
-   public void testListPublicIpsWithPagination() {
-      InfrastructureApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/datacenters/1/network/1/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(PublicIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "3") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/publicips-lastpage.xml",
-                              normalize(PublicIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/datacenters/1/network/1/ips"));
-
-      IpOptions options = IpOptions.builder().startWith(3).build();
-      PaginatedCollection<PublicIpDto, PublicIpsDto> ips = api.listPublicIps(vlan, options);
-
-      assertEquals(ips.size(), 2);
-      assertEquals(ips.getTotalSize().intValue(), 4);
-      assertEquals(ips.get(0).getId().intValue(), 3);
-      assertEquals(ips.get(1).getId().intValue(), 4);
-   }
-
-   public void testListExternalIps() {
-      InfrastructureApi api = requestsSendResponses(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(ExternalIpsDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/externalips-page.xml",
-                              normalize(ExternalIpsDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(ExternalIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "3") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/externalips-lastpage.xml",
-                              normalize(ExternalIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips"));
-
-      PagedIterable<ExternalIpDto> publicIps = api.listExternalIps(vlan);
-      List<ExternalIpDto> ips = publicIps.concat().toList();
-
-      assertEquals(ips.size(), 4);
-      assertEquals(ips.get(0).getId().intValue(), 1);
-      assertEquals(ips.get(1).getId().intValue(), 2);
-      assertEquals(ips.get(2).getId().intValue(), 3);
-      assertEquals(ips.get(3).getId().intValue(), 4);
-   }
-
-   public void testListExternalIpsWithPagination() {
-      InfrastructureApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(ExternalIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "3") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/externalips-lastpage.xml",
-                              normalize(ExternalIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips"));
-
-      IpOptions options = IpOptions.builder().startWith(3).build();
-      PaginatedCollection<ExternalIpDto, ExternalIpsDto> ips = api.listExternalIps(vlan, options);
-
-      assertEquals(ips.size(), 2);
-      assertEquals(ips.getTotalSize().intValue(), 4);
-      assertEquals(ips.get(0).getId().intValue(), 3);
-      assertEquals(ips.get(1).getId().intValue(), 4);
-   }
-
-   public void testListUnmanagedIps() {
-      InfrastructureApi api = requestsSendResponses(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(UnmanagedIpsDto.MEDIA_TYPE)) //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/unmanagedips-page.xml",
-                              normalize(UnmanagedIpsDto.MEDIA_TYPE))) //
-                  .build(),
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(UnmanagedIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "3") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/unmanagedips-lastpage.xml",
-                              normalize(UnmanagedIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips"));
-
-      PagedIterable<UnmanagedIpDto> unmanagedIps = api.listUnmanagedIps(vlan);
-      List<UnmanagedIpDto> ips = unmanagedIps.concat().toList();
-
-      assertEquals(ips.size(), 4);
-      assertEquals(ips.get(0).getId().intValue(), 1);
-      assertEquals(ips.get(1).getId().intValue(), 2);
-      assertEquals(ips.get(2).getId().intValue(), 3);
-      assertEquals(ips.get(3).getId().intValue(), 4);
-   }
-
-   public void testListUnmanagedIpsWithPagination() {
-      InfrastructureApi api = requestSendsResponse(
-            HttpRequest.builder() //
-                  .method("GET") //
-                  .endpoint(URI.create("http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips")) //
-                  .addHeader("Cookie", tokenAuth) //
-                  .addHeader("Accept", normalize(UnmanagedIpsDto.MEDIA_TYPE)) //
-                  .addQueryParam("startwith", "3") //
-                  .build(),
-            HttpResponse
-                  .builder()
-                  .statusCode(200)
-                  .payload(
-                        payloadFromResourceWithContentType("/payloads/unmanagedips-lastpage.xml",
-                              normalize(UnmanagedIpsDto.MEDIA_TYPE))) //
-                  .build());
-
-      VLANNetworkDto vlan = new VLANNetworkDto();
-      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/2/limits/2/externalnetworks/2/ips"));
-
-      IpOptions options = IpOptions.builder().startWith(3).build();
-      PaginatedCollection<UnmanagedIpDto, UnmanagedIpsDto> ips = api.listUnmanagedIps(vlan, options);
-
-      assertEquals(ips.size(), 2);
-      assertEquals(ips.getTotalSize().intValue(), 4);
-      assertEquals(ips.get(0).getId().intValue(), 3);
-      assertEquals(ips.get(1).getId().intValue(), 4);
-   }
-
-   @Override
-   protected InfrastructureApi clientFrom(AbiquoApi api) {
-      return api.getInfrastructureApi();
-   }
-
-}


[15/24] jclouds-labs git commit: JCLOUDS-785: Leave only Abiquo skeleton to start coding Abiquo 3 provider

Posted by na...@apache.org.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/InfrastructureApi.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/InfrastructureApi.java b/abiquo/src/main/java/org/jclouds/abiquo/features/InfrastructureApi.java
deleted file mode 100644
index 6b12a4b..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/InfrastructureApi.java
+++ /dev/null
@@ -1,1367 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import java.io.Closeable;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.AbiquoFallbacks.FalseIfNotAvailable;
-import org.jclouds.abiquo.AbiquoFallbacks.PropagateAbiquoExceptionOnNotFoundOr4xx;
-import org.jclouds.abiquo.binders.AppendToPath;
-import org.jclouds.abiquo.binders.BindToPath;
-import org.jclouds.abiquo.binders.BindToXMLPayloadAndPath;
-import org.jclouds.abiquo.binders.infrastructure.AppendMachineIdToPath;
-import org.jclouds.abiquo.binders.infrastructure.AppendRemoteServiceTypeToPath;
-import org.jclouds.abiquo.binders.infrastructure.BindSupportedDevicesLinkToPath;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.infrastructure.options.DatacenterOptions;
-import org.jclouds.abiquo.domain.infrastructure.options.IpmiOptions;
-import org.jclouds.abiquo.domain.infrastructure.options.MachineOptions;
-import org.jclouds.abiquo.domain.infrastructure.options.StoragePoolOptions;
-import org.jclouds.abiquo.domain.network.options.IpOptions;
-import org.jclouds.abiquo.domain.network.options.NetworkOptions;
-import org.jclouds.abiquo.functions.infrastructure.ParseDatacenterId;
-import org.jclouds.abiquo.functions.pagination.ParseExternalIps;
-import org.jclouds.abiquo.functions.pagination.ParsePublicIps;
-import org.jclouds.abiquo.functions.pagination.ParseUnmanagedIps;
-import org.jclouds.abiquo.http.filters.AbiquoAuthentication;
-import org.jclouds.abiquo.http.filters.AppendApiVersionToMediaType;
-import org.jclouds.abiquo.rest.annotations.EndpointLink;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.http.functions.ReturnStringIf2xx;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.JAXBResponseParser;
-import org.jclouds.rest.annotations.ParamParser;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.SinceApiVersion;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToXMLPayload;
-
-import com.abiquo.model.enumerator.HypervisorType;
-import com.abiquo.model.enumerator.RemoteServiceType;
-import com.abiquo.server.core.cloud.HypervisorTypesDto;
-import com.abiquo.server.core.cloud.VirtualMachineWithNodeExtendedDto;
-import com.abiquo.server.core.cloud.VirtualMachinesWithNodeExtendedDto;
-import com.abiquo.server.core.enterprise.DatacentersLimitsDto;
-import com.abiquo.server.core.enterprise.EnterpriseDto;
-import com.abiquo.server.core.infrastructure.DatacenterDto;
-import com.abiquo.server.core.infrastructure.DatacentersDto;
-import com.abiquo.server.core.infrastructure.MachineDto;
-import com.abiquo.server.core.infrastructure.MachineIpmiStateDto;
-import com.abiquo.server.core.infrastructure.MachineStateDto;
-import com.abiquo.server.core.infrastructure.MachinesDto;
-import com.abiquo.server.core.infrastructure.RackDto;
-import com.abiquo.server.core.infrastructure.RacksDto;
-import com.abiquo.server.core.infrastructure.RemoteServiceDto;
-import com.abiquo.server.core.infrastructure.RemoteServicesDto;
-import com.abiquo.server.core.infrastructure.network.ExternalIpDto;
-import com.abiquo.server.core.infrastructure.network.ExternalIpsDto;
-import com.abiquo.server.core.infrastructure.network.NetworkServiceTypeDto;
-import com.abiquo.server.core.infrastructure.network.NetworkServiceTypesDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpDto;
-import com.abiquo.server.core.infrastructure.network.PublicIpsDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpDto;
-import com.abiquo.server.core.infrastructure.network.UnmanagedIpsDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworkDto;
-import com.abiquo.server.core.infrastructure.network.VLANNetworksDto;
-import com.abiquo.server.core.infrastructure.network.VlanTagAvailabilityDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDeviceDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDevicesDto;
-import com.abiquo.server.core.infrastructure.storage.StorageDevicesMetadataDto;
-import com.abiquo.server.core.infrastructure.storage.StoragePoolDto;
-import com.abiquo.server.core.infrastructure.storage.StoragePoolsDto;
-import com.abiquo.server.core.infrastructure.storage.TierDto;
-import com.abiquo.server.core.infrastructure.storage.TiersDto;
-
-/**
- * Provides synchronous access to Abiquo Infrastructure API.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/API+Reference">
- *      http://community.abiquo.com/display/ABI20/API+Reference</a>
- */
-@RequestFilters({ AbiquoAuthentication.class, AppendApiVersionToMediaType.class })
-@Path("/admin")
-public interface InfrastructureApi extends Closeable {
-   /*********************** Datacenter ***********************/
-
-   /**
-    * List all datacenters.
-    * 
-    * @return The list of Datacenters.
-    */
-   @Named("datacenter:list")
-   @GET
-   @Path("/datacenters")
-   @Consumes(DatacentersDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DatacentersDto listDatacenters();
-
-   /**
-    * Create a new datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter to be created.
-    * @return The created datacenter.
-    */
-   @Named("datacenter:create")
-   @POST
-   @Path("/datacenters")
-   @Produces(DatacenterDto.BASE_MEDIA_TYPE)
-   @Consumes(DatacenterDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DatacenterDto createDatacenter(@BinderParam(BindToXMLPayload.class) DatacenterDto datacenter);
-
-   /**
-    * Get the given datacenter.
-    * 
-    * @param datacenterId
-    *           The id of the datacenter.
-    * @return The datacenter or <code>null</code> if it does not exist.
-    */
-   @Named("datacenter:get")
-   @GET
-   @Path("/datacenters/{datacenter}")
-   @Consumes(DatacenterDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   DatacenterDto getDatacenter(@PathParam("datacenter") Integer datacenterId);
-
-   /**
-    * Updates an existing datacenter.
-    * 
-    * @param datacenter
-    *           The new attributes for the datacenter.
-    * @return The updated datacenter.
-    */
-   @Named("datacenter:update")
-   @PUT
-   @Produces(DatacenterDto.BASE_MEDIA_TYPE)
-   @Consumes(DatacenterDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DatacenterDto updateDatacenter(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) DatacenterDto datacenter);
-
-   /**
-    * Deletes an existing datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter to delete.
-    */
-   @Named("datacenter:delete")
-   @DELETE
-   void deleteDatacenter(@EndpointLink("edit") @BinderParam(BindToPath.class) DatacenterDto datacenter);
-
-   /**
-    * Retrieve remote machine information.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrieveremotemachineinformation"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrieveremotemachineinformation</a>
-    * @param datacenter
-    *           The datacenter.
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @return The physical machine.
-    */
-   @Named("machine:discover")
-   @GET
-   @Consumes(MachineDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(PropagateAbiquoExceptionOnNotFoundOr4xx.class)
-   MachineDto discoverSingleMachine(
-         @EndpointLink("discoversingle") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @QueryParam("ip") String ip, @QueryParam("hypervisor") HypervisorType hypervisorType,
-         @QueryParam("user") String user, @QueryParam("password") String password);
-
-   /**
-    * Retrieve remote machine information.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrieveremotemachineinformation"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrieveremotemachineinformation</a>
-    * @param datacenter
-    *           The datacenter.
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @param options
-    *           Optional query params.
-    * @return The physical machine.
-    */
-   @Named("machine:discover")
-   @GET
-   @Consumes(MachineDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(PropagateAbiquoExceptionOnNotFoundOr4xx.class)
-   MachineDto discoverSingleMachine(
-         @EndpointLink("discoversingle") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @QueryParam("ip") String ip, @QueryParam("hypervisor") HypervisorType hypervisorType,
-         @QueryParam("user") String user, @QueryParam("password") String password, MachineOptions options);
-
-   /**
-    * Retrieve a list of remote machine information.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrievealistofremotemachineinformation"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrievealistofremotemachineinformation</a>
-    * @param datacenter
-    *           The datacenter.
-    * @param ipFrom
-    *           IP address of the remote first hypervisor to check.
-    * @param ipTo
-    *           IP address of the remote last hypervisor to check.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @return The physical machine list.
-    */
-   @Named("machine:discover")
-   @GET
-   @Consumes(MachinesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(PropagateAbiquoExceptionOnNotFoundOr4xx.class)
-   MachineDto discoverMultipleMachines(
-         @EndpointLink("discovermultiple") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @QueryParam("ipFrom") String ipFrom, @QueryParam("ipTo") String ipTo,
-         @QueryParam("hypervisor") HypervisorType hypervisorType, @QueryParam("user") String user,
-         @QueryParam("password") String password);
-
-   /**
-    * Retrieve a list of remote machine information.
-    * 
-    * @see API: <a href=
-    *      "http://community.abiquo.com/display/ABI20/DatacenterResource#DatacenterResource-Retrievealistofremotemachineinformation"
-    *      > http://community.abiquo.com/display/ABI20/DatacenterResource#
-    *      DatacenterResource- Retrievealistofremotemachineinformation</a>
-    * @param datacenter
-    *           The datacenter.
-    * @param ipFrom
-    *           IP address of the remote first hypervisor to check.
-    * @param ipTo
-    *           IP address of the remote last hypervisor to check.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @param options
-    *           Optional query params.
-    * @return The physical machine list.
-    */
-   @Named("machine:discover")
-   @GET
-   @Consumes(MachinesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(PropagateAbiquoExceptionOnNotFoundOr4xx.class)
-   MachinesDto discoverMultipleMachines(
-         @EndpointLink("discovermultiple") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @QueryParam("ipFrom") String ipFrom, @QueryParam("ipTo") String ipTo,
-         @QueryParam("hypervisor") HypervisorType hypervisorType, @QueryParam("user") String user,
-         @QueryParam("password") String password, MachineOptions options);
-
-   /**
-    * Retrieves limits for the given datacenter and any enterprise.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @return The usage limits for the datacenter on any enterprise.
-    */
-   @Named("limit:list")
-   @GET
-   @Consumes(DatacentersLimitsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   DatacentersLimitsDto listLimits(@EndpointLink("getLimits") @BinderParam(BindToPath.class) DatacenterDto datacenter);
-
-   /**
-    * Check the state of a remote machine. This machine does not need to be
-    * managed by Abiquo.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @return The physical machine state information.
-    */
-   @Named("machine:checkstate")
-   @GET
-   @Consumes(MachineStateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(PropagateAbiquoExceptionOnNotFoundOr4xx.class)
-   MachineStateDto checkMachineState(
-         @EndpointLink("checkmachinestate") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @QueryParam("ip") String ip, @QueryParam("hypervisor") HypervisorType hypervisorType,
-         @QueryParam("user") String user, @QueryParam("password") String password);
-
-   /**
-    * Check the state of a remote machine. This machine does not need to be
-    * managed by Abiquo.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param hypervisorType
-    *           Kind of hypervisor we want to connect. Valid values are {vbox,
-    *           kvm, xen-3, vmx-04, hyperv-301, xenserver}.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @param options
-    *           Optional query params.
-    * @return The physical machine state information.
-    */
-   @Named("machine:checkstate")
-   @GET
-   @Consumes(MachineStateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(PropagateAbiquoExceptionOnNotFoundOr4xx.class)
-   MachineStateDto checkMachineState(
-         @EndpointLink("checkmachinestate") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @QueryParam("ip") String ip, @QueryParam("hypervisor") HypervisorType hypervisorType,
-         @QueryParam("user") String user, @QueryParam("password") String password, MachineOptions options);
-
-   /**
-    * Check the ipmi configuration state of a remote machine. This machine does
-    * not need to be managed by Abiquo.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @return The ipmi configuration state information
-    */
-   @Named("machine:checkipmi")
-   @GET
-   @Consumes(MachineIpmiStateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(PropagateAbiquoExceptionOnNotFoundOr4xx.class)
-   MachineIpmiStateDto checkMachineIpmiState(
-         @EndpointLink("checkmachineipmistate") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @QueryParam("ip") String ip, @QueryParam("user") String user, @QueryParam("password") String password);
-
-   /**
-    * Check the ipmi configuration state of a remote machine. This machine does
-    * not need to be managed by Abiquo.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param ip
-    *           IP address of the remote hypervisor to connect.
-    * @param user
-    *           User to log in.
-    * @param password
-    *           Password to authenticate.
-    * @param options
-    *           Optional query params.
-    * @return The ipmi configuration state information
-    */
-   @Named("machine:checkipmi")
-   @GET
-   @Consumes(MachineIpmiStateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(PropagateAbiquoExceptionOnNotFoundOr4xx.class)
-   MachineIpmiStateDto checkMachineIpmiState(
-         @EndpointLink("checkmachineipmistate") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @QueryParam("ip") String ip, @QueryParam("user") String user, @QueryParam("password") String password,
-         IpmiOptions options);
-
-   /*********************** Hypervisor ***********************/
-
-   /**
-    * Retrieves the hypervisor type of a remote a machine.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param options
-    *           Optional query params.
-    * @return The hypervisor type.
-    */
-   @Named("hypervisortype:getfrommachine")
-   @GET
-   @Consumes(MediaType.TEXT_PLAIN)
-   @ResponseParser(ReturnStringIf2xx.class)
-   String getHypervisorTypeFromMachine(
-         @EndpointLink("hypervisor") @BinderParam(BindToPath.class) DatacenterDto datacenter, DatacenterOptions options);
-
-   /**
-    * Retrieves the hypervisor types in the datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @return The hypervisor types.
-    */
-   @Named("hypervisortype:list")
-   @GET
-   @Consumes(HypervisorTypesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   HypervisorTypesDto getHypervisorTypes(
-         @EndpointLink("hypervisors") @BinderParam(BindToPath.class) DatacenterDto datacenter);
-
-   /*********************** Unmanaged Rack ********************** */
-
-   /**
-    * List all not managed racks for a datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @return The list of not managed racks for the datacenter.
-    */
-   @Named("rack:list")
-   @GET
-   @Consumes(RacksDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   RacksDto listRacks(@EndpointLink("racks") @BinderParam(BindToPath.class) DatacenterDto datacenter);
-
-   /**
-    * Create a new not managed rack in a datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param rack
-    *           The rack to be created.
-    * @return The created rack.
-    */
-   @Named("rack:create")
-   @POST
-   @Produces(RackDto.BASE_MEDIA_TYPE)
-   @Consumes(RackDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   RackDto createRack(@EndpointLink("racks") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @BinderParam(BindToXMLPayload.class) RackDto rack);
-
-   /**
-    * Get the given rack from the given datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param rackId
-    *           The id of the rack.
-    * @return The rack or <code>null</code> if it does not exist.
-    */
-   @Named("rack:get")
-   @GET
-   @Consumes(RackDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   RackDto getRack(@EndpointLink("racks") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @BinderParam(AppendToPath.class) Integer rackId);
-
-   /**
-    * Updates an existing rack from the given datacenter.
-    * 
-    * @param rack
-    *           The new attributes for the rack.
-    * @return The updated rack.
-    */
-   @Named("rack:update")
-   @PUT
-   @Consumes(RackDto.BASE_MEDIA_TYPE)
-   @Produces(RackDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   RackDto updateRack(@EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) RackDto rack);
-
-   /**
-    * Deletes an existing rack.
-    * 
-    * @param rack
-    *           The rack to delete.
-    */
-   @Named("rack:delete")
-   @DELETE
-   void deleteRack(@EndpointLink("edit") @BinderParam(BindToPath.class) RackDto rack);
-
-   /*********************** Remote Service ********************** */
-
-   /**
-    * List all remote services of the datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @return The list of remote services for the datacenter.
-    */
-   @Named("rs:list")
-   @GET
-   @Consumes(RemoteServicesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   RemoteServicesDto listRemoteServices(
-         @EndpointLink("remoteservices") @BinderParam(BindToPath.class) DatacenterDto datacenter);
-
-   /**
-    * Create a new remote service in a datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param remoteService
-    *           The remote service to be created.
-    * @return The created remote service.
-    */
-   @Named("rs:create")
-   @POST
-   @Produces(RemoteServiceDto.BASE_MEDIA_TYPE)
-   @Consumes(RemoteServiceDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   RemoteServiceDto createRemoteService(
-         @EndpointLink("remoteservices") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @BinderParam(BindToXMLPayload.class) RemoteServiceDto remoteService);
-
-   /**
-    * Get the given remote service from the given datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param remoteServiceType
-    *           The type of the remote service.
-    * @return The remote service or <code>null</code> if it does not exist.
-    */
-   @Named("rs:get")
-   @GET
-   @Consumes(RemoteServiceDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   RemoteServiceDto getRemoteService(
-         @EndpointLink("remoteservices") @BinderParam(BindToPath.class) final DatacenterDto datacenter,
-         @BinderParam(AppendRemoteServiceTypeToPath.class) final RemoteServiceType remoteServiceType);
-
-   /**
-    * Updates an existing remote service from the given datacenter.
-    * 
-    * @param remoteService
-    *           The new attributes for the remote service.
-    * @return The updated remote service.
-    */
-   @Named("rs:update")
-   @PUT
-   @Consumes(RemoteServiceDto.BASE_MEDIA_TYPE)
-   @Produces(RemoteServiceDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   RemoteServiceDto updateRemoteService(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) RemoteServiceDto remoteService);
-
-   /**
-    * Deletes an existing remote service.
-    * 
-    * @param remoteService
-    *           The remote service to delete.
-    */
-   @Named("rs:delete")
-   @DELETE
-   void deleteRemoteService(@EndpointLink("edit") @BinderParam(BindToPath.class) RemoteServiceDto remoteService);
-
-   /**
-    * Check if the given remote service is available and properly configured.
-    * 
-    * @param remoteService
-    *           The remote service to check.
-    * @return A Boolean indicating if the remote service is available.
-    */
-   @Named("rs:available")
-   @GET
-   @Fallback(FalseIfNotAvailable.class)
-   boolean isAvailable(@EndpointLink("check") @BinderParam(BindToPath.class) RemoteServiceDto remoteService);
-
-   /*********************** Machine ********************** */
-
-   /**
-    * Create a new physical machine in a rack.
-    * 
-    * @param rack
-    *           The rack.
-    * @param machine
-    *           The physical machine to be created.
-    * @return The created physical machine.
-    */
-   @Named("machine:create")
-   @POST
-   @Produces(MachineDto.BASE_MEDIA_TYPE)
-   @Consumes(MachineDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   MachineDto createMachine(@EndpointLink("machines") @BinderParam(BindToPath.class) RackDto rack,
-         @BinderParam(BindToXMLPayload.class) MachineDto machine);
-
-   /**
-    * Get the given machine from the given rack.
-    * 
-    * @param rack
-    *           The rack.
-    * @param machineId
-    *           The id of the machine.
-    * @return The machine or <code>null</code> if it does not exist.
-    */
-   @Named("machine:get")
-   @GET
-   @Consumes(MachineDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   MachineDto getMachine(@EndpointLink("machines") @BinderParam(BindToPath.class) final RackDto rack,
-         @BinderParam(AppendToPath.class) Integer machineId);
-
-   /**
-    * Checks the real infrastructure state for the given physical machine. The
-    * machine is updated with the result state.
-    * 
-    * @param machine
-    *           The machine to check
-    * @param sync
-    *           boolean that indicates a database synchronization
-    * @return A machineStateDto with a machine state value from enum
-    *         MachineState
-    */
-   @Named("machine:checkstate")
-   @GET
-   @Consumes(MachineStateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   MachineStateDto checkMachineState(
-         @EndpointLink("checkstate") @BinderParam(BindToPath.class) final MachineDto machine,
-         @QueryParam("sync") boolean sync);
-
-   /**
-    * Checks the ipmi configuration state for the given physical machine.
-    * 
-    * @param machine
-    *           The machine to check
-    * @return A machineIpmiStateDto with a machine ipmi configuration state
-    *         value from enum MachineState
-    */
-   @Named("machine:checkipmi")
-   @GET
-   @Consumes(MachineIpmiStateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   MachineIpmiStateDto checkMachineIpmiState(
-         @EndpointLink("checkipmistate") @BinderParam(BindToPath.class) final MachineDto machine);
-
-   /**
-    * Updates an existing physical machine.
-    * 
-    * @param machine
-    *           The new attributes for the physical machine.
-    * @return The updated machine.
-    */
-   @Named("machine:update")
-   @PUT
-   @Produces(MachineDto.BASE_MEDIA_TYPE)
-   @Consumes(MachineDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   MachineDto updateMachine(@EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) MachineDto machine);
-
-   /**
-    * Deletes an existing physical machine.
-    * 
-    * @param machine
-    *           The physical machine to delete.
-    */
-   @Named("machine:delete")
-   @DELETE
-   void deleteMachine(@EndpointLink("edit") @BinderParam(BindToPath.class) MachineDto machine);
-
-   /**
-    * Reserve the given machine for the given enterprise.
-    * 
-    * @param enterprise
-    *           The enterprise reserving the machine.
-    * @param machine
-    *           The machine to reserve.
-    * @return The reserved machine.
-    */
-   @Named("machine:reserve")
-   @POST
-   @Consumes(MachineDto.BASE_MEDIA_TYPE)
-   @Produces(MachineDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   MachineDto reserveMachine(@EndpointLink("reservedmachines") @BinderParam(BindToPath.class) EnterpriseDto enterprise,
-         @BinderParam(BindToXMLPayload.class) MachineDto machine);
-
-   /**
-    * Cancels the reservation of the given machine.
-    * 
-    * @param enterprise
-    *           The enterprise to cancel reservation.
-    * @param machine
-    *           The machine to release.
-    */
-   @Named("machine:cancelreservation")
-   @DELETE
-   void cancelReservation(@EndpointLink("reservedmachines") @BinderParam(BindToPath.class) EnterpriseDto enterprise,
-         @BinderParam(AppendMachineIdToPath.class) MachineDto machine);
-
-   /**
-    * List all machines racks for a rack.
-    * 
-    * @param rack
-    *           The rack.
-    * @return The list of physical machines for the rack.
-    */
-   @Named("machine:list")
-   @GET
-   @Consumes(MachinesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   MachinesDto listMachines(@EndpointLink("machines") @BinderParam(BindToPath.class) RackDto rack);
-
-   /**
-    * List all virtual machines in a physical machine.
-    * 
-    * @param machine
-    *           The physical machine.
-    * @return The list of virtual machines in the physical machine.
-    */
-   @Named("machine:listvms")
-   @GET
-   @Consumes(VirtualMachinesWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualMachinesWithNodeExtendedDto listVirtualMachinesByMachine(
-         @EndpointLink("virtualmachines") @BinderParam(BindToPath.class) MachineDto machine, MachineOptions options);
-
-   /**
-    * Get the given virtual machine
-    * 
-    * @param machine
-    * @param virtualMachineId
-    * @return
-    */
-   @Named("machine:getvm")
-   @GET
-   @Fallback(NullOnNotFoundOr404.class)
-   @Consumes(VirtualMachineWithNodeExtendedDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualMachineWithNodeExtendedDto getVirtualMachine(
-         @EndpointLink("virtualmachines") @BinderParam(BindToPath.class) MachineDto machine,
-         @BinderParam(AppendToPath.class) Integer virtualMachineId);
-
-   /*********************** Storage Device ***********************/
-
-   /**
-    * List all storage devices of the datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @return The list of storage devices in the datacenter.
-    */
-   @Named("storagedevice:list")
-   @GET
-   @Consumes(StorageDevicesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   StorageDevicesDto listStorageDevices(@EndpointLink("devices") @BinderParam(BindToPath.class) DatacenterDto datacenter);
-
-   /**
-    * List all supported storage devices.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @return The list of supported storage devices.
-    */
-   @Named("storagedevice:listsupported")
-   @GET
-   @Consumes(StorageDevicesMetadataDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   StorageDevicesMetadataDto listSupportedStorageDevices(
-         @EndpointLink("devices") @BinderParam(BindSupportedDevicesLinkToPath.class) DatacenterDto datacenter);
-
-   /**
-    * Get the storage device.
-    * 
-    * @param storageDeviceId
-    *           The id of the storage device.
-    * @return The storage device or <code>null</code> if it does not exist.
-    */
-   @Named("storagedevice:get")
-   @GET
-   @Consumes(StorageDeviceDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   StorageDeviceDto getStorageDevice(@EndpointLink("devices") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @BinderParam(AppendToPath.class) Integer storageDeviceId);
-
-   /**
-    * Create a new storage device.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param storageDevice
-    *           The storage device to be created.
-    * @return The created storage device.
-    */
-   @Named("storagedevice:create")
-   @POST
-   @Produces(StorageDeviceDto.BASE_MEDIA_TYPE)
-   @Consumes(StorageDeviceDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   StorageDeviceDto createStorageDevice(
-         @EndpointLink("devices") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @BinderParam(BindToXMLPayload.class) StorageDeviceDto storageDevice);
-
-   /**
-    * Deletes an existing storage device.
-    * 
-    * @param storageDevice
-    *           The storage device to delete.
-    */
-   @Named("storagedevice:delete")
-   @DELETE
-   void deleteStorageDevice(@EndpointLink("edit") @BinderParam(BindToPath.class) StorageDeviceDto storageDevice);
-
-   /**
-    * Updates an existing storage device.
-    * 
-    * @param storageDevice
-    *           The new attributes for the storage device.
-    * @return The updated storage device.
-    */
-   @Named("storagedevice:update")
-   @PUT
-   @Produces(StorageDeviceDto.BASE_MEDIA_TYPE)
-   @Consumes(StorageDeviceDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   StorageDeviceDto updateStorageDevice(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) StorageDeviceDto storageDevice);
-
-   /*********************** Tier ***********************/
-   /**
-    * List all tiers of the datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @return The list of tiers in the datacenter.
-    */
-   @Named("tier:list")
-   @GET
-   @Consumes(TiersDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   TiersDto listTiers(@EndpointLink("tiers") @BinderParam(BindToPath.class) DatacenterDto datacenter);
-
-   /**
-    * Updates a tier.
-    * 
-    * @param tier
-    *           The new attributes for the tier.
-    * @return The updated tier.
-    */
-   @Named("tier:update")
-   @PUT
-   @Produces(TierDto.BASE_MEDIA_TYPE)
-   @Consumes(TierDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   TierDto updateTier(@EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) TierDto tier);
-
-   /**
-    * Get the tier.
-    * 
-    * @param tierId
-    *           The id of the tier.
-    * @return The tier or <code>null</code> if it does not exist.
-    */
-   @Named("tier:get")
-   @GET
-   @Consumes(TierDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   TierDto getTier(@EndpointLink("tiers") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @BinderParam(AppendToPath.class) Integer tierId);
-
-   /*********************** Storage Pool ***********************/
-
-   /**
-    * List storage pools on a storage device.
-    * 
-    * @param storageDevice
-    *           The storage device.
-    * @param options
-    *           Optional query params.
-    * @return The list of storage pools in the storage device.
-    */
-   @Named("storagepool:list")
-   @GET
-   @Consumes(StoragePoolsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   StoragePoolsDto listStoragePools(
-         @EndpointLink("pools") @BinderParam(BindToPath.class) StorageDeviceDto storageDevice,
-         StoragePoolOptions options);
-
-   /**
-    * List storage pools on a tier.
-    * 
-    * @param tier
-    *           The tier device.
-    * @return The list of storage pools in the tier.
-    */
-   @Named("storagepool:list")
-   @GET
-   @Consumes(StoragePoolsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   StoragePoolsDto listStoragePools(@EndpointLink("pools") @BinderParam(BindToPath.class) TierDto tier);
-
-   /**
-    * Create a new storage pool in a storage device.
-    * 
-    * @param storageDevice
-    *           The storage device.
-    * @param storagePool
-    *           The storage pool to be created.
-    * @return The created storage pool.
-    */
-   @Named("storagepool:create")
-   @POST
-   @Consumes(StoragePoolDto.BASE_MEDIA_TYPE)
-   @Produces(StoragePoolDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   StoragePoolDto createStoragePool(
-         @EndpointLink("pools") @BinderParam(BindToPath.class) StorageDeviceDto storageDevice,
-         @BinderParam(BindToXMLPayload.class) StoragePoolDto storagePool);
-
-   /**
-    * Updates a storage pool.
-    * 
-    * @param storagePool
-    *           The new attributes for the storage pool.
-    * @return The updated tier.
-    */
-   @Named("storagepool:update")
-   @PUT
-   // For the most strangest reason in world, compiler does not accept
-   // constants StoragePoolDto.BASE_MEDIA_TYPE for this method.
-   @Consumes("application/vnd.abiquo.storagepool+xml")
-   @Produces("application/vnd.abiquo.storagepool+xml")
-   @JAXBResponseParser
-   StoragePoolDto updateStoragePool(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) StoragePoolDto StoragePoolDto);
-
-   /**
-    * Deletes an existing storage pool.
-    * 
-    * @param storagePool
-    *           The storage pool to delete.
-    */
-   @Named("storagepool:delete")
-   @DELETE
-   void deleteStoragePool(@EndpointLink("edit") @BinderParam(BindToPath.class) StoragePoolDto storagePool);
-
-   /**
-    * Get the storage pool.
-    * 
-    * @param storageDevice
-    *           The storage device.
-    * @param storagePoolId
-    *           The id of the storage pool.
-    * @return The storage pool or <code>null</code> if it does not exist.
-    */
-   @Named("storagepool:get")
-   @GET
-   @Consumes(StoragePoolDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   StoragePoolDto getStoragePool(
-         @EndpointLink("pools") @BinderParam(BindToPath.class) final StorageDeviceDto storageDevice,
-         @BinderParam(AppendToPath.class) final String storagePoolId);
-
-   /**
-    * Refresh the given storage pool data.
-    * 
-    * @param storagePool
-    *           The storage pool to refresh.
-    * @param options
-    *           The options to query the storage pool.
-    * @return The updated storage pool.
-    */
-   @Named("storagepool:refresh")
-   @GET
-   @Consumes(StoragePoolDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   StoragePoolDto refreshStoragePool(@EndpointLink("edit") @BinderParam(BindToPath.class) StoragePoolDto storagePool,
-         StoragePoolOptions options);
-
-   /*********************** Network ***********************/
-
-   /**
-    * List all public, external and not managed networks of a datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @return The list of not public, external and not managed for the
-    *         datacenter.
-    */
-   @Named("network:list")
-   @GET
-   @Consumes(VLANNetworksDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VLANNetworksDto listNetworks(@EndpointLink("network") @BinderParam(BindToPath.class) DatacenterDto datacenter);
-
-   /**
-    * List networks of a datacenter with options.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param options
-    *           Optional query params.
-    * @return The list of not public, external and not managed for the
-    *         datacenter.
-    */
-   @Named("network:list")
-   @GET
-   @Consumes(VLANNetworksDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VLANNetworksDto listNetworks(@EndpointLink("network") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         NetworkOptions options);
-
-   /**
-    * Get the given network from the given datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param networkId
-    *           The id of the network.
-    * @return The rack or <code>null</code> if it does not exist.
-    */
-   @Named("network:get")
-   @GET
-   @Consumes(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   VLANNetworkDto getNetwork(@EndpointLink("network") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @BinderParam(AppendToPath.class) Integer networkId);
-
-   /**
-    * Create a new public network.
-    * 
-    * @param storageDevice
-    *           The storage device.
-    * @param storagePool
-    *           The storage pool to be created.
-    * @return The created storage pool.
-    */
-   @Named("network:create")
-   @POST
-   @Produces(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @Consumes(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VLANNetworkDto createNetwork(@EndpointLink("network") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @BinderParam(BindToXMLPayload.class) VLANNetworkDto network);
-
-   /**
-    * Updates a network.
-    * 
-    * @param network
-    *           The new attributes for the network.
-    * @return The updated tier.
-    */
-   @Named("network:update")
-   @PUT
-   @Produces(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @Consumes(VLANNetworkDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VLANNetworkDto updateNetwork(@EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) VLANNetworkDto network);
-
-   /**
-    * Deletes an existing network.
-    * 
-    * @param network
-    *           The network to delete.
-    */
-   @Named("network:delete")
-   @DELETE
-   void deleteNetwork(@EndpointLink("edit") @BinderParam(BindToPath.class) VLANNetworkDto network);
-
-   /**
-    * Check the availability of a tag.
-    * 
-    * @param datacenter
-    *           The datacenter.
-    * @param tag
-    *           Tag to check.
-    * @return A tag availability object.
-    */
-   @Named("network:checktag")
-   @GET
-   @Path("/datacenters/{datacenter}/network/action/checkavailability")
-   @Consumes(VlanTagAvailabilityDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VlanTagAvailabilityDto checkTagAvailability(
-         @PathParam("datacenter") @ParamParser(ParseDatacenterId.class) DatacenterDto datacenter,
-         @QueryParam("tag") Integer tag);
-
-   /*********************** Network IPs ***********************/
-
-   /**
-    * List all the IPs in the given public network.
-    * 
-    * @param network
-    *           The public network.
-    * @return The IPs in the given public network.
-    */
-   @SinceApiVersion("2.3")
-   @Named("publicnetwork:listips")
-   @GET
-   @Consumes(PublicIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParsePublicIps.class)
-   @Transform(ParsePublicIps.ToPagedIterable.class)
-   PagedIterable<PublicIpDto> listPublicIps(@EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network);
-
-   /**
-    * List all the IPs in the given public network.
-    * 
-    * @param network
-    *           The public network.
-    * @param options
-    *           The filtering options.
-    * @return The IPs in the given public network.
-    */
-   @SinceApiVersion("2.3")
-   @Named("publicnetwork:listips")
-   @GET
-   @Consumes(PublicIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParsePublicIps.class)
-   PaginatedCollection<PublicIpDto, PublicIpsDto> listPublicIps(
-         @EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network, IpOptions options);
-
-   /**
-    * Get the given public ip.
-    * 
-    * @param network
-    *           The public network.
-    * @param ipId
-    *           The id of the ip to get.
-    * @return The requested ip.
-    */
-   @SinceApiVersion("2.3")
-   @Named("publicnetwork:getip")
-   @GET
-   @Consumes(PublicIpDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   PublicIpDto getPublicIp(@EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network,
-         @BinderParam(AppendToPath.class) Integer ipId);
-
-   /**
-    * List all the IPs in the given external network.
-    * 
-    * @param network
-    *           The external network.
-    * @return The IPs in the given external network.
-    */
-   @SinceApiVersion("2.3")
-   @Named("externalnetwork:listips")
-   @GET
-   @Consumes(ExternalIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseExternalIps.class)
-   @Transform(ParseExternalIps.ToPagedIterable.class)
-   PagedIterable<ExternalIpDto> listExternalIps(
-         @EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network);
-
-   /**
-    * List all the IPs in the given external network.
-    * 
-    * @param network
-    *           The external network.
-    * @param options
-    *           The filtering options.
-    * @return The IPs in the given external network.
-    */
-   @SinceApiVersion("2.3")
-   @Named("externalnetwork:listips")
-   @GET
-   @Consumes(ExternalIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseExternalIps.class)
-   PaginatedCollection<ExternalIpDto, ExternalIpsDto> listExternalIps(
-         @EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network, IpOptions options);
-
-   /**
-    * Get the given external ip.
-    * 
-    * @param network
-    *           The external network.
-    * @param ipId
-    *           The id of the ip to get.
-    * @return The requested ip.
-    */
-   @SinceApiVersion("2.3")
-   @Named("externalnetwork:getip")
-   @GET
-   @Consumes(ExternalIpDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   ExternalIpDto getExternalIp(@EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network,
-         @BinderParam(AppendToPath.class) Integer ipId);
-
-   /**
-    * List all the IPs in the given unmanaged network.
-    * 
-    * @param network
-    *           The unmanaged network.
-    * @return The IPs in the given unmanaged network.
-    */
-   @SinceApiVersion("2.3")
-   @Named("unmanagednetwork:listips")
-   @GET
-   @Consumes(UnmanagedIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseUnmanagedIps.class)
-   @Transform(ParseUnmanagedIps.ToPagedIterable.class)
-   PagedIterable<UnmanagedIpDto> listUnmanagedIps(
-         @EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network);
-
-   /**
-    * List all the IPs in the given unmanaged network.
-    * 
-    * @param network
-    *           The unmanaged network.
-    * @param options
-    *           The filtering options.
-    * @return The IPs in the given unmanaged network.
-    */
-   @SinceApiVersion("2.3")
-   @Named("unmanagednetwork:listips")
-   @GET
-   @Consumes(UnmanagedIpsDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseUnmanagedIps.class)
-   PaginatedCollection<UnmanagedIpDto, UnmanagedIpsDto> listUnmanagedIps(
-         @EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network, IpOptions options);
-
-   /**
-    * Get the given unmanaged ip.
-    * 
-    * @param network
-    *           The unmanaged network.
-    * @param ipId
-    *           The id of the ip to get.
-    * @return The requested ip.
-    */
-   @SinceApiVersion("2.3")
-   @Named("unmanagednetwork:getip")
-   @GET
-   @Consumes(UnmanagedIpDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   UnmanagedIpDto getUnmanagedIp(@EndpointLink("ips") @BinderParam(BindToPath.class) VLANNetworkDto network,
-         @BinderParam(AppendToPath.class) Integer ipId);
-
-   /**
-    * List all the Network Service types definied into a datacenter.
-    * 
-    * @param datacenter
-    *           The datacenter
-    * @return The list of Network Service Types in the datacenter.
-    */
-   @Named("networkservicetype:list")
-   @GET
-   @Consumes(NetworkServiceTypesDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   NetworkServiceTypesDto listNetworkServiceTypes(
-         @EndpointLink("networkservicetypes") @BinderParam(BindToPath.class) DatacenterDto datacenter);
-
-   /**
-    * Create a new Network Service Type Dto.
-    * 
-    * @param datacenter
-    *           the datacenter where the network service type will belong to
-    * @param nst
-    *           {@link NetworkServiceTypeDto} instance to create
-    * @return the created {@link NetworkServiceTypeDto}
-    */
-   @Named("networkservicetype:create")
-   @POST
-   @Produces(NetworkServiceTypeDto.BASE_MEDIA_TYPE)
-   @Consumes(NetworkServiceTypeDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   NetworkServiceTypeDto createNetworkServiceType(
-         @EndpointLink("networkservicetypes") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @BinderParam(BindToXMLPayload.class) NetworkServiceTypeDto nst);
-
-   /**
-    * Get a single instance of a {@link NetworkServiceTypeDto}
-    * 
-    * @param datacenter
-    *           datacenter where search into
-    * @param nstId
-    *           identifier of the {@link NetworkServiceTypeDto}
-    * @return the found entity
-    */
-   @Named("networkservicetype:get")
-   @GET
-   @Consumes(NetworkServiceTypeDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   NetworkServiceTypeDto getNetworkServiceType(
-         @EndpointLink("networkservicetypes") @BinderParam(BindToPath.class) DatacenterDto datacenter,
-         @BinderParam(AppendToPath.class) Integer nstId);
-
-   /**
-    * Update the value of a {@link NetworkServiceTypeDto}
-    * 
-    * @param nstDto
-    *           the instance to update with the new values.
-    * @return the updated entity.
-    */
-   @Named("networkservicetype:update")
-   @PUT
-   @Produces(NetworkServiceTypeDto.BASE_MEDIA_TYPE)
-   @Consumes(NetworkServiceTypeDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   NetworkServiceTypeDto updateNetworkServiceType(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) NetworkServiceTypeDto nstDto);
-
-   /**
-    * Remove a {@link NetworkServiceTypeDto} entity.
-    * 
-    * @param nstDto
-    *           the entity to delete
-    */
-   @Named("networkservicetype:delete")
-   @DELETE
-   void deleteNetworkServiceType(@EndpointLink("edit") @BinderParam(BindToPath.class) NetworkServiceTypeDto nstDto);
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/TaskApi.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/TaskApi.java b/abiquo/src/main/java/org/jclouds/abiquo/features/TaskApi.java
deleted file mode 100644
index ec7c915..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/TaskApi.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import java.io.Closeable;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-
-import org.jclouds.abiquo.AbiquoFallbacks.NullOn303;
-import org.jclouds.abiquo.binders.BindLinkToPath;
-import org.jclouds.abiquo.binders.BindToPath;
-import org.jclouds.abiquo.http.filters.AbiquoAuthentication;
-import org.jclouds.abiquo.http.filters.AppendApiVersionToMediaType;
-import org.jclouds.abiquo.rest.annotations.EndpointLink;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.JAXBResponseParser;
-import org.jclouds.rest.annotations.RequestFilters;
-
-import com.abiquo.model.rest.RESTLink;
-import com.abiquo.model.transport.SingleResourceTransportDto;
-import com.abiquo.server.core.task.TaskDto;
-import com.abiquo.server.core.task.TasksDto;
-
-/**
- * Provides synchronous access to Abiquo Task API.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/API+Reference">
- *      http://community.abiquo.com/display/ABI20/API+Reference</a>
- */
-@RequestFilters({ AbiquoAuthentication.class, AppendApiVersionToMediaType.class })
-public interface TaskApi extends Closeable {
-   /*********************** Task ***********************/
-
-   /**
-    * Get a task from its link.
-    * 
-    * @param link
-    *           The link of the task.
-    * @return The task.
-    */
-   @Named("task:get")
-   @GET
-   @Consumes(TaskDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOn303.class)
-   TaskDto getTask(@BinderParam(BindLinkToPath.class) RESTLink link);
-
-   /**
-    * Get the list of tasks of the given object.
-    * 
-    * @param dto
-    *           The object.
-    * @return The list of tasks for the given object.
-    */
-   @Named("task:list")
-   @GET
-   @Consumes(TasksDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   <T extends SingleResourceTransportDto> TasksDto listTasks(@EndpointLink("tasks") @BinderParam(BindToPath.class) T dto);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/VirtualMachineTemplateApi.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/VirtualMachineTemplateApi.java b/abiquo/src/main/java/org/jclouds/abiquo/features/VirtualMachineTemplateApi.java
deleted file mode 100644
index 0abac24..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/VirtualMachineTemplateApi.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features;
-
-import java.io.Closeable;
-
-import javax.inject.Named;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-
-import org.jclouds.Fallbacks.NullOnNotFoundOr404;
-import org.jclouds.abiquo.binders.AppendToPath;
-import org.jclouds.abiquo.binders.BindToPath;
-import org.jclouds.abiquo.binders.BindToXMLPayloadAndPath;
-import org.jclouds.abiquo.domain.PaginatedCollection;
-import org.jclouds.abiquo.domain.cloud.options.ConversionOptions;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineTemplateOptions;
-import org.jclouds.abiquo.functions.ReturnTaskReferenceOrNull;
-import org.jclouds.abiquo.functions.pagination.ParseVirtualMachineTemplates;
-import org.jclouds.abiquo.http.filters.AbiquoAuthentication;
-import org.jclouds.abiquo.http.filters.AppendApiVersionToMediaType;
-import org.jclouds.abiquo.rest.annotations.EndpointLink;
-import org.jclouds.collect.PagedIterable;
-import org.jclouds.rest.annotations.BinderParam;
-import org.jclouds.rest.annotations.Fallback;
-import org.jclouds.rest.annotations.JAXBResponseParser;
-import org.jclouds.rest.annotations.RequestFilters;
-import org.jclouds.rest.annotations.ResponseParser;
-import org.jclouds.rest.annotations.Transform;
-import org.jclouds.rest.binders.BindToXMLPayload;
-
-import com.abiquo.model.enumerator.DiskFormatType;
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.abiquo.server.core.appslibrary.ConversionDto;
-import com.abiquo.server.core.appslibrary.ConversionsDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplateDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplatePersistentDto;
-import com.abiquo.server.core.appslibrary.VirtualMachineTemplatesDto;
-
-/**
- * Provides synchronous access to Abiquo Apps library API.
- * 
- * @see API: <a href="http://community.abiquo.com/display/ABI20/API+Reference">
- *      http://community.abiquo.com/display/ABI20/API+Reference</a>
- */
-@RequestFilters({ AbiquoAuthentication.class, AppendApiVersionToMediaType.class })
-@Path("/admin/enterprises")
-public interface VirtualMachineTemplateApi extends Closeable {
-   /*********************** Virtual Machine Template ***********************/
-
-   /**
-    * List all virtual machine templates for an enterprise in a datacenter
-    * repository.
-    * 
-    * @param enterpriseId
-    *           Id of the enterprise.
-    * @param datacenterRepositoryId
-    *           Id of the datacenter repository containing the templates.
-    * @return The list of virtual machine templates for the enterprise in the
-    *         datacenter repository.
-    */
-   @Named("template:list")
-   @GET
-   @Path("/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates")
-   @Consumes(VirtualMachineTemplatesDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseVirtualMachineTemplates.class)
-   @Transform(ParseVirtualMachineTemplates.ToPagedIterable.class)
-   PagedIterable<VirtualMachineTemplateDto> listVirtualMachineTemplates(@PathParam("enterprise") Integer enterpriseId,
-         @PathParam("datacenterrepository") Integer datacenterRepositoryId);
-
-   /**
-    * List all virtual machine templates for an enterprise in a datacenter
-    * repository.
-    * 
-    * @param enterpriseId
-    *           Id of the enterprise.
-    * @param datacenterRepositoryId
-    *           Id of the datacenter repository containing the templates.
-    * @param options
-    *           The options to query the virtual machine templates.
-    * @return The filtered list of virtual machine templates for the enterprise
-    *         in the datacenter repository.
-    */
-   @Named("template:list")
-   @GET
-   @Path("/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates")
-   @Consumes(VirtualMachineTemplatesDto.BASE_MEDIA_TYPE)
-   @ResponseParser(ParseVirtualMachineTemplates.class)
-   PaginatedCollection<VirtualMachineTemplateDto, VirtualMachineTemplatesDto> listVirtualMachineTemplates(
-         @PathParam("enterprise") Integer enterpriseId,
-         @PathParam("datacenterrepository") Integer datacenterRepositoryId, VirtualMachineTemplateOptions options);
-
-   /**
-    * Get the given virtual machine template.
-    * 
-    * @param enterpriseId
-    *           Id of the enterprise.
-    * @param datacenterRepositoryId
-    *           Id of the datacenter repository containing the templates.
-    * @param enterpriseId
-    *           The id of the virtual machine template.
-    * @return The virtual machine template or <code>null</code> if it does not
-    *         exist.
-    */
-   @Named("template:get")
-   @GET
-   @Path("/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates/{virtualmachinetemplate}")
-   @Consumes(VirtualMachineTemplateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   VirtualMachineTemplateDto getVirtualMachineTemplate(@PathParam("enterprise") Integer enterpriseId,
-         @PathParam("datacenterrepository") Integer datacenterRepositoryId,
-         @PathParam("virtualmachinetemplate") Integer virtualMachineTemplateId);
-
-   /**
-    * Updates an existing virtual machine template.
-    * 
-    * @param template
-    *           The new attributes for the template.
-    * @return The updated template.
-    */
-   @Named("template:update")
-   @PUT
-   @Produces(VirtualMachineTemplateDto.BASE_MEDIA_TYPE)
-   @Consumes(VirtualMachineTemplateDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   VirtualMachineTemplateDto updateVirtualMachineTemplate(
-         @EndpointLink("edit") @BinderParam(BindToXMLPayloadAndPath.class) VirtualMachineTemplateDto template);
-
-   /**
-    * Deletes an existing virtual machine template.
-    * 
-    * @param template
-    *           The virtual machine template to delete.
-    */
-   @Named("template:delete")
-   @DELETE
-   void deleteVirtualMachineTemplate(
-         @EndpointLink("edit") @BinderParam(BindToPath.class) VirtualMachineTemplateDto template);
-
-   /**
-    * Creates a persistent virtual machine template from other virtual machine
-    * template.
-    * 
-    * @param dcRepository
-    *           The repository where the persistent virtual machine template
-    *           will be created.
-    * @param options
-    *           The persistent options like name, volume/tier, virtual
-    *           datacenter and original template.
-    * @return Response message to the persistent request.
-    */
-   @Named("template:createpersistent")
-   @POST
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(VirtualMachineTemplatePersistentDto.BASE_MEDIA_TYPE)
-   @Path("/{enterprise}/datacenterrepositories/{datacenterrepository}/virtualmachinetemplates")
-   @JAXBResponseParser
-   AcceptedRequestDto<String> createPersistentVirtualMachineTemplate(@PathParam("enterprise") Integer enterpriseId,
-         @PathParam("datacenterrepository") Integer datacenterRepositoryId,
-         @BinderParam(BindToXMLPayload.class) VirtualMachineTemplatePersistentDto persistentOptions);
-
-   /**
-    * List all the conversions for a virtual machine template.
-    * 
-    * @param template
-    *           , The virtual machine template of the conversions.
-    * @return The list of conversions for the virtual machine template.
-    */
-   @Named("conversion:list")
-   @GET
-   @Consumes(ConversionsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   ConversionsDto listConversions(
-         @EndpointLink("conversions") @BinderParam(BindToPath.class) VirtualMachineTemplateDto template);
-
-   /**
-    * List conversions for a virtual machine template.
-    * 
-    * @param template
-    *           , The virtual machine template of the conversions
-    * @param options
-    *           , Optionally filter compatible conversions with a provided
-    *           hypervisor or with the desired state.
-    * @return The list of conversions for the virtual machine template with the
-    *         applied constrains.
-    */
-   @Named("conversion:list")
-   @GET
-   @Consumes(ConversionsDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   ConversionsDto listConversions(
-         @EndpointLink("conversions") @BinderParam(BindToPath.class) final VirtualMachineTemplateDto template,
-         ConversionOptions options);
-
-   /**
-    * Get the conversions for a virtual machine template and the desired target
-    * format.
-    * 
-    * @param template
-    *           , The virtual machine template of the conversion
-    * @param targetFormat
-    *           The disk format type of the requested conversion
-    * @return The conversions for the virtual machine template with the desired
-    *         target disk format type.
-    */
-   @Named("conversion:get")
-   @GET
-   @Consumes(ConversionDto.BASE_MEDIA_TYPE)
-   @JAXBResponseParser
-   @Fallback(NullOnNotFoundOr404.class)
-   ConversionDto getConversion(
-         @EndpointLink("conversions") @BinderParam(BindToPath.class) final VirtualMachineTemplateDto template,
-         @BinderParam(AppendToPath.class) DiskFormatType targetFormat);
-
-   /**
-    * Starts a V2V conversion of the current virtual machine template, or
-    * updates a failed conversion.
-    * 
-    * @param template
-    *           The virtual machine template to convert
-    * @param targetFormat
-    *           The requested target {@link DiskFormatType} of the conversion.
-    * @param conversion
-    *           , the dto representing the conversion
-    * @return an accepted request with a link to track the progress of the
-    *         conversion tasks.
-    */
-   @Named("conversion:request")
-   @PUT
-   @ResponseParser(ReturnTaskReferenceOrNull.class)
-   @Consumes(AcceptedRequestDto.BASE_MEDIA_TYPE)
-   @Produces(ConversionDto.BASE_MEDIA_TYPE)
-   AcceptedRequestDto<String> requestConversion(
-         @EndpointLink("conversions") @BinderParam(BindToPath.class) final VirtualMachineTemplateDto template,
-         @BinderParam(AppendToPath.class) DiskFormatType targetFormat,
-         @BinderParam(BindToXMLPayload.class) ConversionDto conversion);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/services/AdministrationService.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/services/AdministrationService.java b/abiquo/src/main/java/org/jclouds/abiquo/features/services/AdministrationService.java
deleted file mode 100644
index 2a98e1a..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/services/AdministrationService.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features.services;
-
-import org.jclouds.abiquo.domain.config.Category;
-import org.jclouds.abiquo.domain.config.License;
-import org.jclouds.abiquo.domain.config.Privilege;
-import org.jclouds.abiquo.domain.config.SystemProperty;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.domain.enterprise.EnterpriseProperties;
-import org.jclouds.abiquo.domain.enterprise.Role;
-import org.jclouds.abiquo.domain.enterprise.User;
-import org.jclouds.abiquo.domain.enterprise.options.EnterpriseOptions;
-import org.jclouds.abiquo.domain.infrastructure.Datacenter;
-import org.jclouds.abiquo.domain.infrastructure.Machine;
-import org.jclouds.abiquo.internal.BaseAdministrationService;
-
-import com.google.inject.ImplementedBy;
-
-/**
- * Provides high level Abiquo administration operations.
- */
-@ImplementedBy(BaseAdministrationService.class)
-public interface AdministrationService {
-   /*********************** Datacenter ***********************/
-
-   /**
-    * Get the list of all datacenters.
-    */
-   Iterable<Datacenter> listDatacenters();
-
-   /**
-    * Get the datacenter with the given id.
-    */
-   Datacenter getDatacenter(final Integer datacenterId);
-
-   /*********************** Machine ***********************/
-
-   /**
-    * Get the list of all machines in the infrastructure.
-    */
-   Iterable<Machine> listMachines();
-
-   /*********************** Enterprise ***********************/
-
-   /**
-    * Get the list of all enterprises.
-    */
-   Iterable<Enterprise> listEnterprises();
-
-   /**
-    * Get the list of all enterprises, filtered with the given options.
-    */
-   Iterable<Enterprise> listEnterprises(EnterpriseOptions options);
-
-   /**
-    * Get the enterprise with the given id.
-    */
-   Enterprise getEnterprise(final Integer enterpriseId);
-
-   /*********************** Enterprise Properties ***********************/
-   /**
-    * Get the properties of an enterprise.
-    */
-   EnterpriseProperties getEnterpriseProperties(final Enterprise enterprise);
-
-   /*********************** Role ***********************/
-
-   /**
-    * Get the list of global roles.
-    */
-   Iterable<Role> listRoles();
-
-   /**
-    * Get the role with the given id.
-    */
-   Role getRole(final Integer roleId);
-
-   /*********************** Privilege ***********************/
-
-   /**
-    * Get the list of global privileges.
-    */
-   Iterable<Privilege> listPrivileges();
-
-   /**
-    * Get a privilege given its id.
-    * 
-    * @param privilegeId
-    *           The id of the privilege.
-    * @return The privilege.
-    */
-   Privilege getPrivilege(Integer privilegeId);
-
-   /*********************** User ***********************/
-
-   /**
-    * Get the current user.
-    */
-   User getCurrentUser();
-
-   /**
-    * Get the enterprise of the current user.
-    */
-   Enterprise getCurrentEnterprise();
-
-   /*********************** License ***********************/
-
-   /**
-    * Get the list of all licenses.
-    */
-   Iterable<License> listLicenses();
-
-   /**
-    * Get the list of all active/inactive licenses.
-    * 
-    * @param active
-    *           Defines if searching for active (<code>true</code>) or inactive
-    *           ( <code>false</code>) licenses.
-    */
-   Iterable<License> listLicenses(boolean active);
-
-   /*********************** System Properties ***********************/
-
-   /**
-    * Get the list of system properties.
-    */
-   Iterable<SystemProperty> listSystemProperties();
-
-   /**
-    * Get the system property with the give name or <code>null</code> if none is
-    * found.
-    */
-   SystemProperty getSystemProperty(String name);
-
-   /**
-    * Get the list of system properties with options.
-    */
-   Iterable<SystemProperty> listSystemProperties(String component);
-
-   /*********************** Category ***********************/
-
-   /**
-    * Get the list of categories.
-    */
-   Iterable<Category> listCategories();
-
-   /**
-    * Get the category identified by the given id.
-    * 
-    * @param categoryId
-    *           The id of the category.
-    * @return The requested category.
-    */
-   Category getCategory(Integer categoryId);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/services/CloudService.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/services/CloudService.java b/abiquo/src/main/java/org/jclouds/abiquo/features/services/CloudService.java
deleted file mode 100644
index 91c5423..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/services/CloudService.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features.services;
-
-import java.util.List;
-
-import org.jclouds.abiquo.domain.cloud.VirtualAppliance;
-import org.jclouds.abiquo.domain.cloud.VirtualDatacenter;
-import org.jclouds.abiquo.domain.cloud.VirtualMachine;
-import org.jclouds.abiquo.domain.cloud.options.VirtualMachineOptions;
-import org.jclouds.abiquo.domain.enterprise.Enterprise;
-import org.jclouds.abiquo.internal.BaseCloudService;
-
-import com.google.inject.ImplementedBy;
-
-/**
- * Provides high level Abiquo cloud operations.
- */
-@ImplementedBy(BaseCloudService.class)
-public interface CloudService {
-   /*********************** Virtual Datacenter ***********************/
-
-   /**
-    * Get the list of all virtual datacenters.
-    */
-   Iterable<VirtualDatacenter> listVirtualDatacenters();
-
-   /**
-    * Get the list of all virtual datacenters for a pair enterprise-datacenter.
-    * 
-    * @param enterprise
-    *           The given enterprise.
-    * @param datacenter
-    *           The given datacenter.
-    */
-   Iterable<VirtualDatacenter> listVirtualDatacenters(final Enterprise enterprise);
-
-   /**
-    * Get the virtual datacenter with the given id.
-    */
-   VirtualDatacenter getVirtualDatacenter(final Integer virtualDatacenterId);
-
-   /**
-    * Get the list of virtual datacenter with the given ids.
-    */
-   Iterable<VirtualDatacenter> getVirtualDatacenters(final List<Integer> virtualDatacenterIds);
-
-   /*********************** Virtual Appliance ***********************/
-
-   /**
-    * Get the list of all virtual appliances.
-    */
-   Iterable<VirtualAppliance> listVirtualAppliances();
-
-   /*********************** Virtual Machine ***********************/
-
-   /**
-    * Get the list of all virtual machines.
-    */
-   Iterable<VirtualMachine> listVirtualMachines();
-
-   /**
-    * Get the list of all virtual machines filtered with the given options.
-    */
-   Iterable<VirtualMachine> listVirtualMachines(VirtualMachineOptions options);
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/services/EventService.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/services/EventService.java b/abiquo/src/main/java/org/jclouds/abiquo/features/services/EventService.java
deleted file mode 100644
index 5197793..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/services/EventService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features.services;
-
-import org.jclouds.abiquo.domain.event.Event;
-import org.jclouds.abiquo.domain.event.options.EventOptions;
-import org.jclouds.abiquo.internal.BaseEventService;
-
-import com.google.inject.ImplementedBy;
-
-/**
- * Provides high level Abiquo event operations.
- */
-@ImplementedBy(BaseEventService.class)
-public interface EventService {
-   /**
-    * Get the list of all events.
-    */
-   Iterable<Event> listEvents();
-
-   /**
-    * Get the list of all events using filters as query params.
-    */
-   Iterable<Event> listEvents(EventOptions options);
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/features/services/MonitoringService.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/features/services/MonitoringService.java b/abiquo/src/main/java/org/jclouds/abiquo/features/services/MonitoringService.java
deleted file mode 100644
index db63f7a..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/features/services/MonitoringService.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.features.services;
-
-import java.util.concurrent.TimeUnit;
-
-import org.jclouds.abiquo.internal.BaseMonitoringService;
-import org.jclouds.abiquo.monitor.AsyncTaskMonitor;
-import org.jclouds.abiquo.monitor.ConversionMonitor;
-import org.jclouds.abiquo.monitor.MonitorStatus;
-import org.jclouds.abiquo.monitor.VirtualApplianceMonitor;
-import org.jclouds.abiquo.monitor.VirtualMachineMonitor;
-import org.jclouds.abiquo.monitor.handlers.AbstractEventHandler;
-
-import com.google.common.base.Function;
-import com.google.inject.ImplementedBy;
-
-/**
- * Utility service to monitor asynchronous operations.
- */
-@ImplementedBy(BaseMonitoringService.class)
-public interface MonitoringService {
-
-   /*************** Generic monitoring methods ***************/
-
-   /**
-    * Monitor the given objects using the given complete condition.
-    * 
-    * @param completeCondition
-    *           The function that will be used to decide if the asynchronous
-    *           operations have finished.
-    * @param objects
-    *           The objects to monitor.
-    */
-   <T> void awaitCompletion(final Function<T, MonitorStatus> completeCondition, final T... objects);
-
-   /**
-    * Monitor the given objects using the given complete condition.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param completeCondition
-    *           The function that will be used to decide if the asynchronous
-    *           operations have finished.
-    * @param objects
-    *           The objects to monitor.
-    */
-   <T> void awaitCompletion(final Long maxWait, final TimeUnit timeUnit,
-         final Function<T, MonitorStatus> completeCondition, final T... objects);
-
-   /**
-    * Monitor the given objects using the given complete condition.
-    * 
-    * @param completeCondition
-    *           The function that will be used to decide if the asynchronous
-    *           operations have finished.
-    * @param objects
-    *           The objects to monitor.
-    */
-   <T> void monitor(final Function<T, MonitorStatus> completeCondition, final T... objects);
-
-   /**
-    * Monitor the given objects using the given complete condition.
-    * 
-    * @param maxWait
-    *           The maximum time to wait.
-    * @param timeUnit
-    *           The time unit for the maxWait parameter.
-    * @param completeCondition
-    *           The function that will be used to decide if the asynchronous
-    *           operations have finished.
-    * @param objects
-    *           The objects to monitor.
-    */
-   <T> void monitor(final Long maxWait, final TimeUnit timeUnit,
-         final Function<T, MonitorStatus> completeCondition, final T... objects);
-
-   /*************** Handler registration methods ***************/
-
-   /**
-    * Registers the given event handler.
-    * 
-    * @param <T>
-    *           The type of event handler to register.
-    * @param handler
-    *           The event handler to register.
-    */
-   <T extends AbstractEventHandler<?>> void register(T handler);
-
-   /**
-    * Unregisters the given event handler.
-    * 
-    * @param <T>
-    *           The type of event handler to unregister.
-    * @param handler
-    *           The event handler to unregister.
-    */
-   <T extends AbstractEventHandler<?>> void unregister(T handler);
-
-   /*************** Delegating monitors ***************/
-
-   /**
-    * Gets the virtual machine monitor service.
-    * 
-    * @return The virtual machine monitor service.
-    */
-   VirtualMachineMonitor getVirtualMachineMonitor();
-
-   /**
-    * Gets the virtual appliance monitor service.
-    * 
-    * @return The virtual appliance monitor service.
-    */
-   VirtualApplianceMonitor getVirtualApplianceMonitor();
-
-   /**
-    * Gets the asynchronous task monitor service.
-    * 
-    * @return The asynchronous task monitor service.
-    */
-   AsyncTaskMonitor getAsyncTaskMonitor();
-
-   /**
-    * Gets the conversion monitor service.
-    * 
-    * @return The conversion monitor service.
-    */
-   ConversionMonitor getConversionMonitor();
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/AppendApiVersionToAbiquoMimeType.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/AppendApiVersionToAbiquoMimeType.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/AppendApiVersionToAbiquoMimeType.java
index e62ad40..0e2be07 100644
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/AppendApiVersionToAbiquoMimeType.java
+++ b/abiquo/src/main/java/org/jclouds/abiquo/functions/AppendApiVersionToAbiquoMimeType.java
@@ -20,7 +20,6 @@ import static com.google.common.base.Preconditions.checkNotNull;
 
 import javax.inject.Inject;
 import javax.inject.Singleton;
-import javax.ws.rs.core.MediaType;
 
 import org.jclouds.rest.annotations.ApiVersion;
 
@@ -38,23 +37,18 @@ public class AppendApiVersionToAbiquoMimeType implements Function<String, String
    protected String apiVersion;
 
    @Inject
-   public AppendApiVersionToAbiquoMimeType(@ApiVersion final String apiVersion) {
-      super();
+   AppendApiVersionToAbiquoMimeType(@ApiVersion final String apiVersion) {
       this.apiVersion = checkNotNull(apiVersion, "apiVersion");
    }
 
    @Override
    public String apply(final String input) {
-      MediaType mediaType = MediaType.valueOf(checkNotNull(input, "input"));
-      if (isAbiquoMimeType(input) && !mediaType.getParameters().containsKey("version")) {
-         return mediaType.toString() + ";version=" + apiVersion;
+      checkNotNull(input, "input");
+      if (input.startsWith(ABIQUO_MIME_TYPE_PREFIX) && !input.contains("version")) {
+         return input + ";version=" + apiVersion;
       } else {
-         return mediaType.toString();
+         return input;
       }
    }
 
-   private static boolean isAbiquoMimeType(final String mimeType) {
-      return mimeType.startsWith(ABIQUO_MIME_TYPE_PREFIX);
-   }
-
 }

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/ParseErrors.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/ParseErrors.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/ParseErrors.java
deleted file mode 100644
index e348f9f..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/ParseErrors.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.transport.error.ErrorsDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Parses a errors object.
- */
-@Singleton
-public class ParseErrors extends ParseXMLWithJAXB<ErrorsDto> {
-   @Inject
-   public ParseErrors(final XMLParser xml, final TypeLiteral<ErrorsDto> type) {
-      super(xml, type);
-   }
-
-}

http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/1b689dc1/abiquo/src/main/java/org/jclouds/abiquo/functions/ReturnTaskReferenceOrNull.java
----------------------------------------------------------------------
diff --git a/abiquo/src/main/java/org/jclouds/abiquo/functions/ReturnTaskReferenceOrNull.java b/abiquo/src/main/java/org/jclouds/abiquo/functions/ReturnTaskReferenceOrNull.java
deleted file mode 100644
index b7c8b81..0000000
--- a/abiquo/src/main/java/org/jclouds/abiquo/functions/ReturnTaskReferenceOrNull.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.abiquo.functions;
-
-import static org.jclouds.http.HttpUtils.releasePayload;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import javax.ws.rs.core.Response.Status;
-
-import org.jclouds.http.HttpResponse;
-import org.jclouds.http.functions.ParseXMLWithJAXB;
-import org.jclouds.xml.XMLParser;
-
-import com.abiquo.model.transport.AcceptedRequestDto;
-import com.google.inject.TypeLiteral;
-
-/**
- * Return an {@link AcceptedRequestDto} representing the asynchronous task or
- * <code>null</code> if the operation completed synchronously.
- * <p>
- * Operations that generate asynchronous tasks will return one of the following:
- * <ul>
- * <li>204 if the operation completed synchronously</li>
- * <li>202 with the asynchronous task reference in the body if the operation has
- * been submitted and will be executed asynchronously</li>
- * </ul>
- */
-@Singleton
-public class ReturnTaskReferenceOrNull extends ParseXMLWithJAXB<AcceptedRequestDto<String>> {
-   @Inject
-   public ReturnTaskReferenceOrNull(final XMLParser xml, final TypeLiteral<AcceptedRequestDto<String>> type) {
-      super(xml, type);
-   }
-
-   @Override
-   public AcceptedRequestDto<String> apply(final HttpResponse from) {
-      if (from.getStatusCode() == Status.NO_CONTENT.getStatusCode()) {
-         releasePayload(from);
-         return null;
-      } else {
-         return super.apply(from);
-      }
-   }
-
-}